diff --git a/Gruntfile.js b/Gruntfile.js index d2cfd1fb5c..a892636cf7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,245 +1,245 @@ module.exports = function (grunt) { - var jsFilesToMinify = [ - 'client/lib/jquery-2.0.2.min.js', - 'client/lib/underscore-min.js', - 'client/lib/backbone-min.js', - 'client/lib/handlebars.js', - 'client/lib/base64.js', - 'client/lib/jquery-ui.min.js', - 'client/lib/moment.min.js', - 'client/lib/moment-timezone-with-data.min.js', - 'client/lib/jquery.timepicker.min.js', - 'client/lib/jquery.autocomplete.js', - 'client/lib/bootstrap.min.js', - 'client/lib/bootstrap-datepicker.js', - 'client/lib/bull.min.js', - 'client/src/namespace.js', - 'client/src/exceptions.js', - 'client/src/app.js', - 'client/src/utils.js', - 'client/src/storage.js', - 'client/src/loader.js', - 'client/src/pre-loader.js', - 'client/src/ui.js', - 'client/src/acl.js', - 'client/src/model.js', - 'client/src/model-offline.js', - 'client/src/metadata.js', - 'client/src/language.js', - 'client/src/cache.js', - 'client/src/controller.js', - 'client/src/router.js', - 'client/src/date-time.js', - 'client/src/field-manager.js', - 'client/src/search-manager.js', - 'client/src/collection.js', - 'client/src/multi-collection.js', - 'client/src/view-helper.js', - 'client/src/layout-manager.js', - 'client/src/model-factory.js', - 'client/src/collection-factory.js', - 'client/src/models/settings.js', - 'client/src/models/user.js', - 'client/src/models/preferences.js', - 'client/src/controllers/base.js', - 'client/src/view.js', - ]; - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - - mkdir: { - tmp: { - options: { - mode: 0775, - create: [ - 'build/tmp', - ] - }, + var jsFilesToMinify = [ + 'client/lib/jquery-2.0.2.min.js', + 'client/lib/underscore-min.js', + 'client/lib/backbone-min.js', + 'client/lib/handlebars.js', + 'client/lib/base64.js', + 'client/lib/jquery-ui.min.js', + 'client/lib/moment.min.js', + 'client/lib/moment-timezone-with-data.min.js', + 'client/lib/jquery.timepicker.min.js', + 'client/lib/jquery.autocomplete.js', + 'client/lib/bootstrap.min.js', + 'client/lib/bootstrap-datepicker.js', + 'client/lib/bull.min.js', + 'client/src/namespace.js', + 'client/src/exceptions.js', + 'client/src/app.js', + 'client/src/utils.js', + 'client/src/storage.js', + 'client/src/loader.js', + 'client/src/pre-loader.js', + 'client/src/ui.js', + 'client/src/acl.js', + 'client/src/model.js', + 'client/src/model-offline.js', + 'client/src/metadata.js', + 'client/src/language.js', + 'client/src/cache.js', + 'client/src/controller.js', + 'client/src/router.js', + 'client/src/date-time.js', + 'client/src/field-manager.js', + 'client/src/search-manager.js', + 'client/src/collection.js', + 'client/src/multi-collection.js', + 'client/src/view-helper.js', + 'client/src/layout-manager.js', + 'client/src/model-factory.js', + 'client/src/collection-factory.js', + 'client/src/models/settings.js', + 'client/src/models/user.js', + 'client/src/models/preferences.js', + 'client/src/controllers/base.js', + 'client/src/view.js', + ]; + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + + mkdir: { + tmp: { + options: { + mode: 0775, + create: [ + 'build/tmp', + ] + }, - } - }, - clean: { - start: ['build/*'], - final: ['build/tmp'], - }, - less: { - bootstrap: { - options: { - yuicompress: true, - }, - files: { - 'frontend/client/css/bootstrap.css': 'frontend/less/espo/main.less', - }, - }, - }, - cssmin: { - minify: { - files: { - 'build/tmp/client/css/espo.min.css': [ - 'frontend/client/css/bootstrap.css', - 'frontend/client/css/datepicker.css', - 'frontend/client/css/jquery.timepicker.css', - ] - } - }, - }, - uglify: { - options: { - mangle: false, - banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n', - }, - 'build/tmp/client/espo.min.js': jsFilesToMinify.map(function (item) { - return 'frontend/' + item; - }) - }, - copy: { - frontendFolders: { - expand: true, - cwd: 'frontend/client', - src: [ - 'src/**', - 'res/**', - 'fonts/**', - 'cfg/**', - 'modules/**', - 'img/**', - 'css/**', - ], - dest: 'build/tmp/client', - }, - frontendHtml: { - src: 'frontend/html/reset.html', - dest: 'build/tmp/reset.html' - }, - frontendLib: { - expand: true, - dot: true, - cwd: 'frontend/client/lib', - src: '**', - dest: 'build/tmp/client/lib/', - }, - backend: { - expand: true, - dot: true, - src: [ - 'api/**', - 'application/**', - 'custom/**', - 'data/.data', - 'install/**', - 'vendor/**', - 'bootstrap.php', - 'cron.php', - 'rebuild.php', - 'index.php', - 'LICENSE.txt', - '.htaccess', - 'web.config', - ], - dest: 'build/tmp/', - }, - final: { - expand: true, - dot: true, - src: '**', - cwd: 'build/tmp', - dest: 'build/EspoCRM-<%= pkg.version %>/', - }, - }, - chmod: { - options: { - mode: '755' - }, - php: { - options: { - mode: '644' - }, - src: [ - 'build/EspoCRM-<%= pkg.version %>/**/*.php', - 'build/EspoCRM-<%= pkg.version %>/**/*.json', - 'build/EspoCRM-<%= pkg.version %>/**/*.config', - 'build/EspoCRM-<%= pkg.version %>/**/.htaccess', - 'build/EspoCRM-<%= pkg.version %>/client/**/*.js', - 'build/EspoCRM-<%= pkg.version %>/client/**/*.css', - 'build/EspoCRM-<%= pkg.version %>/client/**/*.tpl', - 'build/EspoCRM-<%= pkg.version %>/**/*.html', - 'build/EspoCRM-<%= pkg.version %>/**/*.txt', - ] - } - }, - replace: { - timestamp: { - options: { - patterns: [ - { - match: 'timestamp', - replacement: '<%= new Date().getTime() %>' - } - ] - }, - files: [ - { - src: 'frontend/html/main.html', - dest: 'build/tmp/main.html' - } - ] - }, - version: { - options: { - patterns: [ - { - match: 'version', - replacement: '<%= pkg.version %>' - } - ] - }, - files: [ - { - src: 'build/tmp/application/Espo/Core/defaults/config.php', - dest: 'build/tmp/application/Espo/Core/defaults/config.php' - } - ] - } - }, - compress: { - final: { - options: { - archive: 'build/EspoCRM-<%= pkg.version %>.zip', - mode: 'zip' - }, - src: ['**'], - cwd: 'build/EspoCRM-<%= pkg.version %>', - dest: 'EspoCRM-<%= pkg.version %>' - } - } - }); + } + }, + clean: { + start: ['build/*'], + final: ['build/tmp'], + }, + less: { + bootstrap: { + options: { + yuicompress: true, + }, + files: { + 'frontend/client/css/bootstrap.css': 'frontend/less/espo/main.less', + }, + }, + }, + cssmin: { + minify: { + files: { + 'build/tmp/client/css/espo.min.css': [ + 'frontend/client/css/bootstrap.css', + 'frontend/client/css/datepicker.css', + 'frontend/client/css/jquery.timepicker.css', + ] + } + }, + }, + uglify: { + options: { + mangle: false, + banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n', + }, + 'build/tmp/client/espo.min.js': jsFilesToMinify.map(function (item) { + return 'frontend/' + item; + }) + }, + copy: { + frontendFolders: { + expand: true, + cwd: 'frontend/client', + src: [ + 'src/**', + 'res/**', + 'fonts/**', + 'cfg/**', + 'modules/**', + 'img/**', + 'css/**', + ], + dest: 'build/tmp/client', + }, + frontendHtml: { + src: 'frontend/html/reset.html', + dest: 'build/tmp/reset.html' + }, + frontendLib: { + expand: true, + dot: true, + cwd: 'frontend/client/lib', + src: '**', + dest: 'build/tmp/client/lib/', + }, + backend: { + expand: true, + dot: true, + src: [ + 'api/**', + 'application/**', + 'custom/**', + 'data/.data', + 'install/**', + 'vendor/**', + 'bootstrap.php', + 'cron.php', + 'rebuild.php', + 'index.php', + 'LICENSE.txt', + '.htaccess', + 'web.config', + ], + dest: 'build/tmp/', + }, + final: { + expand: true, + dot: true, + src: '**', + cwd: 'build/tmp', + dest: 'build/EspoCRM-<%= pkg.version %>/', + }, + }, + chmod: { + options: { + mode: '755' + }, + php: { + options: { + mode: '644' + }, + src: [ + 'build/EspoCRM-<%= pkg.version %>/**/*.php', + 'build/EspoCRM-<%= pkg.version %>/**/*.json', + 'build/EspoCRM-<%= pkg.version %>/**/*.config', + 'build/EspoCRM-<%= pkg.version %>/**/.htaccess', + 'build/EspoCRM-<%= pkg.version %>/client/**/*.js', + 'build/EspoCRM-<%= pkg.version %>/client/**/*.css', + 'build/EspoCRM-<%= pkg.version %>/client/**/*.tpl', + 'build/EspoCRM-<%= pkg.version %>/**/*.html', + 'build/EspoCRM-<%= pkg.version %>/**/*.txt', + ] + } + }, + replace: { + timestamp: { + options: { + patterns: [ + { + match: 'timestamp', + replacement: '<%= new Date().getTime() %>' + } + ] + }, + files: [ + { + src: 'frontend/html/main.html', + dest: 'build/tmp/main.html' + } + ] + }, + version: { + options: { + patterns: [ + { + match: 'version', + replacement: '<%= pkg.version %>' + } + ] + }, + files: [ + { + src: 'build/tmp/application/Espo/Core/defaults/config.php', + dest: 'build/tmp/application/Espo/Core/defaults/config.php' + } + ] + } + }, + compress: { + final: { + options: { + archive: 'build/EspoCRM-<%= pkg.version %>.zip', + mode: 'zip' + }, + src: ['**'], + cwd: 'build/EspoCRM-<%= pkg.version %>', + dest: 'EspoCRM-<%= pkg.version %>' + } + } + }); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-mkdir'); - grunt.loadNpmTasks('grunt-contrib-less'); - grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-replace'); - grunt.loadNpmTasks('grunt-contrib-compress'); - grunt.loadNpmTasks('grunt-chmod'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-mkdir'); + grunt.loadNpmTasks('grunt-contrib-less'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-replace'); + grunt.loadNpmTasks('grunt-contrib-compress'); + grunt.loadNpmTasks('grunt-chmod'); - grunt.registerTask('default', [ - 'clean:start', - 'mkdir:tmp', - 'less', - 'cssmin', - 'uglify', - 'copy:frontendFolders', - 'copy:frontendHtml', - 'copy:frontendLib', - 'copy:backend', - 'replace', - 'copy:final', - 'chmod', - 'clean:final', - ]); + grunt.registerTask('default', [ + 'clean:start', + 'mkdir:tmp', + 'less', + 'cssmin', + 'uglify', + 'copy:frontendFolders', + 'copy:frontendHtml', + 'copy:frontendLib', + 'copy:backend', + 'replace', + 'copy:final', + 'chmod', + 'clean:final', + ]); }; diff --git a/application/Espo/Controllers/Admin.php b/application/Espo/Controllers/Admin.php index 9aa225f8a1..798990837c 100644 --- a/application/Espo/Controllers/Admin.php +++ b/application/Espo/Controllers/Admin.php @@ -27,60 +27,60 @@ use \Espo\Core\Exceptions\Error, class Admin extends \Espo\Core\Controllers\Base { - protected function checkControllerAccess() - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - } + protected function checkControllerAccess() + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + } - public function actionRebuild($params, $data) - { - $result = $this->getContainer()->get('dataManager')->rebuild(); + public function actionRebuild($params, $data) + { + $result = $this->getContainer()->get('dataManager')->rebuild(); - return $result; - } + return $result; + } - public function actionClearCache($params, $data) - { - $result = $this->getContainer()->get('dataManager')->clearCache(); + public function actionClearCache($params, $data) + { + $result = $this->getContainer()->get('dataManager')->clearCache(); - return $result; - } + return $result; + } - public function actionJobs() - { - $scheduledJob = $this->getContainer()->get('scheduledJob'); + public function actionJobs() + { + $scheduledJob = $this->getContainer()->get('scheduledJob'); - return $scheduledJob->getAllNamesOnly(); - } + return $scheduledJob->getAllNamesOnly(); + } - public function actionUploadUpgradePackage($params, $data) - { - $upgradeManager = new \Espo\Core\UpgradeManager($this->getContainer()); + public function actionUploadUpgradePackage($params, $data) + { + $upgradeManager = new \Espo\Core\UpgradeManager($this->getContainer()); - $upgradeId = $upgradeManager->upload($data); - $manifest = $upgradeManager->getManifest(); + $upgradeId = $upgradeManager->upload($data); + $manifest = $upgradeManager->getManifest(); - return array( - 'id' => $upgradeId, - 'version' => $manifest['version'], - ); - } + return array( + 'id' => $upgradeId, + 'version' => $manifest['version'], + ); + } - public function actionRunUpgrade($params, $data) - { - $upgradeManager = new \Espo\Core\UpgradeManager($this->getContainer()); + public function actionRunUpgrade($params, $data) + { + $upgradeManager = new \Espo\Core\UpgradeManager($this->getContainer()); - $upgradeManager->install($data['id']); + $upgradeManager->install($data['id']); - return true; - } + return true; + } - public function actionCronMessage($params, $data) - { - return $this->getContainer()->get('scheduledJob')->getSetupMessage(); - } + public function actionCronMessage($params, $data) + { + return $this->getContainer()->get('scheduledJob')->getSetupMessage(); + } } diff --git a/application/Espo/Controllers/App.php b/application/Espo/Controllers/App.php index 9feba226de..09ae50b1c9 100644 --- a/application/Espo/Controllers/App.php +++ b/application/Espo/Controllers/App.php @@ -26,25 +26,25 @@ use \Espo\Core\Exceptions\BadRequest; class App extends \Espo\Core\Controllers\Record { - public function actionUser() - { - return array( - 'user' => $this->getUser()->toArray(), - 'acl' => $this->getAcl()->toArray(), - 'preferences' => $this->getPreferences()->toArray(), - 'token' => $this->getUser()->get('token') - ); - } - - public function actionDestroyAuthToken($params, $data) - { - $token = $data['token']; - if (empty($token)) { - throw new BadRequest(); - } + public function actionUser() + { + return array( + 'user' => $this->getUser()->toArray(), + 'acl' => $this->getAcl()->toArray(), + 'preferences' => $this->getPreferences()->toArray(), + 'token' => $this->getUser()->get('token') + ); + } + + public function actionDestroyAuthToken($params, $data) + { + $token = $data['token']; + if (empty($token)) { + throw new BadRequest(); + } - $auth = new \Espo\Core\Utils\Auth($this->getContainer()); - return $auth->destroyAuthToken($token); - } + $auth = new \Espo\Core\Utils\Auth($this->getContainer()); + return $auth->destroyAuthToken($token); + } } diff --git a/application/Espo/Controllers/Attachment.php b/application/Espo/Controllers/Attachment.php index a2baabbc2f..49fd0157d1 100644 --- a/application/Espo/Controllers/Attachment.php +++ b/application/Espo/Controllers/Attachment.php @@ -25,19 +25,19 @@ namespace Espo\Controllers; class Attachment extends \Espo\Core\Controllers\Record { - public function actionUpload($params, $data) - { - list($prefix, $contents) = explode(',', $data); - $contents = base64_decode($contents); - - $attachment = $this->getEntityManager()->getEntity('Attachment'); - $this->getEntityManager()->saveEntity($attachment); - $this->getContainer()->get('fileManager')->putContents('data/upload/' . $attachment->id, $contents); - - return array( - 'attachmentId' => $attachment->id - ); - } + public function actionUpload($params, $data) + { + list($prefix, $contents) = explode(',', $data); + $contents = base64_decode($contents); + + $attachment = $this->getEntityManager()->getEntity('Attachment'); + $this->getEntityManager()->saveEntity($attachment); + $this->getContainer()->get('fileManager')->putContents('data/upload/' . $attachment->id, $contents); + + return array( + 'attachmentId' => $attachment->id + ); + } } diff --git a/application/Espo/Controllers/AuthToken.php b/application/Espo/Controllers/AuthToken.php index 6372aa703e..5c1b441542 100644 --- a/application/Espo/Controllers/AuthToken.php +++ b/application/Espo/Controllers/AuthToken.php @@ -25,42 +25,42 @@ namespace Espo\Controllers; use \Espo\Core\Exceptions\Forbidden; class AuthToken extends \Espo\Core\Controllers\Record -{ - protected function checkControllerAccess() - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - } - - public function actionUpdate($params, $data) - { - throw new Forbidden(); - } - - public function actionCreate($params, $data) - { - 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) - { - throw new Forbidden(); - } +{ + protected function checkControllerAccess() + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + } + + public function actionUpdate($params, $data) + { + throw new Forbidden(); + } + + public function actionCreate($params, $data) + { + 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) + { + throw new Forbidden(); + } } diff --git a/application/Espo/Controllers/Email.php b/application/Espo/Controllers/Email.php index 1763f4c71f..f8ad821496 100644 --- a/application/Espo/Controllers/Email.php +++ b/application/Espo/Controllers/Email.php @@ -24,11 +24,11 @@ namespace Espo\Controllers; class Email extends \Espo\Core\Controllers\Record { - public function actionGetCopiedAttachments($params, $data, $request) - { - $id = $request->get('id'); - - return $this->getRecordService()->getCopiedAttachments($id); - } + public function actionGetCopiedAttachments($params, $data, $request) + { + $id = $request->get('id'); + + return $this->getRecordService()->getCopiedAttachments($id); + } } diff --git a/application/Espo/Controllers/EmailAccount.php b/application/Espo/Controllers/EmailAccount.php index a765f9563e..e6c86ec026 100644 --- a/application/Espo/Controllers/EmailAccount.php +++ b/application/Espo/Controllers/EmailAccount.php @@ -24,17 +24,17 @@ namespace Espo\Controllers; class EmailAccount extends \Espo\Core\Controllers\Record { - public function actionGetFolders($params, $data, $request) - { - return $this->getRecordService()->getFolders(array( - 'host' => $request->get('host'), - 'port' => $request->get('port'), - 'ssl' => $request->get('ssl'), - 'username' => $request->get('username'), - 'password' => $request->get('password'), - 'id' => $request->get('id') - )); + public function actionGetFolders($params, $data, $request) + { + return $this->getRecordService()->getFolders(array( + 'host' => $request->get('host'), + 'port' => $request->get('port'), + 'ssl' => $request->get('ssl'), + 'username' => $request->get('username'), + 'password' => $request->get('password'), + 'id' => $request->get('id') + )); - } + } } diff --git a/application/Espo/Controllers/EmailAddress.php b/application/Espo/Controllers/EmailAddress.php index f990466aa0..c01652e3b6 100644 --- a/application/Espo/Controllers/EmailAddress.php +++ b/application/Espo/Controllers/EmailAddress.php @@ -24,14 +24,14 @@ namespace Espo\Controllers; class EmailAddress extends \Espo\Core\Controllers\Record { - public function actionSearchInAddressBook($params, $data, $request) - { - $q = $request->get('q'); - $limit = intval($request->get('limit')); - if (empty($limit) || $limit > 30) { - $limit = 5; - } - return $this->getRecordService()->searchInAddressBook($q, $limit); - } + public function actionSearchInAddressBook($params, $data, $request) + { + $q = $request->get('q'); + $limit = intval($request->get('limit')); + if (empty($limit) || $limit > 30) { + $limit = 5; + } + return $this->getRecordService()->searchInAddressBook($q, $limit); + } } diff --git a/application/Espo/Controllers/EmailTemplate.php b/application/Espo/Controllers/EmailTemplate.php index 1cc8687fa1..2c2e00485f 100644 --- a/application/Espo/Controllers/EmailTemplate.php +++ b/application/Espo/Controllers/EmailTemplate.php @@ -26,20 +26,20 @@ 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'), - ), true); - } + 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'), + ), true); + } } diff --git a/application/Espo/Controllers/Extension.php b/application/Espo/Controllers/Extension.php index 0cab3b960a..57968eaa4c 100644 --- a/application/Espo/Controllers/Extension.php +++ b/application/Espo/Controllers/Extension.php @@ -27,105 +27,105 @@ use \Espo\Core\Exceptions\Forbidden; class Extension extends \Espo\Core\Controllers\Record { - protected function checkControllerAccess() - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - } + protected function checkControllerAccess() + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + } - public function actionUpload($params, $data, $request) - { - if (!$request->isPost()) { - throw new Forbidden(); - } + public function actionUpload($params, $data, $request) + { + if (!$request->isPost()) { + throw new Forbidden(); + } - $manager = new \Espo\Core\ExtensionManager($this->getContainer()); + $manager = new \Espo\Core\ExtensionManager($this->getContainer()); - $id = $manager->upload($data); - $manifest = $manager->getManifest(); + $id = $manager->upload($data); + $manifest = $manager->getManifest(); - return array( - 'id' => $id, - 'version' => $manifest['version'], - 'name' => $manifest['name'], - 'description' => $manifest['description'], - ); - } + return array( + 'id' => $id, + 'version' => $manifest['version'], + 'name' => $manifest['name'], + 'description' => $manifest['description'], + ); + } - public function actionInstall($params, $data, $request) - { - if (!$request->isPost()) { - throw new Forbidden(); - } + public function actionInstall($params, $data, $request) + { + if (!$request->isPost()) { + throw new Forbidden(); + } - $manager = new \Espo\Core\ExtensionManager($this->getContainer()); + $manager = new \Espo\Core\ExtensionManager($this->getContainer()); - $manager->install($data['id']); + $manager->install($data['id']); - return true; - } + return true; + } - public function actionUninstall($params, $data, $request) - { - if (!$request->isPost()) { - throw new Forbidden(); - } + public function actionUninstall($params, $data, $request) + { + if (!$request->isPost()) { + throw new Forbidden(); + } - $manager = new \Espo\Core\ExtensionManager($this->getContainer()); + $manager = new \Espo\Core\ExtensionManager($this->getContainer()); - $manager->uninstall($data['id']); + $manager->uninstall($data['id']); - return true; - } + return true; + } - public function actionCreate() - { - throw new Forbidden(); - } + public function actionCreate() + { + throw new Forbidden(); + } - public function actionUpdate() - { - throw new Forbidden(); - } + public function actionUpdate() + { + throw new Forbidden(); + } - public function actionPatch() - { - throw new Forbidden(); - } + public function actionPatch() + { + throw new Forbidden(); + } - public function actionListLinked() - { - throw new Forbidden(); - } + public function actionListLinked() + { + throw new Forbidden(); + } - public function actionDelete($params, $data, $request) - { - $manager = new \Espo\Core\ExtensionManager($this->getContainer()); + public function actionDelete($params, $data, $request) + { + $manager = new \Espo\Core\ExtensionManager($this->getContainer()); - $manager->delete($params['id']); + $manager->delete($params['id']); - return true; - } + return true; + } - public function actionMassUpdate() - { - throw new Forbidden(); - } + public function actionMassUpdate() + { + throw new Forbidden(); + } - public function actionMassDelete() - { - throw new Forbidden(); - } + public function actionMassDelete() + { + throw new Forbidden(); + } - public function actionCreateLink() - { - throw new Forbidden(); - } + public function actionCreateLink() + { + throw new Forbidden(); + } - public function actionRemoveLink() - { - throw new Forbidden(); - } + public function actionRemoveLink() + { + throw new Forbidden(); + } } diff --git a/application/Espo/Controllers/ExternalAccount.php b/application/Espo/Controllers/ExternalAccount.php index 38427406d1..7978f15464 100644 --- a/application/Espo/Controllers/ExternalAccount.php +++ b/application/Espo/Controllers/ExternalAccount.php @@ -27,98 +27,98 @@ use \Espo\Core\Exceptions\Forbidden; class ExternalAccount extends \Espo\Core\Controllers\Record { - public static $defaultAction = 'list'; - - public function actionList($params, $data, $request) - { - $integrations = $this->getEntityManager()->getRepository('Integration')->find(); - $arr = array(); - foreach ($integrations as $entity) { - if ($entity->get('enabled') && $this->getMetadata()->get('integrations.' . $entity->id .'.allowUserAccounts')) { - $arr[] = array( - 'id' => $entity->id - ); - } - } - return array( - 'list' => $arr - ); - } - - public function actionGetOAuth2Info($params, $data, $request) - { - $id = $request->get('id'); - list($integration, $userId) = explode('__', $id); - + public static $defaultAction = 'list'; + + public function actionList($params, $data, $request) + { + $integrations = $this->getEntityManager()->getRepository('Integration')->find(); + $arr = array(); + foreach ($integrations as $entity) { + if ($entity->get('enabled') && $this->getMetadata()->get('integrations.' . $entity->id .'.allowUserAccounts')) { + $arr[] = array( + 'id' => $entity->id + ); + } + } + return array( + 'list' => $arr + ); + } + + public function actionGetOAuth2Info($params, $data, $request) + { + $id = $request->get('id'); + list($integration, $userId) = explode('__', $id); + - if ($this->getUser()->id != $userId) { - throw new Forbidden(); - } - - $entity = $this->getEntityManager()->getEntity('Integration', $integration); - if ($entity) { - return array( - 'clientId' => $entity->get('clientId'), - 'redirectUri' => $this->getConfig()->get('siteUrl') . '/oauthcallback', - 'isConnected' => $this->getRecordService()->ping($integration, $userId) - ); - } - } + if ($this->getUser()->id != $userId) { + throw new Forbidden(); + } + + $entity = $this->getEntityManager()->getEntity('Integration', $integration); + if ($entity) { + return array( + 'clientId' => $entity->get('clientId'), + 'redirectUri' => $this->getConfig()->get('siteUrl') . '/oauthcallback', + 'isConnected' => $this->getRecordService()->ping($integration, $userId) + ); + } + } - public function actionRead($params, $data, $request) - { - list($integration, $userId) = explode('__', $params['id']); + public function actionRead($params, $data, $request) + { + list($integration, $userId) = explode('__', $params['id']); - if ($this->getUser()->id != $userId) { - throw new Forbidden(); - } - - $entity = $this->getEntityManager()->getEntity('ExternalAccount', $params['id']); - return $entity->toArray(); - } - - public function actionUpdate($params, $data) - { - return $this->actionPatch($params, $data); - } - - public function actionPatch($params, $data) - { - list($integration, $userId) = explode('__', $params['id']); - + if ($this->getUser()->id != $userId) { + throw new Forbidden(); + } + + $entity = $this->getEntityManager()->getEntity('ExternalAccount', $params['id']); + return $entity->toArray(); + } + + public function actionUpdate($params, $data) + { + return $this->actionPatch($params, $data); + } + + public function actionPatch($params, $data) + { + list($integration, $userId) = explode('__', $params['id']); + - if ($this->getUser()->id != $userId) { - throw new Forbidden(); - } - - if (isset($data['enabled']) && !$data['enabled']) { - $data['data'] = null; - } - - $entity = $this->getEntityManager()->getEntity('ExternalAccount', $params['id']); - $entity->set($data); - $this->getEntityManager()->saveEntity($entity); - - return $entity->toArray(); - } - - public function actionAuthorizationCode($params, $data, $request) - { - if (!$request->isPost()) { - throw new Error('Bad HTTP method type.'); - } - - $id = $data['id']; - $code = $data['code']; - - list($integration, $userId) = explode('__', $id); + if ($this->getUser()->id != $userId) { + throw new Forbidden(); + } + + if (isset($data['enabled']) && !$data['enabled']) { + $data['data'] = null; + } + + $entity = $this->getEntityManager()->getEntity('ExternalAccount', $params['id']); + $entity->set($data); + $this->getEntityManager()->saveEntity($entity); + + return $entity->toArray(); + } + + public function actionAuthorizationCode($params, $data, $request) + { + if (!$request->isPost()) { + throw new Error('Bad HTTP method type.'); + } + + $id = $data['id']; + $code = $data['code']; + + list($integration, $userId) = explode('__', $id); - if ($this->getUser()->id != $userId) { - throw new Forbidden(); - } - - $service = $this->getRecordService(); - return $service->authorizationCode($integration, $userId, $code); - } + if ($this->getUser()->id != $userId) { + throw new Forbidden(); + } + + $service = $this->getRecordService(); + return $service->authorizationCode($integration, $userId, $code); + } } diff --git a/application/Espo/Controllers/FieldManager.php b/application/Espo/Controllers/FieldManager.php index eeef95b79e..4606d3c4bd 100644 --- a/application/Espo/Controllers/FieldManager.php +++ b/application/Espo/Controllers/FieldManager.php @@ -23,70 +23,70 @@ namespace Espo\Controllers; use \Espo\Core\Exceptions\Error, - \Espo\Core\Exceptions\Forbidden, - \Espo\Core\Exceptions\NotFound; + \Espo\Core\Exceptions\Forbidden, + \Espo\Core\Exceptions\NotFound; class FieldManager extends \Espo\Core\Controllers\Base { - protected function checkControllerAccess() - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - } + protected function checkControllerAccess() + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + } - public function actionRead($params, $data) - { - $data = $this->getContainer()->get('fieldManager')->read($params['name'], $params['scope']); + public function actionRead($params, $data) + { + $data = $this->getContainer()->get('fieldManager')->read($params['name'], $params['scope']); - if (!isset($data)) { - throw new NotFound(); - } + if (!isset($data)) { + throw new NotFound(); + } - return $data; - } + return $data; + } - public function actionCreate($params, $data) - { - if (empty($data['name'])) { - throw new Error("Field 'name' cannnot be empty"); - } + public function actionCreate($params, $data) + { + if (empty($data['name'])) { + throw new Error("Field 'name' cannnot be empty"); + } - $fieldManager = $this->getContainer()->get('fieldManager'); - $fieldManager->create($data['name'], $data, $params['scope']); + $fieldManager = $this->getContainer()->get('fieldManager'); + $fieldManager->create($data['name'], $data, $params['scope']); - try { - $this->getContainer()->get('dataManager')->rebuild($params['scope']); - } catch (Error $e) { - $fieldManager->delete($data['name'], $params['scope']); - throw new Error($e->getMessage()); - } + try { + $this->getContainer()->get('dataManager')->rebuild($params['scope']); + } catch (Error $e) { + $fieldManager->delete($data['name'], $params['scope']); + throw new Error($e->getMessage()); + } - return $fieldManager->read($data['name'], $params['scope']); - } + return $fieldManager->read($data['name'], $params['scope']); + } - public function actionUpdate($params, $data) - { - $fieldManager = $this->getContainer()->get('fieldManager'); - $fieldManager->update($params['name'], $data, $params['scope']); + public function actionUpdate($params, $data) + { + $fieldManager = $this->getContainer()->get('fieldManager'); + $fieldManager->update($params['name'], $data, $params['scope']); - if ($fieldManager->isChanged()) { - $this->getContainer()->get('dataManager')->rebuild($params['scope']); - } else { - $this->getContainer()->get('dataManager')->clearCache(); - } + if ($fieldManager->isChanged()) { + $this->getContainer()->get('dataManager')->rebuild($params['scope']); + } else { + $this->getContainer()->get('dataManager')->clearCache(); + } - return $fieldManager->read($params['name'], $params['scope']); - } + return $fieldManager->read($params['name'], $params['scope']); + } - public function actionDelete($params, $data) - { - $res = $this->getContainer()->get('fieldManager')->delete($params['name'], $params['scope']); + public function actionDelete($params, $data) + { + $res = $this->getContainer()->get('fieldManager')->delete($params['name'], $params['scope']); - $this->getContainer()->get('dataManager')->rebuildMetadata(); + $this->getContainer()->get('dataManager')->rebuildMetadata(); - return $res; - } + return $res; + } } diff --git a/application/Espo/Controllers/GlobalSearch.php b/application/Espo/Controllers/GlobalSearch.php index 23d8337b17..c4fcc72063 100644 --- a/application/Espo/Controllers/GlobalSearch.php +++ b/application/Espo/Controllers/GlobalSearch.php @@ -23,18 +23,18 @@ namespace Espo\Controllers; use \Espo\Core\Exceptions\Error, - \Espo\Core\Exceptions\Forbidden; + \Espo\Core\Exceptions\Forbidden; class GlobalSearch extends \Espo\Core\Controllers\Base { public function actionSearch($params, $data, $request) - { - $query = $params['query']; - - $offset = $request->get('offset'); - $maxSize = $request->get('maxSize'); - - return $this->getService('GlobalSearch')->find($query, $offset, $maxSize); - } + { + $query = $params['query']; + + $offset = $request->get('offset'); + $maxSize = $request->get('maxSize'); + + return $this->getService('GlobalSearch')->find($query, $offset, $maxSize); + } } diff --git a/application/Espo/Controllers/I18n.php b/application/Espo/Controllers/I18n.php index 1ec5cadf22..1072e0a960 100644 --- a/application/Espo/Controllers/I18n.php +++ b/application/Espo/Controllers/I18n.php @@ -26,7 +26,7 @@ class I18n extends \Espo\Core\Controllers\Base { public function actionRead($params, $data) - { - return $this->getContainer()->get('language')->getAll(); - } + { + return $this->getContainer()->get('language')->getAll(); + } } diff --git a/application/Espo/Controllers/Import.php b/application/Espo/Controllers/Import.php index 2c13a4e784..f4aa8dc666 100644 --- a/application/Espo/Controllers/Import.php +++ b/application/Espo/Controllers/Import.php @@ -27,61 +27,61 @@ use \Espo\Core\Exceptions\Error; use \Espo\Core\Exceptions\Forbidden; class Import extends \Espo\Core\Controllers\Base -{ - - protected function getFileManager() - { - return $this->getContainer()->get('fileManager'); - } - - protected function getEntityManager() - { - return $this->getContainer()->get('entityManager'); - } - - public function actionUploadFile($params, $data) - { - $contents = $data; - - $attachment = $this->getEntityManager()->getEntity('Attachment'); - $attachment->set('type', 'text/csv'); - $attachment->set('role', 'Import File'); - $this->getEntityManager()->saveEntity($attachment); - - $this->getFileManager()->putContents('data/upload/' . $attachment->id, $contents); - - return array( - 'attachmentId' => $attachment->id - ); - } - - public function actionRevert($params, $data) - { - return $this->getService('Import')->revert($data['entityType'], $data['idsToRemove']); - } - - public function actionCreate($params, $data) - { +{ + + protected function getFileManager() + { + return $this->getContainer()->get('fileManager'); + } + + protected function getEntityManager() + { + return $this->getContainer()->get('entityManager'); + } + + public function actionUploadFile($params, $data) + { + $contents = $data; + + $attachment = $this->getEntityManager()->getEntity('Attachment'); + $attachment->set('type', 'text/csv'); + $attachment->set('role', 'Import File'); + $this->getEntityManager()->saveEntity($attachment); + + $this->getFileManager()->putContents('data/upload/' . $attachment->id, $contents); + + return array( + 'attachmentId' => $attachment->id + ); + } + + public function actionRevert($params, $data) + { + return $this->getService('Import')->revert($data['entityType'], $data['idsToRemove']); + } + + public function actionCreate($params, $data) + { $importParams = array( - 'headerRow' => $data['headerRow'], - 'fieldDelimiter' => $data['fieldDelimiter'], - 'textQualifier' => $data['textQualifier'], - 'dateFormat' => $data['dateFormat'], - 'timeFormat' => $data['timeFormat'], - 'personNameFormat' => $data['personNameFormat'], - 'decimalMark' => $data['decimalMark'], - 'currency' => $data['currency'], - 'defaultValues' => $data['defaultValues'], - 'action' => $data['action'], + 'headerRow' => $data['headerRow'], + 'fieldDelimiter' => $data['fieldDelimiter'], + 'textQualifier' => $data['textQualifier'], + 'dateFormat' => $data['dateFormat'], + 'timeFormat' => $data['timeFormat'], + 'personNameFormat' => $data['personNameFormat'], + 'decimalMark' => $data['decimalMark'], + 'currency' => $data['currency'], + 'defaultValues' => $data['defaultValues'], + 'action' => $data['action'], ); $attachmentId = $data['attachmentId']; if (!$this->getAcl()->check($data['entityType'], 'edit')) { - throw new Forbidden(); + throw new Forbidden(); } - return $this->getService('Import')->import($data['entityType'], $data['fields'], $attachmentId, $importParams); - } + return $this->getService('Import')->import($data['entityType'], $data['fields'], $attachmentId, $importParams); + } } diff --git a/application/Espo/Controllers/Integration.php b/application/Espo/Controllers/Integration.php index 0e6b30e4ff..0e4a60576a 100644 --- a/application/Espo/Controllers/Integration.php +++ b/application/Espo/Controllers/Integration.php @@ -25,37 +25,37 @@ namespace Espo\Controllers; use \Espo\Core\Exceptions\Error; class Integration extends \Espo\Core\Controllers\Record -{ - protected function checkControllerAccess() - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - } - - public function actionIndex($params, $data, $request) - { - return false; - } +{ + protected function checkControllerAccess() + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + } + + public function actionIndex($params, $data, $request) + { + return false; + } - public function actionRead($params, $data, $request) - { - $entity = $this->getEntityManager()->getEntity('Integration', $params['id']); - return $entity->toArray(); - } - - public function actionUpdate($params, $data) - { - return $this->actionPatch($params, $data); - } - - public function actionPatch($params, $data) - { - $entity = $this->getEntityManager()->getEntity('Integration', $params['id']); - $entity->set($data); - $this->getEntityManager()->saveEntity($entity); - - return $entity->toArray(); - } + public function actionRead($params, $data, $request) + { + $entity = $this->getEntityManager()->getEntity('Integration', $params['id']); + return $entity->toArray(); + } + + public function actionUpdate($params, $data) + { + return $this->actionPatch($params, $data); + } + + public function actionPatch($params, $data) + { + $entity = $this->getEntityManager()->getEntity('Integration', $params['id']); + $entity->set($data); + $this->getEntityManager()->saveEntity($entity); + + return $entity->toArray(); + } } diff --git a/application/Espo/Controllers/Layout.php b/application/Espo/Controllers/Layout.php index a14eaf149f..2053358d4a 100644 --- a/application/Espo/Controllers/Layout.php +++ b/application/Espo/Controllers/Layout.php @@ -30,33 +30,33 @@ use \Espo\Core\Exceptions\Forbidden; class Layout extends \Espo\Core\Controllers\Base { public function actionRead($params, $data) - { - $data = $this->getContainer()->get('layout')->get($params['scope'], $params['name']); - if (empty($data)) { - throw new NotFound("Layout " . $params['scope'] . ":" . $params['name'] . ' is not found'); - } - return $data; - } + { + $data = $this->getContainer()->get('layout')->get($params['scope'], $params['name']); + if (empty($data)) { + throw new NotFound("Layout " . $params['scope'] . ":" . $params['name'] . ' is not found'); + } + return $data; + } - public function actionUpdate($params, $data) - { + public function actionUpdate($params, $data) + { if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); + throw new Forbidden(); } $result = $this->getContainer()->get('layout')->set($data, $params['scope'], $params['name']); - if ($result === false) { - throw new Error("Error while saving layout"); - } + if ($result === false) { + throw new Error("Error while saving layout"); + } - $this->getContainer()->get('dataManager')->updateCacheTimestamp(); + $this->getContainer()->get('dataManager')->updateCacheTimestamp(); - return $this->getContainer()->get('layout')->get($params['scope'], $params['name']); - } + return $this->getContainer()->get('layout')->get($params['scope'], $params['name']); + } - public function actionPatch($params, $data) - { + public function actionPatch($params, $data) + { return $this->actionUpdate($params, $data); - } + } } diff --git a/application/Espo/Controllers/Metadata.php b/application/Espo/Controllers/Metadata.php index d8effcfb78..3784c49413 100644 --- a/application/Espo/Controllers/Metadata.php +++ b/application/Espo/Controllers/Metadata.php @@ -26,7 +26,7 @@ class Metadata extends \Espo\Core\Controllers\Base { public function actionRead($params, $data) - { - return $this->getMetadata()->getAll(true); - } + { + return $this->getMetadata()->getAll(true); + } } diff --git a/application/Espo/Controllers/Notification.php b/application/Espo/Controllers/Notification.php index 03811feadf..51947dc17b 100644 --- a/application/Espo/Controllers/Notification.php +++ b/application/Espo/Controllers/Notification.php @@ -26,41 +26,41 @@ use \Espo\Core\Exceptions\Error; class Notification extends \Espo\Core\Controllers\Base { - public static $defaultAction = 'list'; + public static $defaultAction = 'list'; - public function actionList($params, $data, $request) - { - $scope = $params['scope']; - $id = $params['id']; - - $userId = $this->getUser()->id; - - $offset = intval($request->get('offset')); - $maxSize = intval($request->get('maxSize')); - - $params = array( - 'offset' => $offset, - 'maxSize' => $maxSize, - ); - - $result = $this->getService('Notification')->getList($userId, $params); - - return array( - 'total' => $result['total'], - 'list' => $result['collection']->toArray() - ); - } - - public function actionNotReadCount() - { - $userId = $this->getUser()->id; - return $this->getService('Notification')->getNotReadCount($userId); - } - - public function actionMarkAllRead($params, $data, $request) - { - $userId = $this->getUser()->id; - return $this->getService('Notification')->markAllRead($userId); - } + public function actionList($params, $data, $request) + { + $scope = $params['scope']; + $id = $params['id']; + + $userId = $this->getUser()->id; + + $offset = intval($request->get('offset')); + $maxSize = intval($request->get('maxSize')); + + $params = array( + 'offset' => $offset, + 'maxSize' => $maxSize, + ); + + $result = $this->getService('Notification')->getList($userId, $params); + + return array( + 'total' => $result['total'], + 'list' => $result['collection']->toArray() + ); + } + + public function actionNotReadCount() + { + $userId = $this->getUser()->id; + return $this->getService('Notification')->getNotReadCount($userId); + } + + public function actionMarkAllRead($params, $data, $request) + { + $userId = $this->getUser()->id; + return $this->getService('Notification')->markAllRead($userId); + } } diff --git a/application/Espo/Controllers/Preferences.php b/application/Espo/Controllers/Preferences.php index 0b7ceaf955..4e9518f64d 100644 --- a/application/Espo/Controllers/Preferences.php +++ b/application/Espo/Controllers/Preferences.php @@ -28,91 +28,91 @@ use \Espo\Core\Exceptions\BadRequest; use \Espo\Core\Exceptions\NotFound; class Preferences extends \Espo\Core\Controllers\Base -{ - protected function getPreferences() - { - return $this->getContainer()->get('preferences'); - } - - protected function getEntityManager() - { - return $this->getContainer()->get('entityManager'); - } - - protected function getCrypt() - { - return $this->getContainer()->get('crypt'); - } - - protected function handleUserAccess($userId) - { - if (!$this->getUser()->isAdmin()) { - if ($this->getUser()->id != $userId) { - throw new Forbidden(); - } - } - } - - public function actionDelete($params, $data) - { - $userId = $params['id']; - if (empty($userId)) { - throw new BadRequest(); - } - $this->handleUserAccess($userId); - - return $this->getEntityManager()->getRepository('Preferences')->resetToDefaults($userId); - } - - public function actionPatch($params, $data) - { - return $this->actionUpdate($params, $data); - } +{ + protected function getPreferences() + { + return $this->getContainer()->get('preferences'); + } + + protected function getEntityManager() + { + return $this->getContainer()->get('entityManager'); + } + + protected function getCrypt() + { + return $this->getContainer()->get('crypt'); + } + + protected function handleUserAccess($userId) + { + if (!$this->getUser()->isAdmin()) { + if ($this->getUser()->id != $userId) { + throw new Forbidden(); + } + } + } + + public function actionDelete($params, $data) + { + $userId = $params['id']; + if (empty($userId)) { + throw new BadRequest(); + } + $this->handleUserAccess($userId); + + return $this->getEntityManager()->getRepository('Preferences')->resetToDefaults($userId); + } + + public function actionPatch($params, $data) + { + return $this->actionUpdate($params, $data); + } - public function actionUpdate($params, $data) - { - $userId = $params['id']; - $this->handleUserAccess($userId); - - if (array_key_exists('smtpPassword', $data)) { - $data['smtpPassword'] = $this->getCrypt()->encrypt($data['smtpPassword']); - } - - $user = $this->getEntityManager()->getEntity('User', $userId); + public function actionUpdate($params, $data) + { + $userId = $params['id']; + $this->handleUserAccess($userId); + + if (array_key_exists('smtpPassword', $data)) { + $data['smtpPassword'] = $this->getCrypt()->encrypt($data['smtpPassword']); + } + + $user = $this->getEntityManager()->getEntity('User', $userId); - $entity = $this->getEntityManager()->getEntity('Preferences', $userId); - - if ($entity) { - $entity->set($data); - $this->getEntityManager()->saveEntity($entity); - - $entity->set('smtpEmailAddress', $user->get('emailAddress')); - $entity->set('name', $user->get('name')); - - $entity->clear('smtpPassword'); - - return $entity->toArray(); - } - throw new Error(); - } + $entity = $this->getEntityManager()->getEntity('Preferences', $userId); + + if ($entity) { + $entity->set($data); + $this->getEntityManager()->saveEntity($entity); + + $entity->set('smtpEmailAddress', $user->get('emailAddress')); + $entity->set('name', $user->get('name')); + + $entity->clear('smtpPassword'); + + return $entity->toArray(); + } + throw new Error(); + } public function actionRead($params) - { - $userId = $params['id']; - $this->handleUserAccess($userId); + { + $userId = $params['id']; + $this->handleUserAccess($userId); - $entity = $this->getEntityManager()->getEntity('Preferences', $userId); - $user = $this->getEntityManager()->getEntity('User', $userId); - - $entity->set('smtpEmailAddress', $user->get('emailAddress')); - $entity->set('name', $user->get('name')); - - $entity->clear('smtpPassword'); - - if ($entity) { - return $entity->toArray(); - } - throw new NotFound(); - } + $entity = $this->getEntityManager()->getEntity('Preferences', $userId); + $user = $this->getEntityManager()->getEntity('User', $userId); + + $entity->set('smtpEmailAddress', $user->get('emailAddress')); + $entity->set('name', $user->get('name')); + + $entity->clear('smtpPassword'); + + if ($entity) { + return $entity->toArray(); + } + throw new NotFound(); + } } diff --git a/application/Espo/Controllers/ScheduledJob.php b/application/Espo/Controllers/ScheduledJob.php index f06407812b..50d7f623f6 100644 --- a/application/Espo/Controllers/ScheduledJob.php +++ b/application/Espo/Controllers/ScheduledJob.php @@ -24,11 +24,11 @@ namespace Espo\Controllers; class ScheduledJob extends \Espo\Core\Controllers\Record { - protected function checkControllerAccess() - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - } + protected function checkControllerAccess() + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + } } diff --git a/application/Espo/Controllers/ScheduledJobLogRecord.php b/application/Espo/Controllers/ScheduledJobLogRecord.php index 65483fa3ab..30b2e38835 100644 --- a/application/Espo/Controllers/ScheduledJobLogRecord.php +++ b/application/Espo/Controllers/ScheduledJobLogRecord.php @@ -24,11 +24,11 @@ namespace Espo\Controllers; class ScheduledJobLogRecord extends \Espo\Core\Controllers\Record { - protected function checkControllerAccess() - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - } + protected function checkControllerAccess() + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + } } diff --git a/application/Espo/Controllers/Settings.php b/application/Espo/Controllers/Settings.php index 5593787faa..d50a208fb4 100644 --- a/application/Espo/Controllers/Settings.php +++ b/application/Espo/Controllers/Settings.php @@ -27,48 +27,48 @@ use \Espo\Core\Exceptions\Forbidden; class Settings extends \Espo\Core\Controllers\Base { - protected function getConfigData() - { - $data = $this->getConfig()->getData($this->getUser()->isAdmin()); + protected function getConfigData() + { + $data = $this->getConfig()->getData($this->getUser()->isAdmin()); - $fieldDefs = $this->getMetadata()->get('entityDefs.Settings.fields'); + $fieldDefs = $this->getMetadata()->get('entityDefs.Settings.fields'); - foreach ($fieldDefs as $field => $d) { - if ($d['type'] == 'password') { - unset($data[$field]); - } - } - return $data; - } + foreach ($fieldDefs as $field => $d) { + if ($d['type'] == 'password') { + unset($data[$field]); + } + } + return $data; + } - public function actionRead($params, $data) - { - return $this->getConfigData(); - } + public function actionRead($params, $data) + { + return $this->getConfigData(); + } - public function actionUpdate($params, $data) - { - return $this->actionPatch($params, $data); - } + public function actionUpdate($params, $data) + { + return $this->actionPatch($params, $data); + } - public function actionPatch($params, $data) - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } + public function actionPatch($params, $data) + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } - $this->getConfig()->setData($data, $this->getUser()->isAdmin()); - $result = $this->getConfig()->save(); - if ($result === false) { - throw new Error('Cannot save settings'); - } + $this->getConfig()->setData($data, $this->getUser()->isAdmin()); + $result = $this->getConfig()->save(); + if ($result === false) { + throw new Error('Cannot save settings'); + } - /** Rebuild for Currency Settings */ - if (isset($data['baseCurrency']) || isset($data['currencyRates'])) { - $this->getContainer()->get('dataManager')->rebuildDatabase(array()); - } - /** END Rebuild for Currency Settings */ + /** Rebuild for Currency Settings */ + if (isset($data['baseCurrency']) || isset($data['currencyRates'])) { + $this->getContainer()->get('dataManager')->rebuildDatabase(array()); + } + /** END Rebuild for Currency Settings */ - return $this->getConfigData(); - } + return $this->getConfigData(); + } } diff --git a/application/Espo/Controllers/Stream.php b/application/Espo/Controllers/Stream.php index 6418c03252..ec9645197d 100644 --- a/application/Espo/Controllers/Stream.php +++ b/application/Espo/Controllers/Stream.php @@ -26,38 +26,38 @@ use \Espo\Core\Exceptions\Error; class Stream extends \Espo\Core\Controllers\Base { - const MAX_SIZE_LIMIT = 400; - - public static $defaultAction = 'list'; + const MAX_SIZE_LIMIT = 400; + + public static $defaultAction = 'list'; public function actionList($params, $data, $request) - { - $scope = $params['scope']; - $id = isset($params['id']) ? $params['id'] : null; - - $offset = intval($request->get('offset')); - $maxSize = intval($request->get('maxSize')); - $after = $request->get('after'); - - $service = $this->getService('Stream'); - - if (empty($maxSize)) { - $maxSize = self::MAX_SIZE_LIMIT; - } - if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) { - throw new Forbidden(); - } - - $result = $service->find($scope, $id, array( - 'offset' => $offset, - 'maxSize' => $maxSize, - 'after' => $after, - )); - - return array( - 'total' => $result['total'], - 'list' => $result['collection']->toArray() - ); - } + { + $scope = $params['scope']; + $id = isset($params['id']) ? $params['id'] : null; + + $offset = intval($request->get('offset')); + $maxSize = intval($request->get('maxSize')); + $after = $request->get('after'); + + $service = $this->getService('Stream'); + + if (empty($maxSize)) { + $maxSize = self::MAX_SIZE_LIMIT; + } + if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) { + throw new Forbidden(); + } + + $result = $service->find($scope, $id, array( + 'offset' => $offset, + 'maxSize' => $maxSize, + 'after' => $after, + )); + + return array( + 'total' => $result['total'], + 'list' => $result['collection']->toArray() + ); + } } diff --git a/application/Espo/Controllers/Team.php b/application/Espo/Controllers/Team.php index af5d7f6c2e..b0cc25bd27 100644 --- a/application/Espo/Controllers/Team.php +++ b/application/Espo/Controllers/Team.php @@ -24,6 +24,6 @@ namespace Espo\Controllers; class Team extends \Espo\Core\Controllers\Record { - + } diff --git a/application/Espo/Controllers/User.php b/application/Espo/Controllers/User.php index e6d1605e33..17a7138d01 100644 --- a/application/Espo/Controllers/User.php +++ b/application/Espo/Controllers/User.php @@ -27,31 +27,31 @@ use \Espo\Core\Exceptions\NotFound; use \Espo\Core\Exceptions\Forbidden; class User extends \Espo\Core\Controllers\Record -{ - public function actionAcl($params, $data, $request) - { - $userId = $request->get('id'); - if (empty($userId)) { - throw new Error(); - } - - if (!$this->getUser()->isAdmin() && $this->getUser()->id != $userId) { - throw new Forbidden(); - } - - $user = $this->getEntityManager()->getEntity('User', $userId); - if (empty($user)) { - throw new NotFound(); - } - - $acl = new \Espo\Core\Acl($user, $this->getConfig(), $this->getContainer()->get('fileManager'), $this->getMetadata()); - - return $acl->toArray(); - } - - public function actionChangeOwnPassword($params, $data) - { - return $this->getService('User')->changePassword($this->getUser()->id, $data['password']); - } +{ + public function actionAcl($params, $data, $request) + { + $userId = $request->get('id'); + if (empty($userId)) { + throw new Error(); + } + + if (!$this->getUser()->isAdmin() && $this->getUser()->id != $userId) { + throw new Forbidden(); + } + + $user = $this->getEntityManager()->getEntity('User', $userId); + if (empty($user)) { + throw new NotFound(); + } + + $acl = new \Espo\Core\Acl($user, $this->getConfig(), $this->getContainer()->get('fileManager'), $this->getMetadata()); + + return $acl->toArray(); + } + + public function actionChangeOwnPassword($params, $data) + { + return $this->getService('User')->changePassword($this->getUser()->id, $data['password']); + } } diff --git a/application/Espo/Core/Acl.php b/application/Espo/Core/Acl.php index e9ab36dcd8..03e09c6490 100644 --- a/application/Espo/Core/Acl.php +++ b/application/Espo/Core/Acl.php @@ -28,241 +28,241 @@ use \Espo\ORM\Entity; class Acl { - private $data = array(); + private $data = array(); - private $cacheFile; + private $cacheFile; - private $actionList = array('read', 'edit', 'delete'); + private $actionList = array('read', 'edit', 'delete'); - private $levelList = array('all', 'team', 'own', 'no'); - - protected $fileManager; - - protected $metadata; + private $levelList = array('all', 'team', 'own', 'no'); + + protected $fileManager; + + protected $metadata; - public function __construct(\Espo\Entities\User $user, $config = null, $fileManager = null, $metadata = null) - { - $this->user = $user; - - $this->metadata = $metadata; - - if (!$this->user->isFetched()) { - throw new Error(); - } - - $this->user->loadLinkMultipleField('teams'); - - if ($fileManager) { - $this->fileManager = $fileManager; - } - - $this->cacheFile = 'data/cache/application/acl/' . $user->id . '.php'; - - if ($config && $config->get('useCache') && file_exists($this->cacheFile)) { - $cached = include $this->cacheFile; - $this->data = $cached; - $this->initSolid(); - } else { - $this->load(); - $this->initSolid(); - if ($config && $fileManager && $config->get('useCache')) { - $this->buildCache(); - } - } + public function __construct(\Espo\Entities\User $user, $config = null, $fileManager = null, $metadata = null) + { + $this->user = $user; + + $this->metadata = $metadata; + + if (!$this->user->isFetched()) { + throw new Error(); + } + + $this->user->loadLinkMultipleField('teams'); + + if ($fileManager) { + $this->fileManager = $fileManager; + } + + $this->cacheFile = 'data/cache/application/acl/' . $user->id . '.php'; + + if ($config && $config->get('useCache') && file_exists($this->cacheFile)) { + $cached = include $this->cacheFile; + $this->data = $cached; + $this->initSolid(); + } else { + $this->load(); + $this->initSolid(); + if ($config && $fileManager && $config->get('useCache')) { + $this->buildCache(); + } + } - } - - public function checkScope($scope, $action = null, $isOwner = null, $inTeam = null, $entity = null) - { - if (array_key_exists($scope, $this->data)) { - if ($this->data[$scope] === false) { - return false; - } - if ($this->data[$scope] === true) { - return true; - } - if (!is_null($action)) { - if (array_key_exists($action, $this->data[$scope])) { - $value = $this->data[$scope][$action]; - - if ($value === 'all' || $value === true) { - return true; - } - - if (!$value || $value === 'no') { - return false; - } - - if (is_null($isOwner)) { - return true; - } - - if ($isOwner) { - if ($value === 'own' || $value === 'team') { - return true; - } - } - if ($inTeam === null && $entity) { - $inTeam = $this->checkInTeam($entity); - } - - if ($inTeam) { - if ($value === 'team') { - return true; - } - } - - return false; - } - } - return true; - } - return true; - } - - public function toArray() - { - return $this->data; - } + } + + public function checkScope($scope, $action = null, $isOwner = null, $inTeam = null, $entity = null) + { + if (array_key_exists($scope, $this->data)) { + if ($this->data[$scope] === false) { + return false; + } + if ($this->data[$scope] === true) { + return true; + } + if (!is_null($action)) { + if (array_key_exists($action, $this->data[$scope])) { + $value = $this->data[$scope][$action]; + + if ($value === 'all' || $value === true) { + return true; + } + + if (!$value || $value === 'no') { + return false; + } + + if (is_null($isOwner)) { + return true; + } + + if ($isOwner) { + if ($value === 'own' || $value === 'team') { + return true; + } + } + if ($inTeam === null && $entity) { + $inTeam = $this->checkInTeam($entity); + } + + if ($inTeam) { + if ($value === 'team') { + return true; + } + } + + return false; + } + } + return true; + } + return true; + } + + public function toArray() + { + return $this->data; + } - public function check($subject, $action = null, $isOwner = null, $inTeam = null) - { - if ($this->user->isAdmin()) { - return true; - } - if (is_string($subject)) { - return $this->checkScope($subject, $action, $isOwner, $inTeam); - } else { - $entity = $subject; - if ($entity instanceof Entity) { - $entityName = $entity->getEntityName(); - return $this->checkScope($entityName, $action, $this->checkIsOwner($entity), $inTeam, $entity); - } - } - } - - public function checkReadOnlyTeam($scope) - { - if (isset($this->data[$scope]) && isset($this->data[$scope]['read'])) { - return $this->data[$scope]['read'] === 'team'; - } - return false; - } - - public function checkReadOnlyOwn($scope) - { - if ($this->user->isAdmin()) { - return false; - } - if (isset($this->data[$scope]) && isset($this->data[$scope]['read'])) { - return $this->data[$scope]['read'] === 'own'; - } - return false; - } - - public function checkIsOwner($entity) - { - if ($this->user->isAdmin()) { - return false; - } - $userId = $this->user->id; - if ($userId === $entity->get('assignedUserId') || $userId === $entity->get('createdById')) { - return true; - } - return false; - } - - public function checkInTeam($entity) - { - $userTeamIds = $this->user->get('teamsIds'); - - if (!$entity->hasRelation('teams') || !$entity->hasField('teamsIds')) { - return false; - } - - if (!$entity->has('teamsIds')) { - $entity->loadLinkMultipleField('teams'); - } - - $teamIds = $entity->get('teamsIds'); - - if (empty($teamIds)) { - return false; - } - - foreach ($userTeamIds as $id) { - if (in_array($id, $teamIds)) { - return true; - } - } - return false; - } + public function check($subject, $action = null, $isOwner = null, $inTeam = null) + { + if ($this->user->isAdmin()) { + return true; + } + if (is_string($subject)) { + return $this->checkScope($subject, $action, $isOwner, $inTeam); + } else { + $entity = $subject; + if ($entity instanceof Entity) { + $entityName = $entity->getEntityName(); + return $this->checkScope($entityName, $action, $this->checkIsOwner($entity), $inTeam, $entity); + } + } + } + + public function checkReadOnlyTeam($scope) + { + if (isset($this->data[$scope]) && isset($this->data[$scope]['read'])) { + return $this->data[$scope]['read'] === 'team'; + } + return false; + } + + public function checkReadOnlyOwn($scope) + { + if ($this->user->isAdmin()) { + return false; + } + if (isset($this->data[$scope]) && isset($this->data[$scope]['read'])) { + return $this->data[$scope]['read'] === 'own'; + } + return false; + } + + public function checkIsOwner($entity) + { + if ($this->user->isAdmin()) { + return false; + } + $userId = $this->user->id; + if ($userId === $entity->get('assignedUserId') || $userId === $entity->get('createdById')) { + return true; + } + return false; + } + + public function checkInTeam($entity) + { + $userTeamIds = $this->user->get('teamsIds'); + + if (!$entity->hasRelation('teams') || !$entity->hasField('teamsIds')) { + return false; + } + + if (!$entity->has('teamsIds')) { + $entity->loadLinkMultipleField('teams'); + } + + $teamIds = $entity->get('teamsIds'); + + if (empty($teamIds)) { + return false; + } + + foreach ($userTeamIds as $id) { + if (in_array($id, $teamIds)) { + return true; + } + } + return false; + } - private function load() - { - $aclTables = array(); + private function load() + { + $aclTables = array(); - $userRoles = $this->user->get('roles'); - - foreach ($userRoles as $role) { - $aclTables[] = json_decode($role->get('data')); - } + $userRoles = $this->user->get('roles'); + + foreach ($userRoles as $role) { + $aclTables[] = json_decode($role->get('data')); + } - $teams = $this->user->get('teams'); - foreach ($teams as $team) { - $teamRoles = $team->get('roles'); - foreach ($teamRoles as $role) { - $aclTables[] = json_decode($role->get('data')); - } - } + $teams = $this->user->get('teams'); + foreach ($teams as $team) { + $teamRoles = $team->get('roles'); + foreach ($teamRoles as $role) { + $aclTables[] = json_decode($role->get('data')); + } + } - $this->data = $this->merge($aclTables); - } - - private function initSolid() - { - $data = $this->metadata->get('app.acl.solid', array()); - - foreach ($data as $entityName => $item) { - $this->data[$entityName] = $item; - } - } + $this->data = $this->merge($aclTables); + } + + private function initSolid() + { + $data = $this->metadata->get('app.acl.solid', array()); + + foreach ($data as $entityName => $item) { + $this->data[$entityName] = $item; + } + } - private function merge($tables) - { - $data = array(); - foreach ($tables as $table) { - foreach ($table as $scope => $row) { - if ($row == false) { - if (!isset($data[$scope])) { - $data[$scope] = false; - } - } else { - if (!isset($data[$scope])) { - $data[$scope] = array(); - } - if ($data[$scope] == false) { - $data[$scope] = array(); - } - foreach ($row as $action => $level) { - if (!isset($data[$scope][$action])) { - $data[$scope][$action] = $level; - } else { - if (array_search($data[$scope][$action], $this->levelList) > array_search($level, $this->levelList)) { - $data[$scope][$action] = $level; - } - } - } - } - } - } - return $data; - } + private function merge($tables) + { + $data = array(); + foreach ($tables as $table) { + foreach ($table as $scope => $row) { + if ($row == false) { + if (!isset($data[$scope])) { + $data[$scope] = false; + } + } else { + if (!isset($data[$scope])) { + $data[$scope] = array(); + } + if ($data[$scope] == false) { + $data[$scope] = array(); + } + foreach ($row as $action => $level) { + if (!isset($data[$scope][$action])) { + $data[$scope][$action] = $level; + } else { + if (array_search($data[$scope][$action], $this->levelList) > array_search($level, $this->levelList)) { + $data[$scope][$action] = $level; + } + } + } + } + } + } + return $data; + } - private function buildCache() - { - $contents = '<' . '?'. 'php return ' . var_export($this->data, true) . ';'; - $this->fileManager->putContents($this->cacheFile, $contents); - } + private function buildCache() + { + $contents = '<' . '?'. 'php return ' . var_export($this->data, true) . ';'; + $this->fileManager->putContents($this->cacheFile, $contents); + } } diff --git a/application/Espo/Core/Application.php b/application/Espo/Core/Application.php index 95f3b97b8c..29dee4f3a4 100644 --- a/application/Espo/Core/Application.php +++ b/application/Espo/Core/Application.php @@ -25,54 +25,54 @@ namespace Espo\Core; class Application { - private $metadata; + private $metadata; - private $container; + private $container; - private $slim; + private $slim; - private $auth; + private $auth; - /** + /** * Constructor */ public function __construct() { - $this->container = new Container(); + $this->container = new Container(); - date_default_timezone_set('UTC'); + date_default_timezone_set('UTC'); - $GLOBALS['log'] = $this->container->get('log'); + $GLOBALS['log'] = $this->container->get('log'); } - public function getSlim() - { - if (empty($this->slim)) { - $this->slim = $this->container->get('slim'); - } - return $this->slim; - } + public function getSlim() + { + if (empty($this->slim)) { + $this->slim = $this->container->get('slim'); + } + return $this->slim; + } - public function getMetadata() - { - if (empty($this->metadata)) { - $this->metadata = $this->container->get('metadata'); - } - return $this->metadata; - } + public function getMetadata() + { + if (empty($this->metadata)) { + $this->metadata = $this->container->get('metadata'); + } + return $this->metadata; + } protected function getAuth() { - if (empty($this->auth)) { - $this->auth = new \Espo\Core\Utils\Auth($this->container); - } - return $this->auth; + if (empty($this->auth)) { + $this->auth = new \Espo\Core\Utils\Auth($this->container); + } + return $this->auth; } - public function getContainer() - { - return $this->container; - } + public function getContainer() + { + return $this->container; + } public function run($name = 'default') { @@ -83,160 +83,160 @@ class Application public function runClient() { - $config = $this->getContainer()->get('config'); + $config = $this->getContainer()->get('config'); - $html = file_get_contents('main.html'); - $html = str_replace('{{cacheTimestamp}}', $config->get('cacheTimestamp', 0), $html); - $html = str_replace('{{useCache}}', $config->get('useCache') ? 'true' : 'false' , $html); - echo $html; - exit; + $html = file_get_contents('main.html'); + $html = str_replace('{{cacheTimestamp}}', $config->get('cacheTimestamp', 0), $html); + $html = str_replace('{{useCache}}', $config->get('useCache') ? 'true' : 'false' , $html); + echo $html; + exit; } public function runEntryPoint($entryPoint) { - if (empty($entryPoint)) { - throw new \Error(); - } + if (empty($entryPoint)) { + throw new \Error(); + } - $slim = $this->getSlim(); - $container = $this->getContainer(); + $slim = $this->getSlim(); + $container = $this->getContainer(); - $slim->get('/', function() {}); + $slim->get('/', function() {}); - $entryPointManager = new \Espo\Core\EntryPointManager($container); + $entryPointManager = new \Espo\Core\EntryPointManager($container); - $auth = $this->getAuth(); - $apiAuth = new \Espo\Core\Utils\Api\Auth($auth, $entryPointManager->checkAuthRequired($entryPoint), true); - $slim->add($apiAuth); + $auth = $this->getAuth(); + $apiAuth = new \Espo\Core\Utils\Api\Auth($auth, $entryPointManager->checkAuthRequired($entryPoint), true); + $slim->add($apiAuth); - $slim->hook('slim.before.dispatch', function () use ($entryPoint, $entryPointManager, $container) { - try { - $entryPointManager->run($entryPoint); - } catch (\Exception $e) { - $container->get('output')->processError($e->getMessage(), $e->getCode(), true); - } - }); + $slim->hook('slim.before.dispatch', function () use ($entryPoint, $entryPointManager, $container) { + try { + $entryPointManager->run($entryPoint); + } catch (\Exception $e) { + $container->get('output')->processError($e->getMessage(), $e->getCode(), true); + } + }); - $slim->run(); + $slim->run(); } public function runCron() { - $auth = $this->getAuth(); - $auth->useNoAuth(true); + $auth = $this->getAuth(); + $auth->useNoAuth(true); - $cronManager = new \Espo\Core\CronManager($this->container); - $cronManager->run(); + $cronManager = new \Espo\Core\CronManager($this->container); + $cronManager->run(); } public function runRebuild() { - $dataManager = $this->getContainer()->get('dataManager'); - $dataManager->rebuild(); + $dataManager = $this->getContainer()->get('dataManager'); + $dataManager->rebuild(); } public function isInstalled() { - $config = $this->getContainer()->get('config'); + $config = $this->getContainer()->get('config'); - if (file_exists($config->getConfigPath()) && $config->get('isInstalled')) { - return true; - } + if (file_exists($config->getConfigPath()) && $config->get('isInstalled')) { + return true; + } - return false; + return false; } - protected function routeHooks() - { - $container = $this->getContainer(); - $slim = $this->getSlim(); + protected function routeHooks() + { + $container = $this->getContainer(); + $slim = $this->getSlim(); - $auth = $this->getAuth(); + $auth = $this->getAuth(); - $apiAuth = new \Espo\Core\Utils\Api\Auth($auth); - $this->getSlim()->add($apiAuth); + $apiAuth = new \Espo\Core\Utils\Api\Auth($auth); + $this->getSlim()->add($apiAuth); - $this->getSlim()->hook('slim.before.dispatch', function () use ($slim, $container) { + $this->getSlim()->hook('slim.before.dispatch', function () use ($slim, $container) { - $route = $slim->router()->getCurrentRoute(); - $conditions = $route->getConditions(); + $route = $slim->router()->getCurrentRoute(); + $conditions = $route->getConditions(); - if (isset($conditions['useController']) && $conditions['useController'] == false) { - return; - } + if (isset($conditions['useController']) && $conditions['useController'] == false) { + return; + } - $routeOptions = call_user_func($route->getCallable()); - $routeKeys = is_array($routeOptions) ? array_keys($routeOptions) : array(); + $routeOptions = call_user_func($route->getCallable()); + $routeKeys = is_array($routeOptions) ? array_keys($routeOptions) : array(); - if (!in_array('controller', $routeKeys, true)) { - return $container->get('output')->render($routeOptions); - } + if (!in_array('controller', $routeKeys, true)) { + return $container->get('output')->render($routeOptions); + } - $params = $route->getParams(); - $data = $slim->request()->getBody(); + $params = $route->getParams(); + $data = $slim->request()->getBody(); - foreach ($routeOptions as $key => $value) { - if (strstr($value, ':')) { - $paramName = str_replace(':', '', $value); - $value = $params[$paramName]; - } - $controllerParams[$key] = $value; - } + foreach ($routeOptions as $key => $value) { + if (strstr($value, ':')) { + $paramName = str_replace(':', '', $value); + $value = $params[$paramName]; + } + $controllerParams[$key] = $value; + } - $params = array_merge($params, $controllerParams); + $params = array_merge($params, $controllerParams); - $controllerName = ucfirst($controllerParams['controller']); + $controllerName = ucfirst($controllerParams['controller']); - if (!empty($controllerParams['action'])) { - $actionName = $controllerParams['action']; - } else { - $httpMethod = strtolower($slim->request()->getMethod()); - $crudList = $container->get('config')->get('crud'); - $actionName = $crudList[$httpMethod]; - } + if (!empty($controllerParams['action'])) { + $actionName = $controllerParams['action']; + } else { + $httpMethod = strtolower($slim->request()->getMethod()); + $crudList = $container->get('config')->get('crud'); + $actionName = $crudList[$httpMethod]; + } - try { - $controllerManager = new \Espo\Core\ControllerManager($container); - $result = $controllerManager->process($controllerName, $actionName, $params, $data, $slim->request()); - $container->get('output')->render($result); - } catch (\Exception $e) { - $container->get('output')->processError($e->getMessage(), $e->getCode()); - } - }); + try { + $controllerManager = new \Espo\Core\ControllerManager($container); + $result = $controllerManager->process($controllerName, $actionName, $params, $data, $slim->request()); + $container->get('output')->render($result); + } catch (\Exception $e) { + $container->get('output')->processError($e->getMessage(), $e->getCode()); + } + }); - $this->getSlim()->hook('slim.after.router', function () use (&$slim) { - $slim->contentType('application/json'); + $this->getSlim()->hook('slim.after.router', function () use (&$slim) { + $slim->contentType('application/json'); - $res = $slim->response(); - $res->header('Expires', '0'); - $res->header('Last-Modified', gmdate("D, d M Y H:i:s") . " GMT"); - $res->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); - $res->header('Pragma', 'no-cache'); - }); - } + $res = $slim->response(); + $res->header('Expires', '0'); + $res->header('Last-Modified', gmdate("D, d M Y H:i:s") . " GMT"); + $res->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); + $res->header('Pragma', 'no-cache'); + }); + } - protected function initRoutes() - { - $routes = new \Espo\Core\Utils\Route($this->getContainer()->get('config'), $this->getMetadata(), $this->getContainer()->get('fileManager')); - $crudList = array_keys( $this->getContainer()->get('config')->get('crud') ); + protected function initRoutes() + { + $routes = new \Espo\Core\Utils\Route($this->getContainer()->get('config'), $this->getMetadata(), $this->getContainer()->get('fileManager')); + $crudList = array_keys( $this->getContainer()->get('config')->get('crud') ); - foreach ($routes->getAll() as $route) { + foreach ($routes->getAll() as $route) { - $method = strtolower($route['method']); - if (!in_array($method, $crudList)) { - $GLOBALS['log']->error('Route: Method ['.$method.'] does not exist. Please check your route ['.$route['route'].']'); - continue; - } + $method = strtolower($route['method']); + if (!in_array($method, $crudList)) { + $GLOBALS['log']->error('Route: Method ['.$method.'] does not exist. Please check your route ['.$route['route'].']'); + continue; + } $currentRoute = $this->getSlim()->$method($route['route'], function() use ($route) { //todo change "use" for php 5.4 - return $route['params']; - }); + return $route['params']; + }); - if (isset($route['conditions'])) { - $currentRoute->conditions($route['conditions']); - } - } - } + if (isset($route['conditions'])) { + $currentRoute->conditions($route['conditions']); + } + } + } } diff --git a/application/Espo/Core/Container.php b/application/Espo/Core/Container.php index 022ff4259b..aa3f75ec69 100644 --- a/application/Espo/Core/Container.php +++ b/application/Espo/Core/Container.php @@ -25,10 +25,10 @@ namespace Espo\Core; class Container { - private $data = array(); + private $data = array(); - /** + /** * Constructor */ public function __construct() @@ -38,38 +38,38 @@ class Container public function get($name) { - if (empty($this->data[$name])) { - $this->load($name); - } - return $this->data[$name]; + if (empty($this->data[$name])) { + $this->load($name); + } + return $this->data[$name]; } private function load($name) { - $loadMethod = 'load' . ucfirst($name); - if (method_exists($this, $loadMethod)) { - $obj = $this->$loadMethod(); - $this->data[$name] = $obj; - } else { - $className = '\Espo\Custom\Core\Loaders\\'.ucfirst($name); + $loadMethod = 'load' . ucfirst($name); + if (method_exists($this, $loadMethod)) { + $obj = $this->$loadMethod(); + $this->data[$name] = $obj; + } else { + $className = '\Espo\Custom\Core\Loaders\\'.ucfirst($name); if (!class_exists($className)) { - $className = '\Espo\Core\Loaders\\'.ucfirst($name); + $className = '\Espo\Core\Loaders\\'.ucfirst($name); } - if (class_exists($className)) { - $loadClass = new $className($this); - $this->data[$name] = $loadClass->load(); - } - } + if (class_exists($className)) { + $loadClass = new $className($this); + $this->data[$name] = $loadClass->load(); + } + } - return null; + return null; } protected function getServiceClassName($name, $default) { - $metadata = $this->get('metadata'); - $className = $metadata->get('app.serviceContainer.classNames.' . $name, $default); - return $className; + $metadata = $this->get('metadata'); + $className = $metadata->get('app.serviceContainer.classNames.' . $name, $default); + return $className; } private function loadSlim() @@ -77,161 +77,161 @@ class Container return new \Espo\Core\Utils\Api\Slim(); } - private function loadFileManager() + private function loadFileManager() { - return new \Espo\Core\Utils\File\Manager( - $this->get('config') - ); + return new \Espo\Core\Utils\File\Manager( + $this->get('config') + ); } - private function loadPreferences() + private function loadPreferences() { - return $this->get('entityManager')->getEntity('Preferences', $this->get('user')->id); + return $this->get('entityManager')->getEntity('Preferences', $this->get('user')->id); } - private function loadConfig() + private function loadConfig() { - return new \Espo\Core\Utils\Config( - new \Espo\Core\Utils\File\Manager() - ); + return new \Espo\Core\Utils\Config( + new \Espo\Core\Utils\File\Manager() + ); } - private function loadHookManager() + private function loadHookManager() { - return new \Espo\Core\HookManager( - $this - ); + return new \Espo\Core\HookManager( + $this + ); } - private function loadOutput() + private function loadOutput() { - return new \Espo\Core\Utils\Api\Output( - $this->get('slim') - ); + return new \Espo\Core\Utils\Api\Output( + $this->get('slim') + ); } - private function loadMailSender() + private function loadMailSender() { - $className = $this->getServiceClassName('mailSernder', '\\Espo\\Core\\Mail\\Sender'); - return new $className( - $this->get('config') - ); + $className = $this->getServiceClassName('mailSernder', '\\Espo\\Core\\Mail\\Sender'); + return new $className( + $this->get('config') + ); } - private function loadDateTime() + private function loadDateTime() { - return new \Espo\Core\Utils\DateTime( - $this->get('config')->get('dateFormat'), - $this->get('config')->get('timeFormat'), - $this->get('config')->get('timeZone') - ); + return new \Espo\Core\Utils\DateTime( + $this->get('config')->get('dateFormat'), + $this->get('config')->get('timeFormat'), + $this->get('config')->get('timeZone') + ); } - private function loadServiceFactory() + private function loadServiceFactory() { - return new \Espo\Core\ServiceFactory( - $this - ); + return new \Espo\Core\ServiceFactory( + $this + ); } - private function loadSelectManagerFactory() + private function loadSelectManagerFactory() { - return new \Espo\Core\SelectManagerFactory( - $this->get('entityManager'), - $this->get('user'), - $this->get('acl'), - $this->get('metadata') - ); + return new \Espo\Core\SelectManagerFactory( + $this->get('entityManager'), + $this->get('user'), + $this->get('acl'), + $this->get('metadata') + ); } - private function loadMetadata() + private function loadMetadata() { - return new \Espo\Core\Utils\Metadata( - $this->get('config'), - $this->get('fileManager') - ); + return new \Espo\Core\Utils\Metadata( + $this->get('config'), + $this->get('fileManager') + ); } - private function loadLayout() + private function loadLayout() { - return new \Espo\Core\Utils\Layout( - $this->get('fileManager'), - $this->get('metadata') - ); + return new \Espo\Core\Utils\Layout( + $this->get('fileManager'), + $this->get('metadata') + ); } - private function loadAcl() - { - $className = $this->getServiceClassName('acl', '\\Espo\\Core\\Acl'); - return new $className( - $this->get('user'), - $this->get('config'), - $this->get('fileManager'), - $this->get('metadata') - ); - } + private function loadAcl() + { + $className = $this->getServiceClassName('acl', '\\Espo\\Core\\Acl'); + return new $className( + $this->get('user'), + $this->get('config'), + $this->get('fileManager'), + $this->get('metadata') + ); + } - private function loadSchema() - { - return new \Espo\Core\Utils\Database\Schema\Schema( - $this->get('config'), - $this->get('metadata'), - $this->get('fileManager'), - $this->get('entityManager'), - $this->get('classParser') - ); - } + private function loadSchema() + { + return new \Espo\Core\Utils\Database\Schema\Schema( + $this->get('config'), + $this->get('metadata'), + $this->get('fileManager'), + $this->get('entityManager'), + $this->get('classParser') + ); + } - private function loadClassParser() - { - return new \Espo\Core\Utils\File\ClassParser( - $this->get('fileManager'), - $this->get('config'), - $this->get('metadata') - ); - } + private function loadClassParser() + { + return new \Espo\Core\Utils\File\ClassParser( + $this->get('fileManager'), + $this->get('config'), + $this->get('metadata') + ); + } - private function loadLanguage() - { - return new \Espo\Core\Utils\Language( - $this->get('fileManager'), - $this->get('config'), - $this->get('preferences') - ); - } - - private function loadCrypt() - { - return new \Espo\Core\Utils\Crypt( - $this->get('config') - ); - } + private function loadLanguage() + { + return new \Espo\Core\Utils\Language( + $this->get('fileManager'), + $this->get('config'), + $this->get('preferences') + ); + } + + private function loadCrypt() + { + return new \Espo\Core\Utils\Crypt( + $this->get('config') + ); + } - private function loadScheduledJob() - { - return new \Espo\Core\Cron\ScheduledJob( - $this - ); - } + private function loadScheduledJob() + { + return new \Espo\Core\Cron\ScheduledJob( + $this + ); + } - private function loadDataManager() - { - return new \Espo\Core\DataManager( - $this - ); - } + private function loadDataManager() + { + return new \Espo\Core\DataManager( + $this + ); + } - private function loadFieldManager() - { - return new \Espo\Core\Utils\FieldManager( - $this->get('metadata'), - $this->get('language') - ); - } + private function loadFieldManager() + { + return new \Espo\Core\Utils\FieldManager( + $this->get('metadata'), + $this->get('language') + ); + } - public function setUser($user) - { - $this->data['user'] = $user; - } + public function setUser($user) + { + $this->data['user'] = $user; + } } diff --git a/application/Espo/Core/ControllerManager.php b/application/Espo/Core/ControllerManager.php index 6c6b796c06..ee92f71c07 100644 --- a/application/Espo/Core/ControllerManager.php +++ b/application/Espo/Core/ControllerManager.php @@ -27,88 +27,88 @@ use \Espo\Core\Exceptions\NotFound; class ControllerManager { - private $config; + private $config; - private $metadata; + private $metadata; - private $container; + private $container; - public function __construct(\Espo\Core\Container $container) - { - $this->container = $container; + public function __construct(\Espo\Core\Container $container) + { + $this->container = $container; - $this->config = $this->container->get('config'); - $this->metadata = $this->container->get('metadata'); - } + $this->config = $this->container->get('config'); + $this->metadata = $this->container->get('metadata'); + } protected function getConfig() - { - return $this->config; - } + { + return $this->config; + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - public function process($controllerName, $actionName, $params, $data, $request) - { - $customeClassName = '\\Espo\\Custom\\Controllers\\' . Util::normilizeClassName($controllerName); - if (class_exists($customeClassName)) { - $controllerClassName = $customeClassName; - } else { - $moduleName = $this->metadata->getScopeModuleName($controllerName); - if ($moduleName) { - $controllerClassName = '\\Espo\\Modules\\' . $moduleName . '\\Controllers\\' . Util::normilizeClassName($controllerName); - } else { - $controllerClassName = '\\Espo\\Controllers\\' . Util::normilizeClassName($controllerName); - } - } + public function process($controllerName, $actionName, $params, $data, $request) + { + $customeClassName = '\\Espo\\Custom\\Controllers\\' . Util::normilizeClassName($controllerName); + if (class_exists($customeClassName)) { + $controllerClassName = $customeClassName; + } else { + $moduleName = $this->metadata->getScopeModuleName($controllerName); + if ($moduleName) { + $controllerClassName = '\\Espo\\Modules\\' . $moduleName . '\\Controllers\\' . Util::normilizeClassName($controllerName); + } else { + $controllerClassName = '\\Espo\\Controllers\\' . Util::normilizeClassName($controllerName); + } + } - if ($data && stristr($request->getContentType(), 'application/json')) { - $data = json_decode($data); - } + if ($data && stristr($request->getContentType(), 'application/json')) { + $data = json_decode($data); + } - if ($data instanceof \stdClass) { - $data = get_object_vars($data); - } + if ($data instanceof \stdClass) { + $data = get_object_vars($data); + } - if (!class_exists($controllerClassName)) { - throw new NotFound("Controller '$controllerName' is not found"); - } + if (!class_exists($controllerClassName)) { + throw new NotFound("Controller '$controllerName' is not found"); + } - $controller = new $controllerClassName($this->container, $request->getMethod()); + $controller = new $controllerClassName($this->container, $request->getMethod()); - if ($actionName == 'index') { - $actionName = $controllerClassName::$defaultAction; - } + if ($actionName == 'index') { + $actionName = $controllerClassName::$defaultAction; + } - $actionNameUcfirst = ucfirst($actionName); + $actionNameUcfirst = ucfirst($actionName); - $beforeMethodName = 'before' . $actionNameUcfirst; - if (method_exists($controller, $beforeMethodName)) { - $controller->$beforeMethodName($params, $data, $request); - } - $actionMethodName = 'action' . $actionNameUcfirst; + $beforeMethodName = 'before' . $actionNameUcfirst; + if (method_exists($controller, $beforeMethodName)) { + $controller->$beforeMethodName($params, $data, $request); + } + $actionMethodName = 'action' . $actionNameUcfirst; - if (!method_exists($controller, $actionMethodName)) { - throw new NotFound("Action '$actionMethodName' does not exist in controller '$controller'"); - } + if (!method_exists($controller, $actionMethodName)) { + throw new NotFound("Action '$actionMethodName' does not exist in controller '$controller'"); + } - $result = $controller->$actionMethodName($params, $data, $request); + $result = $controller->$actionMethodName($params, $data, $request); - $afterMethodName = 'after' . $actionNameUcfirst; - if (method_exists($controller, $afterMethodName)) { - $controller->$afterMethodName($params, $data, $request); - } + $afterMethodName = 'after' . $actionNameUcfirst; + if (method_exists($controller, $afterMethodName)) { + $controller->$afterMethodName($params, $data, $request); + } - if (is_array($result) || is_bool($result)) { - return \Espo\Core\Utils\Json::encode($result); - } + if (is_array($result) || is_bool($result)) { + return \Espo\Core\Utils\Json::encode($result); + } - return $result; - } + return $result; + } } diff --git a/application/Espo/Core/Controllers/Base.php b/application/Espo/Core/Controllers/Base.php index cf8f1703fd..7c49730251 100644 --- a/application/Espo/Core/Controllers/Base.php +++ b/application/Espo/Core/Controllers/Base.php @@ -28,91 +28,91 @@ use \Espo\Core\Utils\Util; abstract class Base { - protected $name; + protected $name; - private $container; + private $container; - private $requestMethod; + private $requestMethod; - public static $defaultAction = 'index'; + public static $defaultAction = 'index'; - public function __construct(Container $container, $requestMethod = null) - { - $this->container = $container; + public function __construct(Container $container, $requestMethod = null) + { + $this->container = $container; - if (isset($requestMethod)) { - $this->setRequestMethod($requestMethod); - } + if (isset($requestMethod)) { + $this->setRequestMethod($requestMethod); + } - if (empty($this->name)) { - $name = get_class($this); - if (preg_match('@\\\\([\w]+)$@', $name, $matches)) { - $name = $matches[1]; - } - $this->name = $name; - } + if (empty($this->name)) { + $name = get_class($this); + if (preg_match('@\\\\([\w]+)$@', $name, $matches)) { + $name = $matches[1]; + } + $this->name = $name; + } - $this->checkControllerAccess(); - } + $this->checkControllerAccess(); + } - protected function checkControllerAccess() - { - return; - } + protected function checkControllerAccess() + { + return; + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - /** - * Get request method name (Uppercase) - * - * @return string - */ - protected function getRequestMethod() - { - return $this->requestMethod; - } + /** + * Get request method name (Uppercase) + * + * @return string + */ + protected function getRequestMethod() + { + return $this->requestMethod; + } - protected function setRequestMethod($requestMethod) - { - $this->requestMethod = strtoupper($requestMethod); - } + protected function setRequestMethod($requestMethod) + { + $this->requestMethod = strtoupper($requestMethod); + } - protected function getUser() - { - return $this->container->get('user'); - } + protected function getUser() + { + return $this->container->get('user'); + } - protected function getAcl() - { - return $this->container->get('acl'); - } + protected function getAcl() + { + return $this->container->get('acl'); + } - protected function getConfig() - { - return $this->container->get('config'); - } + protected function getConfig() + { + return $this->container->get('config'); + } - protected function getPreferences() - { - return $this->container->get('preferences'); - } + protected function getPreferences() + { + return $this->container->get('preferences'); + } - protected function getMetadata() - { - return $this->container->get('metadata'); - } + protected function getMetadata() + { + return $this->container->get('metadata'); + } - protected function getServiceFactory() - { - return $this->container->get('serviceFactory'); - } + protected function getServiceFactory() + { + return $this->container->get('serviceFactory'); + } - protected function getService($name) - { - return $this->getServiceFactory()->create($name); - } + protected function getService($name) + { + return $this->getServiceFactory()->create($name); + } } diff --git a/application/Espo/Core/Controllers/Record.php b/application/Espo/Core/Controllers/Record.php index 0f20ea26c6..25c3e5f914 100644 --- a/application/Espo/Core/Controllers/Record.php +++ b/application/Espo/Core/Controllers/Record.php @@ -29,277 +29,277 @@ use \Espo\Core\Utils\Util; class Record extends Base { - const MAX_SIZE_LIMIT = 200; - - public static $defaultAction = 'list'; - - protected function getEntityManager() - { - return $this->getContainer()->get('entityManager'); - } - - protected function getRecordService($name = null) - { - if (empty($name)) { - $name = $this->name; - } - - if ($this->getServiceFactory()->checkExists($name)) { - $service = $this->getServiceFactory()->create($name); - } else { - $service = $this->getServiceFactory()->create('Record'); - $service->setEntityName($name); - } - - return $service; - } + const MAX_SIZE_LIMIT = 200; + + public static $defaultAction = 'list'; + + protected function getEntityManager() + { + return $this->getContainer()->get('entityManager'); + } + + protected function getRecordService($name = null) + { + if (empty($name)) { + $name = $this->name; + } + + if ($this->getServiceFactory()->checkExists($name)) { + $service = $this->getServiceFactory()->create($name); + } else { + $service = $this->getServiceFactory()->create('Record'); + $service->setEntityName($name); + } + + return $service; + } - public function actionRead($params) - { - $id = $params['id']; - $entity = $this->getRecordService()->getEntity($id); - - if (empty($entity)) { - throw new NotFound(); - } + public function actionRead($params) + { + $id = $params['id']; + $entity = $this->getRecordService()->getEntity($id); + + if (empty($entity)) { + throw new NotFound(); + } - return $entity->toArray(); - } - - public function actionPatch($params, $data) - { - return $this->actionUpdate($params, $data); - } - - public function actionCreate($params, $data) - { - if (!$this->getAcl()->check($this->name, 'edit')) { - throw new Forbidden(); - } + return $entity->toArray(); + } + + public function actionPatch($params, $data) + { + return $this->actionUpdate($params, $data); + } + + public function actionCreate($params, $data) + { + if (!$this->getAcl()->check($this->name, 'edit')) { + throw new Forbidden(); + } - $service = $this->getRecordService(); - - if ($entity = $service->createEntity($data)) { - return $entity->toArray(); - } + $service = $this->getRecordService(); + + if ($entity = $service->createEntity($data)) { + return $entity->toArray(); + } - throw new Error(); - } + throw new Error(); + } - public function actionUpdate($params, $data) - { - if (!$this->getAcl()->check($this->name, 'edit')) { - throw new Forbidden(); - } - - $id = $params['id']; - - if ($entity = $this->getRecordService()->updateEntity($id, $data)) { - return $entity->toArray(); - } + public function actionUpdate($params, $data) + { + if (!$this->getAcl()->check($this->name, 'edit')) { + throw new Forbidden(); + } + + $id = $params['id']; + + if ($entity = $this->getRecordService()->updateEntity($id, $data)) { + return $entity->toArray(); + } - throw new Error(); - } + throw new Error(); + } - public function actionList($params, $data, $request) - { - if (!$this->getAcl()->check($this->name, 'read')) { - throw new Forbidden(); - } + public function actionList($params, $data, $request) + { + if (!$this->getAcl()->check($this->name, 'read')) { + throw new Forbidden(); + } - $where = $request->get('where'); - $offset = $request->get('offset'); - $maxSize = $request->get('maxSize'); - $asc = $request->get('asc') === 'true'; - $sortBy = $request->get('sortBy'); - $q = $request->get('q'); - - if (empty($maxSize)) { - $maxSize = self::MAX_SIZE_LIMIT; - } - if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) { - throw new Forbidden(); - } + $where = $request->get('where'); + $offset = $request->get('offset'); + $maxSize = $request->get('maxSize'); + $asc = $request->get('asc') === 'true'; + $sortBy = $request->get('sortBy'); + $q = $request->get('q'); + + if (empty($maxSize)) { + $maxSize = self::MAX_SIZE_LIMIT; + } + if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) { + throw new Forbidden(); + } - $result = $this->getRecordService()->findEntities(array( - 'where' => $where, - 'offset' => $offset, - 'maxSize' => $maxSize, - 'asc' => $asc, - 'sortBy' => $sortBy, - 'q' => $q, - )); - - return array( - 'total' => $result['total'], - 'list' => $result['collection']->toArray() - ); - } - - public function actionListLinked($params, $data, $request) - { - $id = $params['id']; - $link = $params['link']; + $result = $this->getRecordService()->findEntities(array( + 'where' => $where, + 'offset' => $offset, + 'maxSize' => $maxSize, + 'asc' => $asc, + 'sortBy' => $sortBy, + 'q' => $q, + )); + + return array( + 'total' => $result['total'], + 'list' => $result['collection']->toArray() + ); + } + + public function actionListLinked($params, $data, $request) + { + $id = $params['id']; + $link = $params['link']; - $where = $request->get('where'); - $offset = $request->get('offset'); - $maxSize = $request->get('maxSize'); - $asc = $request->get('asc') === 'true'; - $sortBy = $request->get('sortBy'); - $q = $request->get('q'); - - if (empty($maxSize)) { - $maxSize = self::MAX_SIZE_LIMIT; - } - if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) { - throw new Forbidden(); - } + $where = $request->get('where'); + $offset = $request->get('offset'); + $maxSize = $request->get('maxSize'); + $asc = $request->get('asc') === 'true'; + $sortBy = $request->get('sortBy'); + $q = $request->get('q'); + + if (empty($maxSize)) { + $maxSize = self::MAX_SIZE_LIMIT; + } + if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) { + throw new Forbidden(); + } - $result = $this->getRecordService()->findLinkedEntities($id, $link, array( - 'where' => $where, - 'offset' => $offset, - 'maxSize' => $maxSize, - 'asc' => $asc, - 'sortBy' => $sortBy, - 'q' => $q, - )); - - - return array( - 'total' => $result['total'], - 'list' => $result['collection']->toArray() - ); - } + $result = $this->getRecordService()->findLinkedEntities($id, $link, array( + 'where' => $where, + 'offset' => $offset, + 'maxSize' => $maxSize, + 'asc' => $asc, + 'sortBy' => $sortBy, + 'q' => $q, + )); + + + return array( + 'total' => $result['total'], + 'list' => $result['collection']->toArray() + ); + } - public function actionDelete($params) - { - $id = $params['id']; + public function actionDelete($params) + { + $id = $params['id']; - if ($this->getRecordService()->deleteEntity($id)) { - return true; - } - throw new Error(); - } - - public function actionExport($params, $data, $request) - { - if ($this->getConfig()->get('disableExport') && !$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - - if (!$this->getAcl()->check($this->name, 'read')) { - throw new Forbidden(); - } - - $ids = $request->get('ids'); - $where = $request->get('where'); - - return array( - 'id' => $this->getRecordService()->export($ids, $where) - ); - } + if ($this->getRecordService()->deleteEntity($id)) { + return true; + } + throw new Error(); + } + + public function actionExport($params, $data, $request) + { + if ($this->getConfig()->get('disableExport') && !$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + + if (!$this->getAcl()->check($this->name, 'read')) { + throw new Forbidden(); + } + + $ids = $request->get('ids'); + $where = $request->get('where'); + + return array( + 'id' => $this->getRecordService()->export($ids, $where) + ); + } - public function actionMassUpdate($params, $data) - { - if (!$this->getAcl()->check($this->name, 'edit')) { - throw new Forbidden(); - } + public function actionMassUpdate($params, $data) + { + if (!$this->getAcl()->check($this->name, 'edit')) { + throw new Forbidden(); + } - $ids = $data['ids']; - $where = $data['where']; - $attributes = $data['attributes']; + $ids = $data['ids']; + $where = $data['where']; + $attributes = $data['attributes']; - $idsUpdated = $this->getRecordService()->massUpdate($attributes, $ids, $where); + $idsUpdated = $this->getRecordService()->massUpdate($attributes, $ids, $where); - return $idsUpdated; - } + return $idsUpdated; + } - public function actionMassDelete($params, $data) - { - if (!$this->getAcl()->check($this->name, 'delete')) { - throw new Forbidden(); - } + public function actionMassDelete($params, $data) + { + if (!$this->getAcl()->check($this->name, 'delete')) { + throw new Forbidden(); + } - $ids = $data['ids']; - $where = $data['where']; + $ids = $data['ids']; + $where = $data['where']; - $idsDeleted = $this->getRecordService()->massDelete($ids, $where); + $idsDeleted = $this->getRecordService()->massDelete($ids, $where); - return $idsDeleted; - } + return $idsDeleted; + } - public function actionCreateLink($params, $data) - { - $id = $params['id']; - $link = $params['link']; - - $foreignIds = array(); - if (isset($data['id'])) { - $foreignIds[] = $data['id']; - } - if (isset($data['ids']) && is_array($data['ids'])) { - foreach ($data['ids'] as $foreignId) { - $foreignIds[] = $foreignId; - } - } - - $result = false; - foreach ($foreignIds as $foreignId) { - if ($this->getRecordService()->linkEntity($id, $link, $foreignId)) { - $result = $result || true; - } - } - if ($result) { - return true; - } - - throw new Error(); - } - - public function actionRemoveLink($params, $data) - { - $id = $params['id']; - $link = $params['link']; - - $foreignIds = array(); - if (isset($data['id'])) { - $foreignIds[] = $data['id']; - } - if (isset($data['ids']) && is_array($data['ids'])) { - foreach ($data['ids'] as $foreignId) { - $foreignIds[] = $foreignId; - } - } - - $result = false; - foreach ($foreignIds as $foreignId) { - if ($this->getRecordService()->unlinkEntity($id, $link, $foreignId)) { - $result = $result || true; - } - } - if ($result) { - return true; - } - - throw new Error(); - } - - public function actionFollow($params) - { - if (!$this->getAcl()->check($this->name, 'read')) { - throw new Forbidden(); - } - $id = $params['id']; - return $this->getRecordService()->follow($id); - } - - public function actionUnfollow($params) - { - if (!$this->getAcl()->check($this->name, 'read')) { - throw new Forbidden(); - } - $id = $params['id']; - return $this->getRecordService()->unfollow($id); - } + public function actionCreateLink($params, $data) + { + $id = $params['id']; + $link = $params['link']; + + $foreignIds = array(); + if (isset($data['id'])) { + $foreignIds[] = $data['id']; + } + if (isset($data['ids']) && is_array($data['ids'])) { + foreach ($data['ids'] as $foreignId) { + $foreignIds[] = $foreignId; + } + } + + $result = false; + foreach ($foreignIds as $foreignId) { + if ($this->getRecordService()->linkEntity($id, $link, $foreignId)) { + $result = $result || true; + } + } + if ($result) { + return true; + } + + throw new Error(); + } + + public function actionRemoveLink($params, $data) + { + $id = $params['id']; + $link = $params['link']; + + $foreignIds = array(); + if (isset($data['id'])) { + $foreignIds[] = $data['id']; + } + if (isset($data['ids']) && is_array($data['ids'])) { + foreach ($data['ids'] as $foreignId) { + $foreignIds[] = $foreignId; + } + } + + $result = false; + foreach ($foreignIds as $foreignId) { + if ($this->getRecordService()->unlinkEntity($id, $link, $foreignId)) { + $result = $result || true; + } + } + if ($result) { + return true; + } + + throw new Error(); + } + + public function actionFollow($params) + { + if (!$this->getAcl()->check($this->name, 'read')) { + throw new Forbidden(); + } + $id = $params['id']; + return $this->getRecordService()->follow($id); + } + + public function actionUnfollow($params) + { + if (!$this->getAcl()->check($this->name, 'read')) { + throw new Forbidden(); + } + $id = $params['id']; + return $this->getRecordService()->unfollow($id); + } } diff --git a/application/Espo/Core/Cron/ScheduledJob.php b/application/Espo/Core/Cron/ScheduledJob.php index 22fa69ad81..886dfd0b70 100644 --- a/application/Espo/Core/Cron/ScheduledJob.php +++ b/application/Espo/Core/Cron/ScheduledJob.php @@ -23,163 +23,163 @@ namespace Espo\Core\Cron; use Espo\Core\Exceptions\NotFound, - Espo\Core\Utils\Util; + Espo\Core\Utils\Util; class ScheduledJob { - private $container; - private $systemUtil; + private $container; + private $systemUtil; - protected $data = null; + protected $data = null; - protected $cacheFile = 'data/cache/application/jobs.php'; + protected $cacheFile = 'data/cache/application/jobs.php'; - protected $cronFile = 'cron.php'; + protected $cronFile = 'cron.php'; - protected $allowedMethod = 'run'; + protected $allowedMethod = 'run'; - /** - * @var array - path to cron job files - */ - private $paths = array( - 'corePath' => 'application/Espo/Jobs', - 'modulePath' => 'application/Espo/Modules/{*}/Jobs', - 'customPath' => 'custom/Espo/Custom/Jobs', - ); + /** + * @var array - path to cron job files + */ + private $paths = array( + 'corePath' => 'application/Espo/Jobs', + 'modulePath' => 'application/Espo/Modules/{*}/Jobs', + 'customPath' => 'custom/Espo/Custom/Jobs', + ); - protected $cronSetup = array( - 'linux' => '* * * * * {PHP-BIN-DIR} -f {CRON-FILE} > /dev/null 2>&1', - 'windows' => '{PHP-BIN-DIR}.exe -f {CRON-FILE}', - 'mac' => '* * * * * {PHP-BIN-DIR} -f {CRON-FILE} > /dev/null 2>&1', - 'default' => '* * * * * {PHP-BIN-DIR} -f {CRON-FILE}', - ); + protected $cronSetup = array( + 'linux' => '* * * * * {PHP-BIN-DIR} -f {CRON-FILE} > /dev/null 2>&1', + 'windows' => '{PHP-BIN-DIR}.exe -f {CRON-FILE}', + 'mac' => '* * * * * {PHP-BIN-DIR} -f {CRON-FILE} > /dev/null 2>&1', + 'default' => '* * * * * {PHP-BIN-DIR} -f {CRON-FILE}', + ); - public function __construct(\Espo\Core\Container $container) - { - $this->container = $container; - $this->systemUtil = new \Espo\Core\Utils\System(); - } + public function __construct(\Espo\Core\Container $container) + { + $this->container = $container; + $this->systemUtil = new \Espo\Core\Utils\System(); + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - protected function getEntityManager() - { - return $this->container->get('entityManager'); - } + protected function getEntityManager() + { + return $this->container->get('entityManager'); + } - protected function getSystemUtil() - { - return $this->systemUtil; - } + protected function getSystemUtil() + { + return $this->systemUtil; + } - public function run(array $job) - { - $jobName = $job['method']; + public function run(array $job) + { + $jobName = $job['method']; - $className = $this->getClassName($jobName); - if ($className === false) { - throw new NotFound(); - } + $className = $this->getClassName($jobName); + if ($className === false) { + throw new NotFound(); + } - $jobClass = new $className($this->container); - $method = $this->allowedMethod; + $jobClass = new $className($this->container); + $method = $this->allowedMethod; - $jobClass->$method(); - } + $jobClass->$method(); + } - /** - * Get list of all jobs - * - * @return array - */ - public function getAll() - { - if (!isset($this->data)) { - $this->init(); - } + /** + * Get list of all jobs + * + * @return array + */ + public function getAll() + { + if (!isset($this->data)) { + $this->init(); + } - return $this->data; - } + return $this->data; + } - /** - * Get class name of a job by name - * - * @param string $name - * @return string - */ - public function get($name) - { - return $this->getClassName($name); - } + /** + * Get class name of a job by name + * + * @param string $name + * @return string + */ + public function get($name) + { + return $this->getClassName($name); + } - /** - * Get list of all job names - * - * @return array - */ - public function getAllNamesOnly() - { - $data = $this->getAll(); + /** + * Get list of all job names + * + * @return array + */ + public function getAllNamesOnly() + { + $data = $this->getAll(); - $namesOnly = array_keys($data); + $namesOnly = array_keys($data); - return $namesOnly; - } + return $namesOnly; + } - /** - * Get class name of a job - * - * @param string $name - * @return string - */ - protected function getClassName($name) - { - $name = Util::normilizeClassName($name); + /** + * Get class name of a job + * + * @param string $name + * @return string + */ + protected function getClassName($name) + { + $name = Util::normilizeClassName($name); - $data = $this->getAll(); + $data = $this->getAll(); - $name = ucfirst($name); - if (isset($data[$name])) { - return $data[$name]; - } + $name = ucfirst($name); + if (isset($data[$name])) { + return $data[$name]; + } - return false; - } + return false; + } - /** - * Load scheduler classes. It loads from ...Jobs, ex. \Espo\Jobs - * @return null - */ - protected function init() - { - $classParser = $this->getContainer()->get('classParser'); - $classParser->setAllowedMethods( array($this->allowedMethod) ); - $this->data = $classParser->getData($this->paths, $this->cacheFile); - } + /** + * Load scheduler classes. It loads from ...Jobs, ex. \Espo\Jobs + * @return null + */ + protected function init() + { + $classParser = $this->getContainer()->get('classParser'); + $classParser->setAllowedMethods( array($this->allowedMethod) ); + $this->data = $classParser->getData($this->paths, $this->cacheFile); + } - public function getSetupMessage() - { - $language = $this->getContainer()->get('language'); + public function getSetupMessage() + { + $language = $this->getContainer()->get('language'); - $OS = $this->getSystemUtil()->getOS(); - $phpBin = $this->getSystemUtil()->getPhpBin(); - $cronFile = Util::concatPath($this->getSystemUtil()->getRootDir(), $this->cronFile); - $desc = $language->translate('cronSetup', 'options', 'ScheduledJob'); + $OS = $this->getSystemUtil()->getOS(); + $phpBin = $this->getSystemUtil()->getPhpBin(); + $cronFile = Util::concatPath($this->getSystemUtil()->getRootDir(), $this->cronFile); + $desc = $language->translate('cronSetup', 'options', 'ScheduledJob'); - $message = isset($desc[$OS]) ? $desc[$OS] : $desc['default']; + $message = isset($desc[$OS]) ? $desc[$OS] : $desc['default']; - $command = isset($this->cronSetup[$OS]) ? $this->cronSetup[$OS] : $this->cronSetup['default']; - $command = str_replace(array('{PHP-BIN-DIR}', '{CRON-FILE}'), array($phpBin, $cronFile), $command); + $command = isset($this->cronSetup[$OS]) ? $this->cronSetup[$OS] : $this->cronSetup['default']; + $command = str_replace(array('{PHP-BIN-DIR}', '{CRON-FILE}'), array($phpBin, $cronFile), $command); - return array( - 'message' => $message, - 'command' => $command, - ); - } + return array( + 'message' => $message, + 'command' => $command, + ); + } } diff --git a/application/Espo/Core/Cron/Service.php b/application/Espo/Core/Cron/Service.php index 7ffa3a2ca6..cb969e1b53 100644 --- a/application/Espo/Core/Cron/Service.php +++ b/application/Espo/Core/Cron/Service.php @@ -23,45 +23,45 @@ namespace Espo\Core\Cron; use Espo\Core\Utils\Json, - Espo\Core\Exceptions\NotFound; + Espo\Core\Exceptions\NotFound; class Service { - private $serviceFactory; + private $serviceFactory; - public function __construct(\Espo\Core\ServiceFactory $serviceFactory) - { - $this->serviceFactory = $serviceFactory; - } + public function __construct(\Espo\Core\ServiceFactory $serviceFactory) + { + $this->serviceFactory = $serviceFactory; + } - protected function getServiceFactory() - { - return $this->serviceFactory; - } + protected function getServiceFactory() + { + return $this->serviceFactory; + } - public function run($job) - { - $serviceName = $job['service_name']; + public function run($job) + { + $serviceName = $job['service_name']; - if (!$this->getServiceFactory()->checkExists($serviceName)) { - throw new NotFound(); - } + if (!$this->getServiceFactory()->checkExists($serviceName)) { + throw new NotFound(); + } - $service = $this->getServiceFactory()->create($serviceName); - $serviceMethod = $job['method']; + $service = $this->getServiceFactory()->create($serviceName); + $serviceMethod = $job['method']; - if (!method_exists($service, $serviceMethod)) { - throw new NotFound(); - } + if (!method_exists($service, $serviceMethod)) { + throw new NotFound(); + } - $data = $job['data']; - if (Json::isJSON($data)) { - $data = Json::decode($data, true); - } + $data = $job['data']; + if (Json::isJSON($data)) { + $data = Json::decode($data, true); + } - $service->$serviceMethod($data); - } + $service->$serviceMethod($data); + } } \ No newline at end of file diff --git a/application/Espo/Core/CronManager.php b/application/Espo/Core/CronManager.php index 6c5cb13063..059ec4d059 100644 --- a/application/Espo/Core/CronManager.php +++ b/application/Espo/Core/CronManager.php @@ -24,192 +24,192 @@ namespace Espo\Core; class CronManager { - private $container; - private $config; - private $fileManager; + private $container; + private $config; + private $fileManager; - private $scheduledJobCron; - private $serviceCron; + private $scheduledJobCron; + private $serviceCron; - private $jobService; - private $scheduledJobService; + private $jobService; + private $scheduledJobService; - const PENDING = 'Pending'; - const RUNNING = 'Running'; - const SUCCESS = 'Success'; - const FAILED = 'Failed'; + const PENDING = 'Pending'; + const RUNNING = 'Running'; + const SUCCESS = 'Success'; + const FAILED = 'Failed'; - protected $lastRunTime = 'data/cache/application/cronLastRunTime.php'; + protected $lastRunTime = 'data/cache/application/cronLastRunTime.php'; - public function __construct(\Espo\Core\Container $container) - { - $this->container = $container; + public function __construct(\Espo\Core\Container $container) + { + $this->container = $container; - $this->config = $this->container->get('config'); - $this->fileManager = $this->container->get('fileManager'); + $this->config = $this->container->get('config'); + $this->fileManager = $this->container->get('fileManager'); - $this->scheduledJobCron = $this->container->get('scheduledJob'); - $this->serviceCron = new \Espo\Core\Cron\Service( $this->container->get('serviceFactory')); + $this->scheduledJobCron = $this->container->get('scheduledJob'); + $this->serviceCron = new \Espo\Core\Cron\Service( $this->container->get('serviceFactory')); - $this->jobService = $this->container->get('serviceFactory')->create('job'); - $this->scheduledJobService = $this->container->get('serviceFactory')->create('scheduledJob'); - } + $this->jobService = $this->container->get('serviceFactory')->create('job'); + $this->scheduledJobService = $this->container->get('serviceFactory')->create('scheduledJob'); + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - protected function getJobService() - { - return $this->jobService; - } + protected function getJobService() + { + return $this->jobService; + } - protected function getScheduledJobService() - { - return $this->scheduledJobService; - } + protected function getScheduledJobService() + { + return $this->scheduledJobService; + } - protected function getScheduledJobCron() - { - return $this->scheduledJobCron; - } + protected function getScheduledJobCron() + { + return $this->scheduledJobCron; + } - protected function getServiceCron() - { - return $this->serviceCron; - } + protected function getServiceCron() + { + return $this->serviceCron; + } - protected function getLastRunTime() - { - $lastRunTime = $this->getFileManager()->getContents($this->lastRunTime); - if (!is_int($lastRunTime)) { - $lastRunTime = time() - (intval($this->getConfig()->get('cron.minExecutionTime')) + 60); - } + protected function getLastRunTime() + { + $lastRunTime = $this->getFileManager()->getContents($this->lastRunTime); + if (!is_int($lastRunTime)) { + $lastRunTime = time() - (intval($this->getConfig()->get('cron.minExecutionTime')) + 60); + } - return $lastRunTime; - } + return $lastRunTime; + } - protected function setLastRunTime($time) - { - return $this->getFileManager()->putContentsPHP($this->lastRunTime, $time); - } + protected function setLastRunTime($time) + { + return $this->getFileManager()->putContentsPHP($this->lastRunTime, $time); + } - protected function checkLastRunTime() - { - $currentTime = time(); - $lastRunTime = $this->getLastRunTime(); - $minTime = $this->getConfig()->get('cron.minExecutionTime'); + protected function checkLastRunTime() + { + $currentTime = time(); + $lastRunTime = $this->getLastRunTime(); + $minTime = $this->getConfig()->get('cron.minExecutionTime'); - if ($currentTime > ($lastRunTime + $minTime) ) { - return true; - } + if ($currentTime > ($lastRunTime + $minTime) ) { + return true; + } - return false; - } + return false; + } - public function run() - { - if (!$this->checkLastRunTime()) { - $GLOBALS['log']->info('Cron Manager: Stop cron running, too frequency execution'); - return; //stop cron running, too frequency execution - } + public function run() + { + if (!$this->checkLastRunTime()) { + $GLOBALS['log']->info('Cron Manager: Stop cron running, too frequency execution'); + return; //stop cron running, too frequency execution + } - $this->setLastRunTime(time()); + $this->setLastRunTime(time()); - //Check scheduled jobs and create related jobs - $this->createJobsFromScheduledJobs(); + //Check scheduled jobs and create related jobs + $this->createJobsFromScheduledJobs(); - $pendingJobs = $this->getJobService()->getPendingJobs(); + $pendingJobs = $this->getJobService()->getPendingJobs(); - foreach ($pendingJobs as $job) { + foreach ($pendingJobs as $job) { - $this->getJobService()->updateEntity($job['id'], array( - 'status' => self::RUNNING, - )); + $this->getJobService()->updateEntity($job['id'], array( + 'status' => self::RUNNING, + )); - $isSuccess = true; + $isSuccess = true; - try { - if (!empty($job['scheduled_job_id'])) { - $this->getScheduledJobCron()->run($job); - } else { - $this->getServiceCron()->run($job); - } - } catch (\Exception $e) { - $isSuccess = false; - $GLOBALS['log']->error('Failed job running, job ['.$job['id'].']. Error Details: '.$e->getMessage()); - } + try { + if (!empty($job['scheduled_job_id'])) { + $this->getScheduledJobCron()->run($job); + } else { + $this->getServiceCron()->run($job); + } + } catch (\Exception $e) { + $isSuccess = false; + $GLOBALS['log']->error('Failed job running, job ['.$job['id'].']. Error Details: '.$e->getMessage()); + } - $status = $isSuccess ? self::SUCCESS : self::FAILED; + $status = $isSuccess ? self::SUCCESS : self::FAILED; - $this->getJobService()->updateEntity($job['id'], array( - 'status' => $status, - )); + $this->getJobService()->updateEntity($job['id'], array( + 'status' => $status, + )); - //set status in the schedulerJobLog - if (!empty($job['scheduled_job_id'])) { - $this->getScheduledJobService()->addLogRecord($job['scheduled_job_id'], $status); - } - } + //set status in the schedulerJobLog + if (!empty($job['scheduled_job_id'])) { + $this->getScheduledJobService()->addLogRecord($job['scheduled_job_id'], $status); + } + } - } + } - /** - * Check scheduled jobs and create related jobs - * @return array List of created Jobs - */ - protected function createJobsFromScheduledJobs() - { - $activeScheduledJobs = $this->getScheduledJobService()->getActiveJobs(); + /** + * Check scheduled jobs and create related jobs + * @return array List of created Jobs + */ + protected function createJobsFromScheduledJobs() + { + $activeScheduledJobs = $this->getScheduledJobService()->getActiveJobs(); - $createdJobs = array(); - foreach ($activeScheduledJobs as $scheduledJob) { + $createdJobs = array(); + foreach ($activeScheduledJobs as $scheduledJob) { - $scheduling = $scheduledJob['scheduling']; + $scheduling = $scheduledJob['scheduling']; - $cronExpression = \Cron\CronExpression::factory($scheduling); + $cronExpression = \Cron\CronExpression::factory($scheduling); - try { - $prevDate = $cronExpression->getPreviousRunDate()->format('Y-m-d H:i:s'); - } catch (\Exception $e) { - $GLOBALS['log']->error('ScheduledJob ['.$scheduledJob['id'].']: CronExpression - Impossible CRON expression ['.$scheduling.']'); - continue; - } + try { + $prevDate = $cronExpression->getPreviousRunDate()->format('Y-m-d H:i:s'); + } catch (\Exception $e) { + $GLOBALS['log']->error('ScheduledJob ['.$scheduledJob['id'].']: CronExpression - Impossible CRON expression ['.$scheduling.']'); + continue; + } - if ($cronExpression->isDue()) { - $prevDate = date('Y-m-d H:i:00'); - } + if ($cronExpression->isDue()) { + $prevDate = date('Y-m-d H:i:00'); + } - $existsJob = $this->getJobService()->getJobByScheduledJob($scheduledJob['id'], $prevDate); + $existsJob = $this->getJobService()->getJobByScheduledJob($scheduledJob['id'], $prevDate); - if (!isset($existsJob) || empty($existsJob)) { - //create a job - $data = array( - 'name' => $scheduledJob['name'], - 'status' => self::PENDING, - 'scheduledJobId' => $scheduledJob['id'], - 'executeTime' => $prevDate, - 'method' => $scheduledJob['job'], - ); - $createdJobs[] = $this->getJobService()->createEntity($data); - } - } + if (!isset($existsJob) || empty($existsJob)) { + //create a job + $data = array( + 'name' => $scheduledJob['name'], + 'status' => self::PENDING, + 'scheduledJobId' => $scheduledJob['id'], + 'executeTime' => $prevDate, + 'method' => $scheduledJob['job'], + ); + $createdJobs[] = $this->getJobService()->createEntity($data); + } + } - return $createdJobs; - } + return $createdJobs; + } } diff --git a/application/Espo/Core/DataManager.php b/application/Espo/Core/DataManager.php index 65ee595dd7..c71441bd24 100644 --- a/application/Espo/Core/DataManager.php +++ b/application/Espo/Core/DataManager.php @@ -24,106 +24,106 @@ namespace Espo\Core; class DataManager { - private $container; + private $container; - private $cachePath = 'data/cache'; + private $cachePath = 'data/cache'; - public function __construct(Container $container) - { - $this->container = $container; - } + public function __construct(Container $container) + { + $this->container = $container; + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - /** - * Rebuild the system with metadata, database and cache clearing - * - * @return bool - */ - public function rebuild($entityList = null) - { - $result = $this->clearCache(); + /** + * Rebuild the system with metadata, database and cache clearing + * + * @return bool + */ + public function rebuild($entityList = null) + { + $result = $this->clearCache(); - $result &= $this->rebuildMetadata(); + $result &= $this->rebuildMetadata(); - $result &= $this->rebuildDatabase($entityList); + $result &= $this->rebuildDatabase($entityList); - return $result; - } + return $result; + } - /** - * Clear a cache - * - * @return bool - */ - public function clearCache() - { - $result = $this->getContainer()->get('fileManager')->removeInDir($this->cachePath); + /** + * Clear a cache + * + * @return bool + */ + public function clearCache() + { + $result = $this->getContainer()->get('fileManager')->removeInDir($this->cachePath); - if ($result === false) { - throw new Exceptions\Error("Error while clearing cache"); - } + if ($result === false) { + throw new Exceptions\Error("Error while clearing cache"); + } - $this->updateCacheTimestamp(); + $this->updateCacheTimestamp(); - return $result; - } + return $result; + } - /** - * Rebuild database - * - * @return bool - */ - public function rebuildDatabase($entityList = null) - { - try { - $result = $this->getContainer()->get('schema')->rebuild($entityList); - } catch (\Exception $e) { - $result = false; - $GLOBALS['log']->error('Fault to rebuild database schema'.'. Details: '.$e->getMessage()); - } + /** + * Rebuild database + * + * @return bool + */ + public function rebuildDatabase($entityList = null) + { + try { + $result = $this->getContainer()->get('schema')->rebuild($entityList); + } catch (\Exception $e) { + $result = false; + $GLOBALS['log']->error('Fault to rebuild database schema'.'. Details: '.$e->getMessage()); + } - if ($result === false) { - throw new Exceptions\Error("Error while rebuilding database. See log file for details."); - } + if ($result === false) { + throw new Exceptions\Error("Error while rebuilding database. See log file for details."); + } - $this->updateCacheTimestamp(); + $this->updateCacheTimestamp(); - return $result; - } + return $result; + } - /** - * Rebuild metadata - * - * @return bool - */ - public function rebuildMetadata() - { - $metadata = $this->getContainer()->get('metadata'); + /** + * Rebuild metadata + * + * @return bool + */ + public function rebuildMetadata() + { + $metadata = $this->getContainer()->get('metadata'); - $metadata->init(true); + $metadata->init(true); - $ormMeta = $metadata->getOrmMetadata(true); + $ormMeta = $metadata->getOrmMetadata(true); - $this->updateCacheTimestamp(); + $this->updateCacheTimestamp(); - return empty($ormMeta) ? false : true; - } + return empty($ormMeta) ? false : true; + } - /** - * Update cache timestamp - * - * @return bool - */ - public function updateCacheTimestamp() - { - $this->getContainer()->get('config')->updateCacheTimestamp(); - $this->getContainer()->get('config')->save(); - return true; - } + /** + * Update cache timestamp + * + * @return bool + */ + public function updateCacheTimestamp() + { + $this->getContainer()->get('config')->updateCacheTimestamp(); + $this->getContainer()->get('config')->save(); + return true; + } } diff --git a/application/Espo/Core/Entities/Person.php b/application/Espo/Core/Entities/Person.php index 38de106a55..f1465162a8 100644 --- a/application/Espo/Core/Entities/Person.php +++ b/application/Espo/Core/Entities/Person.php @@ -24,30 +24,30 @@ namespace Espo\Core\Entities; class Person extends \Espo\Core\ORM\Entity { - public static $person = true; - - public function setLastName($value) - { - $this->_setValue('lastName', $value); - - $firstName = $this->get('firstName'); - if (empty($firstName)) { - $this->_setValue('name', $value); - } else { - $this->_setValue('name', $firstName . ' ' . $value); - } - } - - public function setFirstName($value) - { - $this->_setValue('firstName', $value); - - $lastName = $this->get('lastName'); - if (empty($lastName)) { - $this->_setValue('name', $value); - } else { - $this->_setValue('name', $value . ' ' . $lastName); - } - } + public static $person = true; + + public function setLastName($value) + { + $this->_setValue('lastName', $value); + + $firstName = $this->get('firstName'); + if (empty($firstName)) { + $this->_setValue('name', $value); + } else { + $this->_setValue('name', $firstName . ' ' . $value); + } + } + + public function setFirstName($value) + { + $this->_setValue('firstName', $value); + + $lastName = $this->get('lastName'); + if (empty($lastName)) { + $this->_setValue('name', $value); + } else { + $this->_setValue('name', $value . ' ' . $lastName); + } + } } diff --git a/application/Espo/Core/EntryPointManager.php b/application/Espo/Core/EntryPointManager.php index fa24a67fa5..271bcdabf3 100644 --- a/application/Espo/Core/EntryPointManager.php +++ b/application/Espo/Core/EntryPointManager.php @@ -23,93 +23,93 @@ namespace Espo\Core; use \Espo\Core\Exceptions\NotFound, - \Espo\Core\Utils\Util; + \Espo\Core\Utils\Util; class EntryPointManager { - private $container; - - private $fileManager; + private $container; + + private $fileManager; - protected $data = null; + protected $data = null; - protected $cacheFile = 'data/cache/application/entryPoints.php'; + protected $cacheFile = 'data/cache/application/entryPoints.php'; - protected $allowedMethods = array( - 'run', - ); + protected $allowedMethods = array( + 'run', + ); - /** + /** * @var array - path to entryPoint files */ - private $paths = array( - 'corePath' => 'application/Espo/EntryPoints', - 'modulePath' => 'application/Espo/Modules/{*}/EntryPoints', - 'customPath' => 'custom/Espo/Custom/EntryPoints', - ); + private $paths = array( + 'corePath' => 'application/Espo/EntryPoints', + 'modulePath' => 'application/Espo/Modules/{*}/EntryPoints', + 'customPath' => 'custom/Espo/Custom/EntryPoints', + ); - public function __construct(\Espo\Core\Container $container) - { - $this->container = $container; - $this->fileManager = $container->get('fileManager'); - } + public function __construct(\Espo\Core\Container $container) + { + $this->container = $container; + $this->fileManager = $container->get('fileManager'); + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - public function checkAuthRequired($name) - { - $className = $this->getClassName($name); - if ($className === false) { - throw new NotFound(); - } - return $className::$authRequired; - } + public function checkAuthRequired($name) + { + $className = $this->getClassName($name); + if ($className === false) { + throw new NotFound(); + } + return $className::$authRequired; + } - public function run($name) - { - $className = $this->getClassName($name); - if ($className === false) { - throw new NotFound(); - } - $entryPoint = new $className($this->container); + public function run($name) + { + $className = $this->getClassName($name); + if ($className === false) { + throw new NotFound(); + } + $entryPoint = new $className($this->container); - $entryPoint->run(); - } + $entryPoint->run(); + } - protected function getClassName($name) - { - $name = Util::normilizeClassName($name); - - if (!isset($this->data)) { - $this->init(); - } + protected function getClassName($name) + { + $name = Util::normilizeClassName($name); + + if (!isset($this->data)) { + $this->init(); + } - $name = ucfirst($name); - if (isset($this->data[$name])) { - return $this->data[$name]; - } - + $name = ucfirst($name); + if (isset($this->data[$name])) { + return $this->data[$name]; + } + return false; - } + } - protected function init() - { - $classParser = $this->getContainer()->get('classParser'); - $classParser->setAllowedMethods($this->allowedMethods); - $this->data = $classParser->getData($this->paths, $this->cacheFile); - } - + protected function init() + { + $classParser = $this->getContainer()->get('classParser'); + $classParser->setAllowedMethods($this->allowedMethods); + $this->data = $classParser->getData($this->paths, $this->cacheFile); + } + } diff --git a/application/Espo/Core/EntryPoints/Base.php b/application/Espo/Core/EntryPoints/Base.php index 52c668b8e7..d62598a66f 100644 --- a/application/Espo/Core/EntryPoints/Base.php +++ b/application/Espo/Core/EntryPoints/Base.php @@ -28,51 +28,51 @@ use \Espo\Core\Exceptions\Forbidden; abstract class Base { - private $container; - - public static $authRequired = true; - - protected function getContainer() - { - return $this->container; - } - - protected function getUser() - { - return $this->getContainer()->get('user'); - } - - protected function getAcl() - { - return $this->getContainer()->get('acl'); - } - - protected function getEntityManager() - { - return $this->getContainer()->get('entityManager'); - } - - protected function getServiceFactory() - { - return $this->getContainer()->get('serviceFactory'); - } - - protected function getConfig() - { - return $this->getContainer()->get('config'); - } - - protected function getMetadata() - { - return $this->getContainer()->get('metadata'); - } - - public function __construct(Container $container) - { - $this->container = $container; - } - - abstract public function run(); + private $container; + + public static $authRequired = true; + + protected function getContainer() + { + return $this->container; + } + + protected function getUser() + { + return $this->getContainer()->get('user'); + } + + protected function getAcl() + { + return $this->getContainer()->get('acl'); + } + + protected function getEntityManager() + { + return $this->getContainer()->get('entityManager'); + } + + protected function getServiceFactory() + { + return $this->getContainer()->get('serviceFactory'); + } + + protected function getConfig() + { + return $this->getContainer()->get('config'); + } + + protected function getMetadata() + { + return $this->getContainer()->get('metadata'); + } + + public function __construct(Container $container) + { + $this->container = $container; + } + + abstract public function run(); } diff --git a/application/Espo/Core/Exceptions/BadRequest.php b/application/Espo/Core/Exceptions/BadRequest.php index d12197cb01..e27d485b5f 100644 --- a/application/Espo/Core/Exceptions/BadRequest.php +++ b/application/Espo/Core/Exceptions/BadRequest.php @@ -24,7 +24,7 @@ namespace Espo\Core\Exceptions; class BadRequest extends \Exception { - protected $code = 400; + protected $code = 400; } diff --git a/application/Espo/Core/Exceptions/Conflict.php b/application/Espo/Core/Exceptions/Conflict.php index 0433a62160..d749eab336 100644 --- a/application/Espo/Core/Exceptions/Conflict.php +++ b/application/Espo/Core/Exceptions/Conflict.php @@ -24,7 +24,7 @@ namespace Espo\Core\Exceptions; class Conflict extends \Exception { - protected $code = 409; + protected $code = 409; } diff --git a/application/Espo/Core/Exceptions/Forbidden.php b/application/Espo/Core/Exceptions/Forbidden.php index 2fdf613a23..edf5350b55 100644 --- a/application/Espo/Core/Exceptions/Forbidden.php +++ b/application/Espo/Core/Exceptions/Forbidden.php @@ -24,7 +24,7 @@ namespace Espo\Core\Exceptions; class Forbidden extends \Exception { - protected $code = 403; + protected $code = 403; } diff --git a/application/Espo/Core/Exceptions/InternalServerError.php b/application/Espo/Core/Exceptions/InternalServerError.php index d3f0b80706..7a28a14b69 100644 --- a/application/Espo/Core/Exceptions/InternalServerError.php +++ b/application/Espo/Core/Exceptions/InternalServerError.php @@ -24,6 +24,6 @@ namespace Espo\Core\Exceptions; class InternalServerError extends \Exception { - protected $code = 500; + protected $code = 500; } diff --git a/application/Espo/Core/Exceptions/NotFound.php b/application/Espo/Core/Exceptions/NotFound.php index 4371ca19e6..836f774be9 100644 --- a/application/Espo/Core/Exceptions/NotFound.php +++ b/application/Espo/Core/Exceptions/NotFound.php @@ -24,7 +24,7 @@ namespace Espo\Core\Exceptions; class NotFound extends \Exception { - protected $code = 404; + protected $code = 404; } diff --git a/application/Espo/Core/Exceptions/Unauthorized.php b/application/Espo/Core/Exceptions/Unauthorized.php index 6c8b403ebc..99b784657c 100644 --- a/application/Espo/Core/Exceptions/Unauthorized.php +++ b/application/Espo/Core/Exceptions/Unauthorized.php @@ -24,7 +24,7 @@ namespace Espo\Core\Exceptions; class Unauthorized extends \Exception { - protected $code = 401; + protected $code = 401; } diff --git a/application/Espo/Core/ExtensionManager.php b/application/Espo/Core/ExtensionManager.php index d9b848c0ed..ce01895275 100644 --- a/application/Espo/Core/ExtensionManager.php +++ b/application/Espo/Core/ExtensionManager.php @@ -24,18 +24,18 @@ namespace Espo\Core; class ExtensionManager extends Upgrades\Base { - protected $name = 'Extension'; + protected $name = 'Extension'; - protected $params = array( - 'packagePath' => 'data/upload/extensions', + protected $params = array( + 'packagePath' => 'data/upload/extensions', - 'backupPath' => 'data/.backup/extensions', + 'backupPath' => 'data/.backup/extensions', - 'scriptNames' => array( - 'before' => 'BeforeInstall', - 'after' => 'AfterInstall', - 'beforeUninstall' => 'BeforeUninstall', - 'afterUninstall' => 'AfterUninstall', - ) - ); + 'scriptNames' => array( + 'before' => 'BeforeInstall', + 'after' => 'AfterInstall', + 'beforeUninstall' => 'BeforeUninstall', + 'afterUninstall' => 'AfterUninstall', + ) + ); } diff --git a/application/Espo/Core/ExternalAccount/ClientManager.php b/application/Espo/Core/ExternalAccount/ClientManager.php index 7d5dcd59bb..7f5ef2a55f 100644 --- a/application/Espo/Core/ExternalAccount/ClientManager.php +++ b/application/Espo/Core/ExternalAccount/ClientManager.php @@ -28,98 +28,98 @@ use \Espo\Core\Exceptions\NotFound; class ClientManager { - protected $entityManager; - - protected $metadata; - - protected $clientMap = array(); - - public function __construct($entityManager, $metadata, $config) - { - $this->entityManager = $entityManager; - $this->metadata = $metadata; - $this->config = $config; - } - - protected function getMetadata() - { - return $this->metadata; - } - - protected function getEntityManager() - { - return $this->entityManager; - } - - protected function getConfig() - { - return $this->config; - } - - public function storeAccessToken($hash, $data) - { - if (!empty($this->clientMap[$hash]) && !empty($this->clientMap[$hash]['externalAccountEntity'])) { - $externalAccountEntity = $this->clientMap[$hash]['externalAccountEntity']; - $externalAccountEntity->set('accessToken', $data['accessToken']); - $externalAccountEntity->set('tokenType', $data['tokenType']); - $this->getEntityManager()->saveEntity($externalAccountEntity); - } - } - - public function create($integration, $userId) - { - $authMethod = $this->getMetadata()->get("integrations.{$integration}.authMethod"); - $methodName = 'create' . ucfirst($authMethod); - return $this->$methodName($integration, $userId); - } - - protected function createOAuth2($integration, $userId) - { - $integrationEntity = $this->getEntityManager()->getEntity('Integration', $integration); - $externalAccountEntity = $this->getEntityManager()->getEntity('ExternalAccount', $integration . '__' . $userId); - - $className = $this->getMetadata()->get("integrations.{$integration}.clientClassName"); - - $redirectUri = $this->getConfig()->get('siteUrl') . '/oauthcallback'; // TODO move to client class - - if (!$externalAccountEntity) { - throw new Error("External Account {$integration} not found for {$userId}"); - } - - if (!$integrationEntity->get('enabled')) { - return null; - } - if (!$externalAccountEntity->get('enabled')) { - return null; - } - - $oauth2Client = new \Espo\Core\ExternalAccount\OAuth2\Client(); - - $client = new $className($oauth2Client, array( - 'endpoint' => $this->getMetadata()->get("integrations.{$integration}.params.endpoint"), - 'tokenEndpoint' => $this->getMetadata()->get("integrations.{$integration}.params.tokenEndpoint"), - 'clientId' => $integrationEntity->get('clientId'), - 'clientSecret' => $integrationEntity->get('clientSecret'), - 'redirectUri' => $redirectUri, - 'accessToken' => $externalAccountEntity->get('accessToken'), - 'refreshToken' => $externalAccountEntity->get('refreshToken'), - 'tokenType' => $externalAccountEntity->get('tokenType'), - ), $this); - - $this->addToClientMap($client, $integrationEntity, $externalAccountEntity, $userId); - - return $client; - } - - protected function addToClientMap($client, $integrationEntity, $externalAccountEntity, $userId) - { - $this->clientMap[spl_object_hash($client)] = array( - 'client' => $client, - 'userId' => $userId, - 'integration' => $integrationEntity->id, - 'integrationEntity' => $integrationEntity, - 'externalAccountEntity' => $externalAccountEntity, - ); - } + protected $entityManager; + + protected $metadata; + + protected $clientMap = array(); + + public function __construct($entityManager, $metadata, $config) + { + $this->entityManager = $entityManager; + $this->metadata = $metadata; + $this->config = $config; + } + + protected function getMetadata() + { + return $this->metadata; + } + + protected function getEntityManager() + { + return $this->entityManager; + } + + protected function getConfig() + { + return $this->config; + } + + public function storeAccessToken($hash, $data) + { + if (!empty($this->clientMap[$hash]) && !empty($this->clientMap[$hash]['externalAccountEntity'])) { + $externalAccountEntity = $this->clientMap[$hash]['externalAccountEntity']; + $externalAccountEntity->set('accessToken', $data['accessToken']); + $externalAccountEntity->set('tokenType', $data['tokenType']); + $this->getEntityManager()->saveEntity($externalAccountEntity); + } + } + + public function create($integration, $userId) + { + $authMethod = $this->getMetadata()->get("integrations.{$integration}.authMethod"); + $methodName = 'create' . ucfirst($authMethod); + return $this->$methodName($integration, $userId); + } + + protected function createOAuth2($integration, $userId) + { + $integrationEntity = $this->getEntityManager()->getEntity('Integration', $integration); + $externalAccountEntity = $this->getEntityManager()->getEntity('ExternalAccount', $integration . '__' . $userId); + + $className = $this->getMetadata()->get("integrations.{$integration}.clientClassName"); + + $redirectUri = $this->getConfig()->get('siteUrl') . '/oauthcallback'; // TODO move to client class + + if (!$externalAccountEntity) { + throw new Error("External Account {$integration} not found for {$userId}"); + } + + if (!$integrationEntity->get('enabled')) { + return null; + } + if (!$externalAccountEntity->get('enabled')) { + return null; + } + + $oauth2Client = new \Espo\Core\ExternalAccount\OAuth2\Client(); + + $client = new $className($oauth2Client, array( + 'endpoint' => $this->getMetadata()->get("integrations.{$integration}.params.endpoint"), + 'tokenEndpoint' => $this->getMetadata()->get("integrations.{$integration}.params.tokenEndpoint"), + 'clientId' => $integrationEntity->get('clientId'), + 'clientSecret' => $integrationEntity->get('clientSecret'), + 'redirectUri' => $redirectUri, + 'accessToken' => $externalAccountEntity->get('accessToken'), + 'refreshToken' => $externalAccountEntity->get('refreshToken'), + 'tokenType' => $externalAccountEntity->get('tokenType'), + ), $this); + + $this->addToClientMap($client, $integrationEntity, $externalAccountEntity, $userId); + + return $client; + } + + protected function addToClientMap($client, $integrationEntity, $externalAccountEntity, $userId) + { + $this->clientMap[spl_object_hash($client)] = array( + 'client' => $client, + 'userId' => $userId, + 'integration' => $integrationEntity->id, + 'integrationEntity' => $integrationEntity, + 'externalAccountEntity' => $externalAccountEntity, + ); + } } diff --git a/application/Espo/Core/ExternalAccount/Clients/Google.php b/application/Espo/Core/ExternalAccount/Clients/Google.php index 089b5f5e31..e6713a2767 100644 --- a/application/Espo/Core/ExternalAccount/Clients/Google.php +++ b/application/Espo/Core/ExternalAccount/Clients/Google.php @@ -26,9 +26,9 @@ use \Espo\Core\Exceptions\Error; class Google extends OAuth2Abstract { - protected function getPingUrl() - { - return 'https://www.googleapis.com/calendar/v3/users/me/calendarList'; - } + protected function getPingUrl() + { + return 'https://www.googleapis.com/calendar/v3/users/me/calendarList'; + } } diff --git a/application/Espo/Core/ExternalAccount/Clients/IClient.php b/application/Espo/Core/ExternalAccount/Clients/IClient.php index 978d9835a3..37e31a6673 100644 --- a/application/Espo/Core/ExternalAccount/Clients/IClient.php +++ b/application/Espo/Core/ExternalAccount/Clients/IClient.php @@ -24,12 +24,12 @@ namespace Espo\Core\ExternalAccount\Clients; interface IClient { - public function getParam($name); - - public function setParam($name, $value); - - public function setParams(array $params); + public function getParam($name); + + public function setParam($name, $value); + + public function setParams(array $params); - public function ping(); + public function ping(); } diff --git a/application/Espo/Core/ExternalAccount/Clients/OAuth2Abstract.php b/application/Espo/Core/ExternalAccount/Clients/OAuth2Abstract.php index de0a7e837e..76f79fceff 100644 --- a/application/Espo/Core/ExternalAccount/Clients/OAuth2Abstract.php +++ b/application/Espo/Core/ExternalAccount/Clients/OAuth2Abstract.php @@ -28,182 +28,182 @@ use \Espo\Core\ExternalAccount\OAuth2\Client; abstract class OAuth2Abstract implements IClient { - protected $client = null; - - protected $manager = null; - - protected $paramList = array( - 'endpoint', - 'tokenEndpoint', - 'clientId', - 'clientSecret', - 'tokenType', - 'accessToken', - 'refreshToken', - 'redirectUri', - ); - - protected $clientId = null; - - protected $clientSecret = null; - - protected $accessToken = null; - - protected $refreshToken = null; - - protected $redirectUri = null; - - public function __construct($client, array $params = array(), $manager = null) - { - $this->client = $client; + protected $client = null; + + protected $manager = null; + + protected $paramList = array( + 'endpoint', + 'tokenEndpoint', + 'clientId', + 'clientSecret', + 'tokenType', + 'accessToken', + 'refreshToken', + 'redirectUri', + ); + + protected $clientId = null; + + protected $clientSecret = null; + + protected $accessToken = null; + + protected $refreshToken = null; + + protected $redirectUri = null; + + public function __construct($client, array $params = array(), $manager = null) + { + $this->client = $client; - $this->setParams($params); - - $this->manager = $manager; - } - - public function getParam($name) - { - if (in_array($name, $this->paramList)) { - return $this->$name; - } - } - - public function setParam($name, $value) - { - if (in_array($name, $this->paramList)) { - $methodName = 'set' . ucfirst($name); - if (method_exists($this->client, $methodName)) { - $this->client->$methodName($value); - } - $this->$name = $value; - } - } - - public function setParams(array $params) - { - foreach ($this->paramList as $name) { - if (!empty($params[$name])) { - $this->setParam($name, $params[$name]); - } - } - } - - protected function afterTokenRefreshed($data) - { - if ($this->manager) { - $this->manager->storeAccessToken(spl_object_hash($this), $data); - } - } - - public function getAccessTokenFromAuthorizationCode($code) - { - $r = $this->client->getAccessToken($this->getParam('tokenEndpoint'), Client::GRANT_TYPE_AUTHORIZATION_CODE, array( - 'code' => $code, - 'redirect_uri' => $this->getParam('redirectUri') - )); - - - if ($r['code'] == 200) { - $data = array(); - if (!empty($r['result'])) { - $data['accessToken'] = $r['result']['access_token']; - $data['tokenType'] = $r['result']['token_type']; - $data['refreshToken'] = $r['result']['refresh_token']; - } - return $data; - } - return null; - } - - abstract protected function getPingUrl(); - - public function ping() - { - if (empty($this->accessToken) || empty($this->clientId) || empty($this->clientSecret)) { - return false; - } - - $url = $this->getPingUrl(); + $this->setParams($params); + + $this->manager = $manager; + } + + public function getParam($name) + { + if (in_array($name, $this->paramList)) { + return $this->$name; + } + } + + public function setParam($name, $value) + { + if (in_array($name, $this->paramList)) { + $methodName = 'set' . ucfirst($name); + if (method_exists($this->client, $methodName)) { + $this->client->$methodName($value); + } + $this->$name = $value; + } + } + + public function setParams(array $params) + { + foreach ($this->paramList as $name) { + if (!empty($params[$name])) { + $this->setParam($name, $params[$name]); + } + } + } + + protected function afterTokenRefreshed($data) + { + if ($this->manager) { + $this->manager->storeAccessToken(spl_object_hash($this), $data); + } + } + + public function getAccessTokenFromAuthorizationCode($code) + { + $r = $this->client->getAccessToken($this->getParam('tokenEndpoint'), Client::GRANT_TYPE_AUTHORIZATION_CODE, array( + 'code' => $code, + 'redirect_uri' => $this->getParam('redirectUri') + )); + + + if ($r['code'] == 200) { + $data = array(); + if (!empty($r['result'])) { + $data['accessToken'] = $r['result']['access_token']; + $data['tokenType'] = $r['result']['token_type']; + $data['refreshToken'] = $r['result']['refresh_token']; + } + return $data; + } + return null; + } + + abstract protected function getPingUrl(); + + public function ping() + { + if (empty($this->accessToken) || empty($this->clientId) || empty($this->clientSecret)) { + return false; + } + + $url = $this->getPingUrl(); - try { - $this->request($url); - return true; - } catch (\Exception $e) { - return false; - } - } - - public function request($url, $params = array(), $httpMethod = Client::HTTP_METHOD_GET, $allowRenew = true) - { - $r = $this->client->request($url, $params, $httpMethod); - - $code = null; - if (!empty($r['code'])) { - $code = $r['code']; - } - - if ($code == 200) { - return $r['result']; - } else { - $handledData = $this->handleErrorResponse($r); - - if ($allowRenew && is_array($handledData)) { - if ($handledData['action'] == 'refreshToken') { - if ($this->refreshToken()) { - return $this->request($url, $params, $httpMethod, false); - } - } else if ($handledData['action'] == 'renew') { - return $this->request($url, $params, $httpMethod, false); - } - } - } - - throw new Error("Error after requesting {$httpMethod} {$url}.", $code); - } - - protected function refreshToken() - { - if (!empty($this->refreshToken)) { - $r = $this->client->getAccessToken($this->getParam('tokenEndpoint'), Client::GRANT_TYPE_REFRESH_TOKEN, array( - 'refresh_token' => $this->refreshToken, - )); - if ($r['code'] == 200) { - if (is_array($r['result'])) { - if (!empty($r['result']['access_token'])) { - $data = array(); - $data['accessToken'] = $r['result']['access_token']; - $data['tokenType'] = $r['result']['token_type']; + try { + $this->request($url); + return true; + } catch (\Exception $e) { + return false; + } + } + + public function request($url, $params = array(), $httpMethod = Client::HTTP_METHOD_GET, $allowRenew = true) + { + $r = $this->client->request($url, $params, $httpMethod); + + $code = null; + if (!empty($r['code'])) { + $code = $r['code']; + } + + if ($code == 200) { + return $r['result']; + } else { + $handledData = $this->handleErrorResponse($r); + + if ($allowRenew && is_array($handledData)) { + if ($handledData['action'] == 'refreshToken') { + if ($this->refreshToken()) { + return $this->request($url, $params, $httpMethod, false); + } + } else if ($handledData['action'] == 'renew') { + return $this->request($url, $params, $httpMethod, false); + } + } + } + + throw new Error("Error after requesting {$httpMethod} {$url}.", $code); + } + + protected function refreshToken() + { + if (!empty($this->refreshToken)) { + $r = $this->client->getAccessToken($this->getParam('tokenEndpoint'), Client::GRANT_TYPE_REFRESH_TOKEN, array( + 'refresh_token' => $this->refreshToken, + )); + if ($r['code'] == 200) { + if (is_array($r['result'])) { + if (!empty($r['result']['access_token'])) { + $data = array(); + $data['accessToken'] = $r['result']['access_token']; + $data['tokenType'] = $r['result']['token_type']; - $this->setParams($data); - $this->afterTokenRefreshed($data); - return true; - } - } - } - } - } - - protected function handleErrorResponse($r) - { - if ($r['code'] == 401 && !empty($r['result'])) { - $result = $r['result']; - if (strpos($r['header'], 'error=invalid_token') !== false) { - return array( - 'action' => 'refreshToken' - ); - } else { - return array( - 'action' => 'renew' - ); - } - } else if ($r['code'] == 400 && !empty($r['result'])) { - if ($r['result']['error'] == 'invalid_token') { - return array( - 'action' => 'refreshToken' - ); - } - } - } + $this->setParams($data); + $this->afterTokenRefreshed($data); + return true; + } + } + } + } + } + + protected function handleErrorResponse($r) + { + if ($r['code'] == 401 && !empty($r['result'])) { + $result = $r['result']; + if (strpos($r['header'], 'error=invalid_token') !== false) { + return array( + 'action' => 'refreshToken' + ); + } else { + return array( + 'action' => 'renew' + ); + } + } else if ($r['code'] == 400 && !empty($r['result'])) { + if ($r['result']['error'] == 'invalid_token') { + return array( + 'action' => 'refreshToken' + ); + } + } + } } diff --git a/application/Espo/Core/ExternalAccount/OAuth2/Client.php b/application/Espo/Core/ExternalAccount/OAuth2/Client.php index dea4caf0a8..b96c2a42a0 100644 --- a/application/Espo/Core/ExternalAccount/OAuth2/Client.php +++ b/application/Espo/Core/ExternalAccount/OAuth2/Client.php @@ -24,225 +24,225 @@ namespace Espo\Core\ExternalAccount\OAuth2; class Client { - const AUTH_TYPE_URI = 0; - const AUTH_TYPE_AUTHORIZATION_BASIC = 1; - const AUTH_TYPE_FORM = 2; + const AUTH_TYPE_URI = 0; + const AUTH_TYPE_AUTHORIZATION_BASIC = 1; + const AUTH_TYPE_FORM = 2; - const TOKEN_TYPE_URI = 'Uri'; - const TOKEN_TYPE_BEARER = 'Bearer'; - const TOKEN_TYPE_OAUTH = 'OAuth'; + const TOKEN_TYPE_URI = 'Uri'; + const TOKEN_TYPE_BEARER = 'Bearer'; + const TOKEN_TYPE_OAUTH = 'OAuth'; - const CONTENT_TYPE_APPLICATION = 0; - const CONTENT_TYPE_MULTIPART = 1; + const CONTENT_TYPE_APPLICATION = 0; + const CONTENT_TYPE_MULTIPART = 1; - const HTTP_METHOD_GET = 'GET'; - const HTTP_METHOD_POST = 'POST'; - const HTTP_METHOD_PUT = 'PUT'; + const HTTP_METHOD_GET = 'GET'; + const HTTP_METHOD_POST = 'POST'; + const HTTP_METHOD_PUT = 'PUT'; - const HTTP_METHOD_DELETE = 'DELETE'; - const HTTP_METHOD_HEAD = 'HEAD'; - const HTTP_METHOD_PATCH = 'PATCH'; + const HTTP_METHOD_DELETE = 'DELETE'; + const HTTP_METHOD_HEAD = 'HEAD'; + const HTTP_METHOD_PATCH = 'PATCH'; - const GRANT_TYPE_AUTHORIZATION_CODE = 'authorization_code'; - const GRANT_TYPE_REFRESH_TOKEN = 'refresh_token'; - const GRANT_TYPE_PASSWORD = 'password'; - const GRANT_TYPE_CLIENT_CREDENTIALS = 'client_credentials'; + const GRANT_TYPE_AUTHORIZATION_CODE = 'authorization_code'; + const GRANT_TYPE_REFRESH_TOKEN = 'refresh_token'; + const GRANT_TYPE_PASSWORD = 'password'; + const GRANT_TYPE_CLIENT_CREDENTIALS = 'client_credentials'; - protected $clientId = null; + protected $clientId = null; - protected $clientSecret = null; + protected $clientSecret = null; - protected $accessToken = null; + protected $accessToken = null; - protected $authType = self::AUTH_TYPE_URI; + protected $authType = self::AUTH_TYPE_URI; - protected $tokenType = self::TOKEN_TYPE_URI; + protected $tokenType = self::TOKEN_TYPE_URI; - protected $accessTokenSecret = null; + protected $accessTokenSecret = null; - protected $accessTokenParamName = 'access_token'; + protected $accessTokenParamName = 'access_token'; - protected $certificateFile = null; + protected $certificateFile = null; - protected $curlOptions = array(); + protected $curlOptions = array(); - public function __construct(array $params = array()) - { - if (!extension_loaded('curl')) { - throw new \Exception('CURL extension not found.'); - } - } + public function __construct(array $params = array()) + { + if (!extension_loaded('curl')) { + throw new \Exception('CURL extension not found.'); + } + } - public function setClientId($clientId) - { - $this->clientId = $clientId; - } + public function setClientId($clientId) + { + $this->clientId = $clientId; + } - public function setClientSecret($clientSecret) - { - $this->clientSecret = $clientSecret; - } + public function setClientSecret($clientSecret) + { + $this->clientSecret = $clientSecret; + } - public function setAccessToken($accessToken) - { - $this->accessToken = $accessToken; - } + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + } - public function setAuthType($authType) - { - $this->authType = $authType; - } + public function setAuthType($authType) + { + $this->authType = $authType; + } - public function setCertificateFile($certificateFile) - { - $this->certificateFile = $certificateFile; - } + public function setCertificateFile($certificateFile) + { + $this->certificateFile = $certificateFile; + } - public function setCurlOption($option, $value) - { - $this->curlOptions[$option] = $value; - } + public function setCurlOption($option, $value) + { + $this->curlOptions[$option] = $value; + } - public function setCurlOptions($options) - { - $this->curlOptions = array_merge($this->curlOptions, $options); - } + public function setCurlOptions($options) + { + $this->curlOptions = array_merge($this->curlOptions, $options); + } - public function setTokenType($tokenType) - { - $this->tokenType = $tokenType; - } + public function setTokenType($tokenType) + { + $this->tokenType = $tokenType; + } - public function setAccessTokenSecret($accessTokenSecret) - { - $this->accessTokenSecret = $accessTokenSecret; - } + public function setAccessTokenSecret($accessTokenSecret) + { + $this->accessTokenSecret = $accessTokenSecret; + } - public function request($url, $params = array(), $httpMethod = self::HTTP_METHOD_GET, array $httpHeaders = array(), $contentType = self::CONTENT_TYPE_MULTIPART) - { - if ($this->accessToken) { - switch ($this->tokenType) { - case self::TOKEN_TYPE_URI: - $params[$this->accessTokenParamName] = $this->accessToken; - break; - case self::TOKEN_TYPE_BEARER: - $httpHeaders['Authorization'] = 'Bearer ' . $this->accessToken; - break; - case self::TOKEN_TYPE_OAUTH: - $httpHeaders['Authorization'] = 'OAuth ' . $this->accessToken; - break; - default: - throw new \Exception('Unknown access token type.'); + public function request($url, $params = array(), $httpMethod = self::HTTP_METHOD_GET, array $httpHeaders = array(), $contentType = self::CONTENT_TYPE_MULTIPART) + { + if ($this->accessToken) { + switch ($this->tokenType) { + case self::TOKEN_TYPE_URI: + $params[$this->accessTokenParamName] = $this->accessToken; + break; + case self::TOKEN_TYPE_BEARER: + $httpHeaders['Authorization'] = 'Bearer ' . $this->accessToken; + break; + case self::TOKEN_TYPE_OAUTH: + $httpHeaders['Authorization'] = 'OAuth ' . $this->accessToken; + break; + default: + throw new \Exception('Unknown access token type.'); - } - } + } + } - return $this->execute($url, $params, $httpMethod, $httpHeaders, $contentType); - } + return $this->execute($url, $params, $httpMethod, $httpHeaders, $contentType); + } - private function execute($url, $params = array(), $httpMethod, array $httpHeaders = array(), $contentType = self::CONTENT_TYPE_MULTIPART) - { - $curlOptions = array( - CURLOPT_RETURNTRANSFER => true, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_CUSTOMREQUEST => $httpMethod - ); + private function execute($url, $params = array(), $httpMethod, array $httpHeaders = array(), $contentType = self::CONTENT_TYPE_MULTIPART) + { + $curlOptions = array( + CURLOPT_RETURNTRANSFER => true, + CURLOPT_SSL_VERIFYPEER => true, + CURLOPT_CUSTOMREQUEST => $httpMethod + ); - switch ($httpMethod) { - case self::HTTP_METHOD_POST: - $curlOptions[CURLOPT_POST] = true; - case self::HTTP_METHOD_PUT: - case self::HTTP_METHOD_PATCH: - if (self::CONTENT_TYPE_APPLICATION === $contentType) { - $postFields = http_build_query($params, null, '&'); - } - $curlOptions[CURLOPT_POSTFIELDS] = $postFields; - break; - case self::HTTP_METHOD_HEAD: - $curlOptions[CURLOPT_NOBODY] = true; - case self::HTTP_METHOD_DELETE: - case self::HTTP_METHOD_GET: - if (strpos($url, '?') === false) { - $url .= '?'; - } - $url .= http_build_query($params, null, '&'); - break; - default: - break; - } + switch ($httpMethod) { + case self::HTTP_METHOD_POST: + $curlOptions[CURLOPT_POST] = true; + case self::HTTP_METHOD_PUT: + case self::HTTP_METHOD_PATCH: + if (self::CONTENT_TYPE_APPLICATION === $contentType) { + $postFields = http_build_query($params, null, '&'); + } + $curlOptions[CURLOPT_POSTFIELDS] = $postFields; + break; + case self::HTTP_METHOD_HEAD: + $curlOptions[CURLOPT_NOBODY] = true; + case self::HTTP_METHOD_DELETE: + case self::HTTP_METHOD_GET: + if (strpos($url, '?') === false) { + $url .= '?'; + } + $url .= http_build_query($params, null, '&'); + break; + default: + break; + } - $curlOptions[CURLOPT_URL] = $url; + $curlOptions[CURLOPT_URL] = $url; - $curlOptHttpHeader = array(); - foreach ($httpHeaders as $key => $value) { - $curlOptHttpHeader[] = "{$key}: {$value}"; - } - $curlOptions[CURLOPT_HTTPHEADER] = $curlOptHttpHeader; + $curlOptHttpHeader = array(); + foreach ($httpHeaders as $key => $value) { + $curlOptHttpHeader[] = "{$key}: {$value}"; + } + $curlOptions[CURLOPT_HTTPHEADER] = $curlOptHttpHeader; - $ch = curl_init(); - curl_setopt_array($ch, $curlOptions); + $ch = curl_init(); + curl_setopt_array($ch, $curlOptions); - curl_setopt($ch, CURLOPT_HEADER, 1); + curl_setopt($ch, CURLOPT_HEADER, 1); - if (!empty($this->certificateFile)) { - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($ch, CURLOPT_CAINFO, $this->certificateFile); - } else { - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); - } + if (!empty($this->certificateFile)) { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + curl_setopt($ch, CURLOPT_CAINFO, $this->certificateFile); + } else { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); + } - if (!empty($this->curlOptions)) { - curl_setopt_array($ch, $this->curlOptions); - } + if (!empty($this->curlOptions)) { + curl_setopt_array($ch, $this->curlOptions); + } - $response = curl_exec($ch); + $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); - $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); + $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); - $responceHeader = substr($response, 0, $headerSize); - $responceBody = substr($response, $headerSize); + $responceHeader = substr($response, 0, $headerSize); + $responceBody = substr($response, $headerSize); - $resultArray = null; + $resultArray = null; - if ($curlError = curl_error($ch)) { - throw new \Exception($curlError); - } else { - $resultArray = json_decode($responceBody, true); - } - curl_close($ch); + if ($curlError = curl_error($ch)) { + throw new \Exception($curlError); + } else { + $resultArray = json_decode($responceBody, true); + } + curl_close($ch); - return array( - 'result' => (null !== $resultArray) ? $resultArray: $responceBody, - 'code' => intval($httpCode), - 'contentType' => $contentType, - 'header' => $responceHeader, - ); - } + return array( + 'result' => (null !== $resultArray) ? $resultArray: $responceBody, + 'code' => intval($httpCode), + 'contentType' => $contentType, + 'header' => $responceHeader, + ); + } - public function getAccessToken($url, $grantType, array $params) - { - $params['grant_type'] = $grantType; + public function getAccessToken($url, $grantType, array $params) + { + $params['grant_type'] = $grantType; - $httpHeaders = array(); - switch ($this->clientAuth) { - case self::AUTH_TYPE_URI: - case self::AUTH_TYPE_FORM: - $params['client_id'] = $this->clientId; - $params['client_secret'] = $this->clientSecret; - break; - case self::AUTH_TYPE_AUTHORIZATION_BASIC: - $params['client_id'] = $this->clientId; - $httpHeaders['Authorization'] = 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret); - break; - default: - throw new \Exception(); - } + $httpHeaders = array(); + switch ($this->clientAuth) { + case self::AUTH_TYPE_URI: + case self::AUTH_TYPE_FORM: + $params['client_id'] = $this->clientId; + $params['client_secret'] = $this->clientSecret; + break; + case self::AUTH_TYPE_AUTHORIZATION_BASIC: + $params['client_id'] = $this->clientId; + $httpHeaders['Authorization'] = 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret); + break; + default: + throw new \Exception(); + } - return $this->execute($url, $params, self::HTTP_METHOD_POST, $httpHeaders, self::CONTENT_TYPE_APPLICATION); - } + return $this->execute($url, $params, self::HTTP_METHOD_POST, $httpHeaders, self::CONTENT_TYPE_APPLICATION); + } } diff --git a/application/Espo/Core/HookManager.php b/application/Espo/Core/HookManager.php index 2e1073376d..f7c6c65dc4 100644 --- a/application/Espo/Core/HookManager.php +++ b/application/Espo/Core/HookManager.php @@ -23,162 +23,162 @@ namespace Espo\Core; use \Espo\Core\Exceptions\Error, - \Espo\Core\Utils\Util; + \Espo\Core\Utils\Util; class HookManager { - private $container; + private $container; - private $data; + private $data; - private $hooks; + private $hooks; - protected $cacheFile = 'data/cache/application/hooks.php'; + protected $cacheFile = 'data/cache/application/hooks.php'; - /** + /** * List of defined hooks * * @var array */ - protected $hookList = array( - 'beforeSave', - 'afterSave', - 'beforeRemove', - 'afterRemove', - ); + protected $hookList = array( + 'beforeSave', + 'afterSave', + 'beforeRemove', + 'afterRemove', + ); - protected $paths = array( - 'corePath' => 'application/Espo/Hooks', - 'modulePath' => 'application/Espo/Modules/{*}/Hooks', - 'customPath' => 'custom/Espo/Custom/Hooks', - ); + protected $paths = array( + 'corePath' => 'application/Espo/Hooks', + 'modulePath' => 'application/Espo/Modules/{*}/Hooks', + 'customPath' => 'custom/Espo/Custom/Hooks', + ); public function __construct(Container $container) { - $this->container = $container; - $this->loadHooks(); + $this->container = $container; + $this->loadHooks(); } protected function getConfig() { - return $this->container->get('config'); + return $this->container->get('config'); } - protected function getFileManager() - { - return $this->container->get('fileManager'); - } + protected function getFileManager() + { + return $this->container->get('fileManager'); + } protected function loadHooks() { - if ($this->getConfig()->get('useCache') && file_exists($this->cacheFile)) { - $this->data = $this->getFileManager()->getContents($this->cacheFile); - return; - } + if ($this->getConfig()->get('useCache') && file_exists($this->cacheFile)) { + $this->data = $this->getFileManager()->getContents($this->cacheFile); + return; + } - $metadata = $this->container->get('metadata'); + $metadata = $this->container->get('metadata'); - $this->data = $this->getHookData($this->paths['corePath']); + $this->data = $this->getHookData($this->paths['corePath']); - foreach ($metadata->getModuleList() as $moduleName) { - $modulePath = str_replace('{*}', $moduleName, $this->paths['modulePath']); - $this->data = array_merge($this->data, $this->getHookData($modulePath)); - } + foreach ($metadata->getModuleList() as $moduleName) { + $modulePath = str_replace('{*}', $moduleName, $this->paths['modulePath']); + $this->data = array_merge($this->data, $this->getHookData($modulePath)); + } - $this->data = array_merge($this->data, $this->getHookData($this->paths['customPath'])); + $this->data = array_merge($this->data, $this->getHookData($this->paths['customPath'])); - if ($this->getConfig()->get('useCache')) { - $this->getFileManager()->putContentsPHP($this->cacheFile, $this->data); - } + if ($this->getConfig()->get('useCache')) { + $this->getFileManager()->putContentsPHP($this->cacheFile, $this->data); + } } public function process($scope, $hookName, $injection = null) { - if ($scope != 'Common') { - $this->process('Common', $hookName, $injection); - } + if ($scope != 'Common') { + $this->process('Common', $hookName, $injection); + } - if (!empty($this->data[$scope])) { - if (!empty($this->data[$scope][$hookName])) { - foreach ($this->data[$scope][$hookName] as $className) { - if (empty($this->hooks[$className])) { - $this->hooks[$className] = $this->createHookByClassName($className); - } - $hook = $this->hooks[$className]; - $hook->$hookName($injection); - } - } - } + if (!empty($this->data[$scope])) { + if (!empty($this->data[$scope][$hookName])) { + foreach ($this->data[$scope][$hookName] as $className) { + if (empty($this->hooks[$className])) { + $this->hooks[$className] = $this->createHookByClassName($className); + } + $hook = $this->hooks[$className]; + $hook->$hookName($injection); + } + } + } } - public function createHookByClassName($className) - { - if (class_exists($className)) { - $hook = new $className(); - $dependencies = $hook->getDependencyList(); - foreach ($dependencies as $name) { - $hook->inject($name, $this->container->get($name)); - } - return $hook; - } - throw new Error("Class '$className' does not exist"); - } + public function createHookByClassName($className) + { + if (class_exists($className)) { + $hook = new $className(); + $dependencies = $hook->getDependencyList(); + foreach ($dependencies as $name) { + $hook->inject($name, $this->container->get($name)); + } + return $hook; + } + throw new Error("Class '$className' does not exist"); + } /** * Get and merge hook data by checking the files exist in $hookDirs - * - * @param array $hookDirs - it can be an array('Espo/Hooks', 'Espo/Custom/Hooks', 'Espo/Modules/Crm/Hooks') - * - * @return array - */ - protected function getHookData($hookDirs) - { - if (is_string($hookDirs)) { - $hookDirs = (array) $hookDirs; - } + * + * @param array $hookDirs - it can be an array('Espo/Hooks', 'Espo/Custom/Hooks', 'Espo/Modules/Crm/Hooks') + * + * @return array + */ + protected function getHookData($hookDirs) + { + if (is_string($hookDirs)) { + $hookDirs = (array) $hookDirs; + } - $hooks = array(); + $hooks = array(); - foreach ($hookDirs as $hookDir) { + foreach ($hookDirs as $hookDir) { - if (file_exists($hookDir)) { - $fileList = $this->getFileManager()->getFileList($hookDir, 1, '\.php$', 'file'); + if (file_exists($hookDir)) { + $fileList = $this->getFileManager()->getFileList($hookDir, 1, '\.php$', 'file'); - foreach ($fileList as $scopeName => $hookFiles) { + foreach ($fileList as $scopeName => $hookFiles) { - $hookScopeDirPath = Util::concatPath($hookDir, $scopeName); + $hookScopeDirPath = Util::concatPath($hookDir, $scopeName); - $scopeHooks = array(); - foreach($hookFiles as $hookFile) { - $hookFilePath = Util::concatPath($hookScopeDirPath, $hookFile); - $className = Util::getClassName($hookFilePath); + $scopeHooks = array(); + foreach($hookFiles as $hookFile) { + $hookFilePath = Util::concatPath($hookScopeDirPath, $hookFile); + $className = Util::getClassName($hookFilePath); - foreach($this->hookList as $hookName) { - if (method_exists($className, $hookName)) { - $scopeHooks[$hookName][$className::$order][] = $className; - } - } - } + foreach($this->hookList as $hookName) { + if (method_exists($className, $hookName)) { + $scopeHooks[$hookName][$className::$order][] = $className; + } + } + } - //sort hooks by order - foreach ($scopeHooks as $hookName => $hookList) { - ksort($hookList); + //sort hooks by order + foreach ($scopeHooks as $hookName => $hookList) { + ksort($hookList); - $sortedHookList = array(); - foreach($hookList as $hookDetails) { - $sortedHookList = array_merge($sortedHookList, $hookDetails); - } + $sortedHookList = array(); + foreach($hookList as $hookDetails) { + $sortedHookList = array_merge($sortedHookList, $hookDetails); + } $hooks[$scopeName][$hookName] = isset($hooks[$scopeName][$hookName]) ? array_merge($hooks[$scopeName][$hookName], $sortedHookList) : $sortedHookList; - } - } - } + } + } + } - } + } - return $hooks; - } + return $hooks; + } } diff --git a/application/Espo/Core/Hooks/Base.php b/application/Espo/Core/Hooks/Base.php index e3627788be..ae6baeb3c4 100644 --- a/application/Espo/Core/Hooks/Base.php +++ b/application/Espo/Core/Hooks/Base.php @@ -26,70 +26,70 @@ use \Espo\Core\Interfaces\Injectable; class Base implements Injectable { - protected $dependencies = array( - 'entityManager', - 'config', - 'metadata', - 'acl', - 'user', - ); + protected $dependencies = array( + 'entityManager', + 'config', + 'metadata', + 'acl', + 'user', + ); - protected $injections = array(); + protected $injections = array(); - public static $order = 9; + public static $order = 9; - public function __construct() - { - $this->init(); - } + public function __construct() + { + $this->init(); + } - protected function init() - { - } + protected function init() + { + } - public function getDependencyList() - { - return $this->dependencies; - } + public function getDependencyList() + { + return $this->dependencies; + } - protected function getInjection($name) - { - return $this->injections[$name]; - } + protected function getInjection($name) + { + return $this->injections[$name]; + } - public function inject($name, $object) - { - $this->injections[$name] = $object; - } + public function inject($name, $object) + { + $this->injections[$name] = $object; + } - protected function getEntityManager() - { - return $this->injections['entityManager']; - } + protected function getEntityManager() + { + return $this->injections['entityManager']; + } - protected function getUser() - { - return $this->injections['user']; - } + protected function getUser() + { + return $this->injections['user']; + } - protected function getAcl() - { - return $this->injections['acl']; - } + protected function getAcl() + { + return $this->injections['acl']; + } - protected function getConfig() - { - return $this->injections['config']; - } + protected function getConfig() + { + return $this->injections['config']; + } - protected function getMetadata() - { - return $this->injections['metadata']; - } + protected function getMetadata() + { + return $this->injections['metadata']; + } - protected function getRepository() - { - return $this->getEntityManager()->getRepository($this->entityName); - } + protected function getRepository() + { + return $this->getEntityManager()->getRepository($this->entityName); + } } diff --git a/application/Espo/Core/Interfaces/Injectable.php b/application/Espo/Core/Interfaces/Injectable.php index 9185de91d8..7ccae942e1 100644 --- a/application/Espo/Core/Interfaces/Injectable.php +++ b/application/Espo/Core/Interfaces/Injectable.php @@ -24,8 +24,8 @@ namespace Espo\Core\Interfaces; interface Injectable { - public function getDependencyList(); - - public function inject($name, $object); + public function getDependencyList(); + + public function inject($name, $object); } diff --git a/application/Espo/Core/Jobs/Base.php b/application/Espo/Core/Jobs/Base.php index 975dd5fa1d..9256cd997b 100644 --- a/application/Espo/Core/Jobs/Base.php +++ b/application/Espo/Core/Jobs/Base.php @@ -27,44 +27,44 @@ use \Espo\Core\Container; abstract class Base { - private $container; + private $container; - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - protected function getEntityManager() - { - return $this->getContainer()->get('entityManager'); - } + protected function getEntityManager() + { + return $this->getContainer()->get('entityManager'); + } - protected function getServiceFactory() - { - return $this->getContainer()->get('serviceFactory'); - } + protected function getServiceFactory() + { + return $this->getContainer()->get('serviceFactory'); + } - protected function getConfig() - { - return $this->getContainer()->get('config'); - } + protected function getConfig() + { + return $this->getContainer()->get('config'); + } - protected function getMetadata() - { - return $this->getContainer()->get('metadata'); - } + protected function getMetadata() + { + return $this->getContainer()->get('metadata'); + } - protected function getUser() - { - return $this->getContainer()->get('user'); - } + protected function getUser() + { + return $this->getContainer()->get('user'); + } - public function __construct(Container $container) - { - $this->container = $container; - } + public function __construct(Container $container) + { + $this->container = $container; + } - abstract public function run(); + abstract public function run(); } diff --git a/application/Espo/Core/Loaders/EntityManager.php b/application/Espo/Core/Loaders/EntityManager.php index 66e05872f0..e9ac2a7dab 100644 --- a/application/Espo/Core/Loaders/EntityManager.php +++ b/application/Espo/Core/Loaders/EntityManager.php @@ -27,38 +27,38 @@ use Doctrine\ORM\Tools\Setup, class EntityManager implements Loader { - private $container; + private $container; - public function __construct(\Espo\Core\Container $container) - { - $this->container = $container; - } + public function __construct(\Espo\Core\Container $container) + { + $this->container = $container; + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - public function load() - { - $config = $this->getContainer()->get('config'); + public function load() + { + $config = $this->getContainer()->get('config'); - $params = array( - 'host' => $config->get('database.host'), - 'port' => $config->get('database.port'), - 'dbname' => $config->get('database.dbname'), - 'user' => $config->get('database.user'), - 'password' => $config->get('database.password'), - 'metadata' => $this->getContainer()->get('metadata')->getOrmMetadata(), - 'repositoryFactoryClassName' => '\\Espo\\Core\\ORM\\RepositoryFactory', - ); + $params = array( + 'host' => $config->get('database.host'), + 'port' => $config->get('database.port'), + 'dbname' => $config->get('database.dbname'), + 'user' => $config->get('database.user'), + 'password' => $config->get('database.password'), + 'metadata' => $this->getContainer()->get('metadata')->getOrmMetadata(), + 'repositoryFactoryClassName' => '\\Espo\\Core\\ORM\\RepositoryFactory', + ); - $entityManager = new \Espo\Core\ORM\EntityManager($params); - $entityManager->setEspoMetadata($this->getContainer()->get('metadata')); - $entityManager->setHookManager($this->getContainer()->get('hookManager')); - $entityManager->setContainer($this->getContainer()); + $entityManager = new \Espo\Core\ORM\EntityManager($params); + $entityManager->setEspoMetadata($this->getContainer()->get('metadata')); + $entityManager->setHookManager($this->getContainer()->get('hookManager')); + $entityManager->setContainer($this->getContainer()); - return $entityManager; - } + return $entityManager; + } } diff --git a/application/Espo/Core/Loaders/Loader.php b/application/Espo/Core/Loaders/Loader.php index 971290c6a0..545defa809 100644 --- a/application/Espo/Core/Loaders/Loader.php +++ b/application/Espo/Core/Loaders/Loader.php @@ -25,7 +25,7 @@ namespace Espo\Core\Loaders; interface Loader { - public function load(); + public function load(); } diff --git a/application/Espo/Core/Loaders/Log.php b/application/Espo/Core/Loaders/Log.php index 764eaad4ce..99ce5c08af 100644 --- a/application/Espo/Core/Loaders/Log.php +++ b/application/Espo/Core/Loaders/Log.php @@ -23,42 +23,42 @@ namespace Espo\Core\Loaders; use Espo\Core\Utils, - Espo\Core\Utils\Log\Monolog\Handler; + Espo\Core\Utils\Log\Monolog\Handler; class Log implements Loader { - private $container; + private $container; - public function __construct(\Espo\Core\Container $container) - { - $this->container = $container; - } + public function __construct(\Espo\Core\Container $container) + { + $this->container = $container; + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - public function load() - { - $logConfig = $this->getContainer()->get('config')->get('logger'); + public function load() + { + $logConfig = $this->getContainer()->get('config')->get('logger'); - $log = new Utils\Log('Espo'); + $log = new Utils\Log('Espo'); - $levelCode = $log->getLevelCode($logConfig['level']); + $levelCode = $log->getLevelCode($logConfig['level']); - if ($logConfig['isRotate']) { - $handler = new Handler\RotatingFileHandler($logConfig['path'], $logConfig['maxRotateFiles'], $levelCode); - } else { - $handler = new Handler\StreamHandler($logConfig['path'], $levelCode); - } - $log->pushHandler($handler); + if ($logConfig['isRotate']) { + $handler = new Handler\RotatingFileHandler($logConfig['path'], $logConfig['maxRotateFiles'], $levelCode); + } else { + $handler = new Handler\StreamHandler($logConfig['path'], $levelCode); + } + $log->pushHandler($handler); - $errorHandler = new \Monolog\ErrorHandler($log); - $errorHandler->registerExceptionHandler(null, false); - $errorHandler->registerErrorHandler(array(), false); + $errorHandler = new \Monolog\ErrorHandler($log); + $errorHandler->registerExceptionHandler(null, false); + $errorHandler->registerErrorHandler(array(), false); - return $log; - } + return $log; + } } diff --git a/application/Espo/Core/Mail/Importer.php b/application/Espo/Core/Mail/Importer.php index c8aa318ff2..ed338f9484 100644 --- a/application/Espo/Core/Mail/Importer.php +++ b/application/Espo/Core/Mail/Importer.php @@ -5,245 +5,245 @@ namespace Espo\Core\Mail; use \Zend\Mime\Mime as Mime; class Importer -{ - private $entityManager; - - private $fileManager; - - public function __construct($entityManager, $fileManager) - { - $this->entityManager = $entityManager; - $this->fileManager = $fileManager; - } - - protected function getEntityManager() - { - return $this->entityManager; - } - - protected function getFileManager() - { - return $this->fileManager; - } - - public function importMessage($message, $userId, $teamsIds = array()) - { - try { - $email = $this->getEntityManager()->getEntity('Email'); - - $subject = $message->subject; - if ($subject !== '0' && empty($subject)) { - $subject = '--empty--'; - } - - $email->set('isHtml', false); - $email->set('name', $subject); - $email->set('status', 'Archived'); - $email->set('attachmentsIds', array()); - $email->set('assignedUserId', $userId); - $email->set('teamsIds', $teamsIds); - - $fromArr = $this->getAddressListFromMessage($message, 'from'); - if (isset($message->from)) { - $email->set('fromName', $message->from); - } - $email->set('from', $fromArr[0]); - $email->set('to', implode(';', $this->getAddressListFromMessage($message, 'to'))); - $email->set('cc', implode(';', $this->getAddressListFromMessage($message, 'cc'))); - - if (isset($message->messageId) && !empty($message->messageId)) { - $email->set('messageId', $message->messageId); - if (isset($message->deliveredTo)) { - $email->set('messageIdInternal', $message->messageId . '-' . $message->deliveredTo); - } - } - - if ($this->checkIsDuplicate($email)) { - return false; - } +{ + private $entityManager; + + private $fileManager; + + public function __construct($entityManager, $fileManager) + { + $this->entityManager = $entityManager; + $this->fileManager = $fileManager; + } + + protected function getEntityManager() + { + return $this->entityManager; + } + + protected function getFileManager() + { + return $this->fileManager; + } + + public function importMessage($message, $userId, $teamsIds = array()) + { + try { + $email = $this->getEntityManager()->getEntity('Email'); + + $subject = $message->subject; + if ($subject !== '0' && empty($subject)) { + $subject = '--empty--'; + } + + $email->set('isHtml', false); + $email->set('name', $subject); + $email->set('status', 'Archived'); + $email->set('attachmentsIds', array()); + $email->set('assignedUserId', $userId); + $email->set('teamsIds', $teamsIds); + + $fromArr = $this->getAddressListFromMessage($message, 'from'); + if (isset($message->from)) { + $email->set('fromName', $message->from); + } + $email->set('from', $fromArr[0]); + $email->set('to', implode(';', $this->getAddressListFromMessage($message, 'to'))); + $email->set('cc', implode(';', $this->getAddressListFromMessage($message, 'cc'))); + + if (isset($message->messageId) && !empty($message->messageId)) { + $email->set('messageId', $message->messageId); + if (isset($message->deliveredTo)) { + $email->set('messageIdInternal', $message->messageId . '-' . $message->deliveredTo); + } + } + + if ($this->checkIsDuplicate($email)) { + return false; + } - if (isset($message->date)) { - $dt = new \DateTime($message->date); - if ($dt) { - $dateSent = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'); - $email->set('dateSent', $dateSent); - } - } - if (isset($message->deliveryDate)) { - $dt = new \DateTime($message->deliveryDate); - if ($dt) { - $deliveryDate = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'); - $email->set('deliveryDate', $deliveryDate); - } - } - - $inlineIds = array(); - - if ($message->isMultipart()) { - foreach (new \RecursiveIteratorIterator($message) as $part) { - $this->importPartDataToEmail($email, $part, $inlineIds); - } - } else { - $this->importPartDataToEmail($email, $message, $inlineIds); - } - - $body = $email->get('body'); - if (!empty($body)) { - foreach ($inlineIds as $cid => $attachmentId) { - $body = str_replace('cid:' . $cid, '?entryPoint=attachment&id=' . $attachmentId, $body); - } - $email->set('body', $body); - } + if (isset($message->date)) { + $dt = new \DateTime($message->date); + if ($dt) { + $dateSent = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'); + $email->set('dateSent', $dateSent); + } + } + if (isset($message->deliveryDate)) { + $dt = new \DateTime($message->deliveryDate); + if ($dt) { + $deliveryDate = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'); + $email->set('deliveryDate', $deliveryDate); + } + } + + $inlineIds = array(); + + if ($message->isMultipart()) { + foreach (new \RecursiveIteratorIterator($message) as $part) { + $this->importPartDataToEmail($email, $part, $inlineIds); + } + } else { + $this->importPartDataToEmail($email, $message, $inlineIds); + } + + $body = $email->get('body'); + if (!empty($body)) { + foreach ($inlineIds as $cid => $attachmentId) { + $body = str_replace('cid:' . $cid, '?entryPoint=attachment&id=' . $attachmentId, $body); + } + $email->set('body', $body); + } - $this->getEntityManager()->saveEntity($email); - - return $email; - - } catch (\Exception $e) {} - } - - protected function checkIsDuplicate($email) - { - if ($email->get('messageIdInternal')) { - $duplicate = $this->getEntityManager()->getRepository('Email')->where(array( - 'messageIdInternal' => $email->get('messageIdInternal') - ))->findOne(); - if ($duplicate) { - return true; - } - } - } - - protected function getAddressListFromMessage($message, $type) - { - $addressList = array(); - if (isset($message->$type)) { - - $list = $message->getHeader($type)->getAddressList(); - foreach ($list as $address) { - $addressList[] = $address->getEmail(); - } - } - return $addressList; - } - - protected function importPartDataToEmail(\Espo\Entities\Email $email, $part, &$inlineIds = array()) - { - try { - $type = strtok($part->contentType, ';'); - $encoding = null; - - switch ($type) { - case 'text/plain': - $content = $this->getContentFromPart($part); - if (!$email->get('body')) { - $email->set('body', $content); - } - $email->set('bodyPlain', $content); - break; - case 'text/html': - $content = $this->getContentFromPart($part); - $email->set('body', $content); - $email->set('isHtml', true); - break; - default: - $content = $part->getContent(); - $disposition = null; - - $fileName = null; - $contentId = null; - - if (isset($part->ContentDisposition)) { - if (strpos($part->ContentDisposition, 'attachment') === 0) { - if (preg_match('/filename="?([^"]+)"?/i', $part->ContentDisposition, $m)) { - $fileName = $m[1]; - $disposition = 'attachment'; - } - } else if (strpos($part->ContentDisposition, 'inline') === 0) { - $contentId = trim($part->contentID, '<>'); - $fileName = $contentId; - $disposition = 'inline'; - } - } - - if (isset($part->contentTransferEncoding)) { - $encoding = strtolower($part->getHeader('Content-Transfer-Encoding')->getTransferEncoding()); - } - - $attachment = $this->getEntityManager()->getEntity('Attachment'); - $attachment->set('name', $fileName); - $attachment->set('type', $type); - - if ($disposition == 'inline') { - $attachment->set('role', 'Inline Attachment'); - } else { - $attachment->set('role', 'Attachment'); - } - - if ($encoding == 'base64') { - $content = base64_decode($content); - } - - $attachment->set('size', strlen($content)); - - $this->getEntityManager()->saveEntity($attachment); - - $path = 'data/upload/' . $attachment->id; - $this->getFileManager()->putContents($path, $content); - - if ($disposition == 'attachment') { - $attachmentsIds = $email->get('attachmentsIds'); - $attachmentsIds[] = $attachment->id; - $email->set('attachmentsIds', $attachmentsIds); - } else if ($disposition == 'inline') { - $inlineIds[$contentId] = $attachment->id; - } - } - } catch (\Exception $e) {} - } - - protected function getContentFromPart($part) - { - if ($part instanceof \Zend\Mime\Part) { - $content = $part->getRawContent(); - if (strtolower($part->charset) != 'utf-8') { - $content = mb_convert_encoding($content, 'UTF-8', $part->charset); - } - } else { - $content = $part->getContent(); - - $encoding = null; - - if (isset($part->contentTransferEncoding)) { - $cteHeader = $part->getHeader('Content-Transfer-Encoding'); - $encoding = strtolower($cteHeader->getTransferEncoding()); - } - - if ($encoding == 'base64') { - $content = base64_decode($content); - } - - $charset = 'UTF-8'; - - if (isset($part->contentType)) { - $ctHeader = $part->getHeader('Content-Type'); - $charsetParamValue = $ctHeader->getParameter('charset'); - if (!empty($charsetParamValue)) { - $charset = strtoupper($charsetParamValue); - } - } - - if ($charset !== 'UTF-8') { - $content = mb_convert_encoding($content, 'UTF-8', $charset); - } - - if (isset($part->contentTransferEncoding)) { - $cteHeader = $part->getHeader('Content-Transfer-Encoding'); - if ($cteHeader->getTransferEncoding() == 'quoted-printable') { - $content = quoted_printable_decode($content); - } - } - } - return $content; - } + $this->getEntityManager()->saveEntity($email); + + return $email; + + } catch (\Exception $e) {} + } + + protected function checkIsDuplicate($email) + { + if ($email->get('messageIdInternal')) { + $duplicate = $this->getEntityManager()->getRepository('Email')->where(array( + 'messageIdInternal' => $email->get('messageIdInternal') + ))->findOne(); + if ($duplicate) { + return true; + } + } + } + + protected function getAddressListFromMessage($message, $type) + { + $addressList = array(); + if (isset($message->$type)) { + + $list = $message->getHeader($type)->getAddressList(); + foreach ($list as $address) { + $addressList[] = $address->getEmail(); + } + } + return $addressList; + } + + protected function importPartDataToEmail(\Espo\Entities\Email $email, $part, &$inlineIds = array()) + { + try { + $type = strtok($part->contentType, ';'); + $encoding = null; + + switch ($type) { + case 'text/plain': + $content = $this->getContentFromPart($part); + if (!$email->get('body')) { + $email->set('body', $content); + } + $email->set('bodyPlain', $content); + break; + case 'text/html': + $content = $this->getContentFromPart($part); + $email->set('body', $content); + $email->set('isHtml', true); + break; + default: + $content = $part->getContent(); + $disposition = null; + + $fileName = null; + $contentId = null; + + if (isset($part->ContentDisposition)) { + if (strpos($part->ContentDisposition, 'attachment') === 0) { + if (preg_match('/filename="?([^"]+)"?/i', $part->ContentDisposition, $m)) { + $fileName = $m[1]; + $disposition = 'attachment'; + } + } else if (strpos($part->ContentDisposition, 'inline') === 0) { + $contentId = trim($part->contentID, '<>'); + $fileName = $contentId; + $disposition = 'inline'; + } + } + + if (isset($part->contentTransferEncoding)) { + $encoding = strtolower($part->getHeader('Content-Transfer-Encoding')->getTransferEncoding()); + } + + $attachment = $this->getEntityManager()->getEntity('Attachment'); + $attachment->set('name', $fileName); + $attachment->set('type', $type); + + if ($disposition == 'inline') { + $attachment->set('role', 'Inline Attachment'); + } else { + $attachment->set('role', 'Attachment'); + } + + if ($encoding == 'base64') { + $content = base64_decode($content); + } + + $attachment->set('size', strlen($content)); + + $this->getEntityManager()->saveEntity($attachment); + + $path = 'data/upload/' . $attachment->id; + $this->getFileManager()->putContents($path, $content); + + if ($disposition == 'attachment') { + $attachmentsIds = $email->get('attachmentsIds'); + $attachmentsIds[] = $attachment->id; + $email->set('attachmentsIds', $attachmentsIds); + } else if ($disposition == 'inline') { + $inlineIds[$contentId] = $attachment->id; + } + } + } catch (\Exception $e) {} + } + + protected function getContentFromPart($part) + { + if ($part instanceof \Zend\Mime\Part) { + $content = $part->getRawContent(); + if (strtolower($part->charset) != 'utf-8') { + $content = mb_convert_encoding($content, 'UTF-8', $part->charset); + } + } else { + $content = $part->getContent(); + + $encoding = null; + + if (isset($part->contentTransferEncoding)) { + $cteHeader = $part->getHeader('Content-Transfer-Encoding'); + $encoding = strtolower($cteHeader->getTransferEncoding()); + } + + if ($encoding == 'base64') { + $content = base64_decode($content); + } + + $charset = 'UTF-8'; + + if (isset($part->contentType)) { + $ctHeader = $part->getHeader('Content-Type'); + $charsetParamValue = $ctHeader->getParameter('charset'); + if (!empty($charsetParamValue)) { + $charset = strtoupper($charsetParamValue); + } + } + + if ($charset !== 'UTF-8') { + $content = mb_convert_encoding($content, 'UTF-8', $charset); + } + + if (isset($part->contentTransferEncoding)) { + $cteHeader = $part->getHeader('Content-Transfer-Encoding'); + if ($cteHeader->getTransferEncoding() == 'quoted-printable') { + $content = quoted_printable_decode($content); + } + } + } + return $content; + } } diff --git a/application/Espo/Core/Mail/Sender.php b/application/Espo/Core/Mail/Sender.php index 777c97a595..0f110c90ad 100644 --- a/application/Espo/Core/Mail/Sender.php +++ b/application/Espo/Core/Mail/Sender.php @@ -36,239 +36,239 @@ use \Espo\Core\Exceptions\Error; class Sender { - protected $config; + protected $config; - protected $transport; + protected $transport; - protected $isGlobal = false; + protected $isGlobal = false; - protected $params = array(); + protected $params = array(); - public function __construct($config) - { - $this->config = $config; - $this->useGlobal(); - } + public function __construct($config) + { + $this->config = $config; + $this->useGlobal(); + } - public function resetParams() - { - $this->params = array(); - return $this; - } + public function resetParams() + { + $this->params = array(); + return $this; + } - public function setParams(array $params = array()) - { - $this->params = array_merge($this->params, $params); - return $this; - } + public function setParams(array $params = array()) + { + $this->params = array_merge($this->params, $params); + return $this; + } - public function useSmtp(array $params = array()) - { - $this->isGlobal = false; - $this->params = $params; + public function useSmtp(array $params = array()) + { + $this->isGlobal = false; + $this->params = $params; - $this->transport = new SmtpTransport(); + $this->transport = new SmtpTransport(); - $opts = array( - 'name' => 'admin', - 'host' => $params['server'], - 'port' => $params['port'], - 'connection_config' => array() - ); - if ($params['auth']) { - $opts['connection_class'] = 'login'; - $opts['connection_config']['username'] = $params['username']; - $opts['connection_config']['password'] = $params['password']; - } - if ($params['security']) { - $opts['connection_config']['ssl'] = strtolower($params['security']); - } + $opts = array( + 'name' => 'admin', + 'host' => $params['server'], + 'port' => $params['port'], + 'connection_config' => array() + ); + if ($params['auth']) { + $opts['connection_class'] = 'login'; + $opts['connection_config']['username'] = $params['username']; + $opts['connection_config']['password'] = $params['password']; + } + if ($params['security']) { + $opts['connection_config']['ssl'] = strtolower($params['security']); + } - $options = new SmtpOptions($opts); - $this->transport->setOptions($options); + $options = new SmtpOptions($opts); + $this->transport->setOptions($options); - return $this; - } + return $this; + } - public function useGlobal() - { - $this->params = array(); - if ($this->isGlobal) { - return $this; - } + public function useGlobal() + { + $this->params = array(); + if ($this->isGlobal) { + return $this; + } - $this->transport = new SmtpTransport(); + $this->transport = new SmtpTransport(); - $config = $this->config; + $config = $this->config; - $opts = array( - 'name' => 'admin', - 'host' => $config->get('smtpServer'), - 'port' => $config->get('smtpPort'), - 'connection_config' => array() - ); - if ($config->get('smtpAuth')) { - $opts['connection_class'] = 'login'; - $opts['connection_config']['username'] = $config->get('smtpUsername'); - $opts['connection_config']['password'] = $config->get('smtpPassword'); - } - if ($config->get('smtpSecurity')) { - $opts['connection_config']['ssl'] = strtolower($config->get('smtpSecurity')); - } + $opts = array( + 'name' => 'admin', + 'host' => $config->get('smtpServer'), + 'port' => $config->get('smtpPort'), + 'connection_config' => array() + ); + if ($config->get('smtpAuth')) { + $opts['connection_class'] = 'login'; + $opts['connection_config']['username'] = $config->get('smtpUsername'); + $opts['connection_config']['password'] = $config->get('smtpPassword'); + } + if ($config->get('smtpSecurity')) { + $opts['connection_config']['ssl'] = strtolower($config->get('smtpSecurity')); + } - $options = new SmtpOptions($opts); - $this->transport->setOptions($options); + $options = new SmtpOptions($opts); + $this->transport->setOptions($options); - $this->isGlobal = true; + $this->isGlobal = true; - return $this; - } + return $this; + } - public function send(Email $email, $params = array()) - { - $message = new Message(); + public function send(Email $email, $params = array()) + { + $message = new Message(); - $config = $this->config; - - $params = $this->params + $params; + $config = $this->config; + + $params = $this->params + $params; - if ($email->get('from')) { - $fromName = null; - if (!empty($params['fromName'])) { - $fromName = $params['fromName']; - } else { - $fromName = $config->get('outboundEmailFromName'); - } - $message->addFrom(trim($email->get('from')), $fromName); - } else { - if (!empty($params['fromAddress'])) { - $fromAddress = $params['fromAddress']; - } else { - if (!$config->get('outboundEmailFromAddress')) { - throw new Error('outboundEmailFromAddress is not specified in config.'); - } - $fromAddress = $config->get('outboundEmailFromAddress'); - } + if ($email->get('from')) { + $fromName = null; + if (!empty($params['fromName'])) { + $fromName = $params['fromName']; + } else { + $fromName = $config->get('outboundEmailFromName'); + } + $message->addFrom(trim($email->get('from')), $fromName); + } else { + if (!empty($params['fromAddress'])) { + $fromAddress = $params['fromAddress']; + } else { + if (!$config->get('outboundEmailFromAddress')) { + throw new Error('outboundEmailFromAddress is not specified in config.'); + } + $fromAddress = $config->get('outboundEmailFromAddress'); + } - if (!empty($params['fromName'])) { - $fromName = $params['fromName']; - } else { - $fromName = $config->get('outboundEmailFromName'); - } + if (!empty($params['fromName'])) { + $fromName = $params['fromName']; + } else { + $fromName = $config->get('outboundEmailFromName'); + } - $message->addFrom($fromAddress, $fromName); - } - - if (!empty($params['replyToAddress'])) { - $replyToName = null; - if (!empty($params['replyToName'])) { - $replyToName = $params['replyToName']; - } - $message->setReplyTo($params['replyToAddress'], $replyToName); - } + $message->addFrom($fromAddress, $fromName); + } + + if (!empty($params['replyToAddress'])) { + $replyToName = null; + if (!empty($params['replyToName'])) { + $replyToName = $params['replyToName']; + } + $message->setReplyTo($params['replyToAddress'], $replyToName); + } - $value = $email->get('to'); - if ($value) { - $arr = explode(';', $value); - if (is_array($arr)) { - foreach ($arr as $address) { - $message->addTo(trim($address)); - } - } - } + $value = $email->get('to'); + if ($value) { + $arr = explode(';', $value); + if (is_array($arr)) { + foreach ($arr as $address) { + $message->addTo(trim($address)); + } + } + } - $value = $email->get('cc'); - if ($value) { - $arr = explode(';', $value); - if (is_array($arr)) { - foreach ($arr as $address) { - $message->addCC(trim($address)); - } - } - } + $value = $email->get('cc'); + if ($value) { + $arr = explode(';', $value); + if (is_array($arr)) { + foreach ($arr as $address) { + $message->addCC(trim($address)); + } + } + } - $value = $email->get('bcc'); - if ($value) { - $arr = explode(';', $value); - if (is_array($arr)) { - foreach ($arr as $address) { - $message->addBCC(trim($address)); - } - } - } + $value = $email->get('bcc'); + if ($value) { + $arr = explode(';', $value); + if (is_array($arr)) { + foreach ($arr as $address) { + $message->addBCC(trim($address)); + } + } + } - $message->setSubject($email->get('name')); + $message->setSubject($email->get('name')); - $body = new MimeMessage; - $parts = array(); - + $body = new MimeMessage; + $parts = array(); + - $bodyPart = new MimePart($email->getBodyPlainForSending()); - $bodyPart->type = 'text/plain'; - $bodyPart->charset = 'utf-8'; - $parts[] = $bodyPart; + $bodyPart = new MimePart($email->getBodyPlainForSending()); + $bodyPart->type = 'text/plain'; + $bodyPart->charset = 'utf-8'; + $parts[] = $bodyPart; - - if ($email->get('isHtml')) { - $bodyPart = new MimePart($email->getBodyForSending()); - $bodyPart->type = 'text/html'; - $bodyPart->charset = 'utf-8'; - $parts[] = $bodyPart; - } - + + if ($email->get('isHtml')) { + $bodyPart = new MimePart($email->getBodyForSending()); + $bodyPart->type = 'text/html'; + $bodyPart->charset = 'utf-8'; + $parts[] = $bodyPart; + } + - $aCollection = $email->get('attachments'); - if (!empty($aCollection)) { - foreach ($aCollection as $a) { - $fileName = 'data/upload/' . $a->id; - $attachment = new MimePart(file_get_contents($fileName)); - $attachment->disposition = Mime::DISPOSITION_ATTACHMENT; - $attachment->encoding = Mime::ENCODING_BASE64; - $attachment->filename = $a->get('name'); - if ($a->get('type')) { - $attachment->type = $a->get('type'); - } - $parts[] = $attachment; - } - } - - $aCollection = $email->getInlineAttachments(); - if (!empty($aCollection)) { - foreach ($aCollection as $a) { - $fileName = 'data/upload/' . $a->id; - $attachment = new MimePart(file_get_contents($fileName)); - $attachment->disposition = Mime::DISPOSITION_INLINE; - $attachment->encoding = Mime::ENCODING_BASE64; - $attachment->id = $a->id; - if ($a->get('type')) { - $attachment->type = $a->get('type'); - } - $parts[] = $attachment; - } - } + $aCollection = $email->get('attachments'); + if (!empty($aCollection)) { + foreach ($aCollection as $a) { + $fileName = 'data/upload/' . $a->id; + $attachment = new MimePart(file_get_contents($fileName)); + $attachment->disposition = Mime::DISPOSITION_ATTACHMENT; + $attachment->encoding = Mime::ENCODING_BASE64; + $attachment->filename = $a->get('name'); + if ($a->get('type')) { + $attachment->type = $a->get('type'); + } + $parts[] = $attachment; + } + } + + $aCollection = $email->getInlineAttachments(); + if (!empty($aCollection)) { + foreach ($aCollection as $a) { + $fileName = 'data/upload/' . $a->id; + $attachment = new MimePart(file_get_contents($fileName)); + $attachment->disposition = Mime::DISPOSITION_INLINE; + $attachment->encoding = Mime::ENCODING_BASE64; + $attachment->id = $a->id; + if ($a->get('type')) { + $attachment->type = $a->get('type'); + } + $parts[] = $attachment; + } + } - $body->setParts($parts); - $message->setBody($body); - - if ($email->get('isHtml')) { - $message->getHeaders()->get('content-type')->setType('multipart/alternative'); - } + $body->setParts($parts); + $message->setBody($body); + + if ($email->get('isHtml')) { + $message->getHeaders()->get('content-type')->setType('multipart/alternative'); + } - try { - $this->transport->send($message); - - $headers = $message->getHeaders(); - if ($headers->has('messageId')) { - $email->set('messageId', $headers->get('messageId')->getId()); - } + try { + $this->transport->send($message); + + $headers = $message->getHeaders(); + if ($headers->has('messageId')) { + $email->set('messageId', $headers->get('messageId')->getId()); + } - $email->set('status', 'Sent'); - $email->set('dateSent', date("Y-m-d H:i:s")); - } catch (\Exception $e) { - throw new Error($e->getMessage(), 500); - } + $email->set('status', 'Sent'); + $email->set('dateSent', date("Y-m-d H:i:s")); + } catch (\Exception $e) { + throw new Error($e->getMessage(), 500); + } - $this->useGlobal(); - } + $this->useGlobal(); + } } diff --git a/application/Espo/Core/Mail/Storage/Imap.php b/application/Espo/Core/Mail/Storage/Imap.php index 65a9ded66b..494ad94e6a 100644 --- a/application/Espo/Core/Mail/Storage/Imap.php +++ b/application/Espo/Core/Mail/Storage/Imap.php @@ -3,17 +3,17 @@ namespace Espo\Core\Mail\Storage; class Imap extends \Zend\Mail\Storage\Imap -{ - public function getIdsFromUID($uid) - { - $uid = intval($uid) + 1; - return $this->protocol->search(array('UID ' . $uid . ':*')); - } - - public function getIdsFromDate($date) - { - return $this->protocol->search(array('SINCE "' . $date . '"')); - } - +{ + public function getIdsFromUID($uid) + { + $uid = intval($uid) + 1; + return $this->protocol->search(array('UID ' . $uid . ':*')); + } + + public function getIdsFromDate($date) + { + return $this->protocol->search(array('SINCE "' . $date . '"')); + } + } diff --git a/application/Espo/Core/ORM/DB/MysqlMapper.php b/application/Espo/Core/ORM/DB/MysqlMapper.php index 78ef574046..b1de6bc5ba 100644 --- a/application/Espo/Core/ORM/DB/MysqlMapper.php +++ b/application/Espo/Core/ORM/DB/MysqlMapper.php @@ -24,6 +24,6 @@ namespace Espo\Core\ORM\DB; class MysqlMapper extends \Espo\ORM\DB\MysqlMapper { - protected $returnCollection = false; + protected $returnCollection = false; } diff --git a/application/Espo/Core/ORM/Entity.php b/application/Espo/Core/ORM/Entity.php index e279f94be9..997e0420c3 100644 --- a/application/Espo/Core/ORM/Entity.php +++ b/application/Espo/Core/ORM/Entity.php @@ -24,40 +24,40 @@ namespace Espo\Core\ORM; class Entity extends \Espo\ORM\Entity { - public function loadLinkMultipleField($field, $columns = null) - { - if ($this->hasRelation($field) && $this->hasField($field . 'Ids')) { - - $defs = array(); - if (!empty($columns)) { - $defs['additionalColumns'] = $columns; - } - - $collection = $this->get($field, $defs); - $ids = array(); - $names = new \stdClass(); - if (!empty($columns)) { - $columnsData = new \stdClass(); - } - - foreach ($collection as $e) { - $id = $e->id; - $ids[] = $id; - $names->$id = $e->get('name'); - if (!empty($columns)) { - $columnsData->$id = new \stdClass(); - foreach ($columns as $column => $f) { - $columnsData->$id->$column = $e->get($f); - } - } - } - $this->set($field . 'Ids', $ids); - $this->set($field . 'Names', $names); - if (!empty($columns)) { - $this->set($field . 'Columns', $columnsData); - } - - } - } + public function loadLinkMultipleField($field, $columns = null) + { + if ($this->hasRelation($field) && $this->hasField($field . 'Ids')) { + + $defs = array(); + if (!empty($columns)) { + $defs['additionalColumns'] = $columns; + } + + $collection = $this->get($field, $defs); + $ids = array(); + $names = new \stdClass(); + if (!empty($columns)) { + $columnsData = new \stdClass(); + } + + foreach ($collection as $e) { + $id = $e->id; + $ids[] = $id; + $names->$id = $e->get('name'); + if (!empty($columns)) { + $columnsData->$id = new \stdClass(); + foreach ($columns as $column => $f) { + $columnsData->$id->$column = $e->get($f); + } + } + } + $this->set($field . 'Ids', $ids); + $this->set($field . 'Names', $names); + if (!empty($columns)) { + $this->set($field . 'Columns', $columnsData); + } + + } + } } diff --git a/application/Espo/Core/ORM/EntityManager.php b/application/Espo/Core/ORM/EntityManager.php index 555e6875b8..3b49cff4c7 100644 --- a/application/Espo/Core/ORM/EntityManager.php +++ b/application/Espo/Core/ORM/EntityManager.php @@ -26,80 +26,80 @@ use \Espo\Core\Utils\Util; class EntityManager extends \Espo\ORM\EntityManager { - protected $espoMetadata; - - private $hookManager; - - protected $user; - - protected $container; - - private $repositoryClassNameHash = array(); - - private $entityClassNameHash = array(); - - public function setContainer(\Espo\Core\Container $container) - { - $this->container = $container; - } - - public function getContainer() - { - return $this->container; - } - - public function setUser($user) - { - $this->user = $user; - } - - public function getUser() - { - return $this->user; - } - - public function getEspoMetadata() - { - return $this->espoMetadata; - } + protected $espoMetadata; + + private $hookManager; + + protected $user; + + protected $container; + + private $repositoryClassNameHash = array(); + + private $entityClassNameHash = array(); + + public function setContainer(\Espo\Core\Container $container) + { + $this->container = $container; + } + + public function getContainer() + { + return $this->container; + } + + public function setUser($user) + { + $this->user = $user; + } + + public function getUser() + { + return $this->user; + } + + public function getEspoMetadata() + { + return $this->espoMetadata; + } - public function setEspoMetadata($espoMetadata) - { - $this->espoMetadata = $espoMetadata; - } - - public function setHookManager(\Espo\Core\HookManager $hookManager) - { - $this->hookManager = $hookManager; - } - - public function getHookManager() - { - return $this->hookManager; - } + public function setEspoMetadata($espoMetadata) + { + $this->espoMetadata = $espoMetadata; + } + + public function setHookManager(\Espo\Core\HookManager $hookManager) + { + $this->hookManager = $hookManager; + } + + public function getHookManager() + { + return $this->hookManager; + } - public function normalizeRepositoryName($name) - { - if (empty($this->repositoryClassNameHash[$name])) { - $className = '\\Espo\\Custom\\Repositories\\' . Util::normilizeClassName($name); - if (!class_exists($className)) { - $className = $this->espoMetadata->getRepositoryPath($name); - } - $this->repositoryClassNameHash[$name] = $className; - } - return $this->repositoryClassNameHash[$name]; - } - - public function normalizeEntityName($name) - { - if (empty($this->entityClassNameHash[$name])) { - $className = '\\Espo\\Custom\\Entities\\' . Util::normilizeClassName($name); - if (!class_exists($className)) { - $className = $this->espoMetadata->getEntityPath($name); - } - $this->entityClassNameHash[$name] = $className; - } - return $this->entityClassNameHash[$name]; - } + public function normalizeRepositoryName($name) + { + if (empty($this->repositoryClassNameHash[$name])) { + $className = '\\Espo\\Custom\\Repositories\\' . Util::normilizeClassName($name); + if (!class_exists($className)) { + $className = $this->espoMetadata->getRepositoryPath($name); + } + $this->repositoryClassNameHash[$name] = $className; + } + return $this->repositoryClassNameHash[$name]; + } + + public function normalizeEntityName($name) + { + if (empty($this->entityClassNameHash[$name])) { + $className = '\\Espo\\Custom\\Entities\\' . Util::normilizeClassName($name); + if (!class_exists($className)) { + $className = $this->espoMetadata->getEntityPath($name); + } + $this->entityClassNameHash[$name] = $className; + } + return $this->entityClassNameHash[$name]; + } } diff --git a/application/Espo/Core/ORM/Repositories/RDB.php b/application/Espo/Core/ORM/Repositories/RDB.php index 0023ee6f9b..23f5cb5d5d 100644 --- a/application/Espo/Core/ORM/Repositories/RDB.php +++ b/application/Espo/Core/ORM/Repositories/RDB.php @@ -32,282 +32,282 @@ use \Espo\Core\Interfaces\Injectable; class RDB extends \Espo\ORM\Repositories\RDB implements Injectable { - public static $mapperClassName = '\\Espo\\Core\\ORM\\DB\\MysqlMapper'; + public static $mapperClassName = '\\Espo\\Core\\ORM\\DB\\MysqlMapper'; - protected $dependencies = array( - 'metadata' - ); + protected $dependencies = array( + 'metadata' + ); - protected $injections = array(); + protected $injections = array(); - public function inject($name, $object) - { - $this->injections[$name] = $object; - } + public function inject($name, $object) + { + $this->injections[$name] = $object; + } - protected function getInjection($name) - { - return $this->injections[$name]; - } + protected function getInjection($name) + { + return $this->injections[$name]; + } - public function getDependencyList() - { - return $this->dependencies; - } + public function getDependencyList() + { + return $this->dependencies; + } - protected function getMetadata() - { - return $this->getInjection('metadata'); - } + protected function getMetadata() + { + return $this->getInjection('metadata'); + } - public function handleSelectParams(&$params) - { - $this->handleEmailAddressParams($params); - $this->handlePhoneNumberParams($params); - $this->handleCurrencyParams($params); - } - - protected function handleCurrencyParams(&$params) - { - $entityName = $this->entityName; - - $metadata = $this->getMetadata(); - - if (!$metadata) { - return; - } - - $defs = $metadata->get('entityDefs.' . $entityName); + public function handleSelectParams(&$params) + { + $this->handleEmailAddressParams($params); + $this->handlePhoneNumberParams($params); + $this->handleCurrencyParams($params); + } + + protected function handleCurrencyParams(&$params) + { + $entityName = $this->entityName; + + $metadata = $this->getMetadata(); + + if (!$metadata) { + return; + } + + $defs = $metadata->get('entityDefs.' . $entityName); - foreach ($defs['fields'] as $field => $d) { - if (isset($d['type']) && $d['type'] == 'currency') { - if (empty($params['customJoin'])) { - $params['customJoin'] = ''; - } - $alias = Util::toUnderScore($field) . "_currency_alias"; - $params['customJoin'] .= " - LEFT JOIN currency AS `{$alias}` ON {$alias}.id = ".Util::toUnderScore($entityName).".".Util::toUnderScore($field)."_currency - "; - } - } + foreach ($defs['fields'] as $field => $d) { + if (isset($d['type']) && $d['type'] == 'currency') { + if (empty($params['customJoin'])) { + $params['customJoin'] = ''; + } + $alias = Util::toUnderScore($field) . "_currency_alias"; + $params['customJoin'] .= " + LEFT JOIN currency AS `{$alias}` ON {$alias}.id = ".Util::toUnderScore($entityName).".".Util::toUnderScore($field)."_currency + "; + } + } - } + } - protected function handleEmailAddressParams(&$params) - { - $entityName = $this->entityName; + protected function handleEmailAddressParams(&$params) + { + $entityName = $this->entityName; - $defs = $this->getEntityManager()->getMetadata()->get($entityName); - if (!empty($defs['relations']) && array_key_exists('emailAddresses', $defs['relations'])) { - if (empty($params['leftJoins'])) { - $params['leftJoins'] = array(); - } - if (empty($params['whereClause'])) { - $params['whereClause'] = array(); - } - if (empty($params['joinConditions'])) { - $params['joinConditions'] = array(); - } - $params['leftJoins'][] = 'emailAddresses'; - $params['joinConditions']['emailAddresses'] = array( - 'primary' => 1 - ); - } - } - - protected function handlePhoneNumberParams(&$params) - { - $entityName = $this->entityName; + $defs = $this->getEntityManager()->getMetadata()->get($entityName); + if (!empty($defs['relations']) && array_key_exists('emailAddresses', $defs['relations'])) { + if (empty($params['leftJoins'])) { + $params['leftJoins'] = array(); + } + if (empty($params['whereClause'])) { + $params['whereClause'] = array(); + } + if (empty($params['joinConditions'])) { + $params['joinConditions'] = array(); + } + $params['leftJoins'][] = 'emailAddresses'; + $params['joinConditions']['emailAddresses'] = array( + 'primary' => 1 + ); + } + } + + protected function handlePhoneNumberParams(&$params) + { + $entityName = $this->entityName; - $defs = $this->getEntityManager()->getMetadata()->get($entityName); - if (!empty($defs['relations']) && array_key_exists('phoneNumbers', $defs['relations'])) { - if (empty($params['leftJoins'])) { - $params['leftJoins'] = array(); - } - if (empty($params['whereClause'])) { - $params['whereClause'] = array(); - } - if (empty($params['joinConditions'])) { - $params['joinConditions'] = array(); - } - $params['leftJoins'][] = 'phoneNumbers'; - $params['joinConditions']['phoneNumbers'] = array( - 'primary' => 1 - ); - } - } + $defs = $this->getEntityManager()->getMetadata()->get($entityName); + if (!empty($defs['relations']) && array_key_exists('phoneNumbers', $defs['relations'])) { + if (empty($params['leftJoins'])) { + $params['leftJoins'] = array(); + } + if (empty($params['whereClause'])) { + $params['whereClause'] = array(); + } + if (empty($params['joinConditions'])) { + $params['joinConditions'] = array(); + } + $params['leftJoins'][] = 'phoneNumbers'; + $params['joinConditions']['phoneNumbers'] = array( + 'primary' => 1 + ); + } + } - protected function beforeRemove(Entity $entity) - { - parent::beforeRemove($entity); - $this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity); - } + protected function beforeRemove(Entity $entity) + { + parent::beforeRemove($entity); + $this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity); + } - protected function afterRemove(Entity $entity) - { - parent::afterRemove($entity); - $this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity); - } + protected function afterRemove(Entity $entity) + { + parent::afterRemove($entity); + $this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity); + } - public function remove(Entity $entity) - { - $this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity); + public function remove(Entity $entity) + { + $this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity); - $result = parent::remove($entity); - if ($result) { - $this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity); - } - return $result; - } + $result = parent::remove($entity); + if ($result) { + $this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity); + } + return $result; + } - protected function beforeSave(Entity $entity) - { - parent::beforeSave($entity); - $this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeSave', $entity); - } + protected function beforeSave(Entity $entity) + { + parent::beforeSave($entity); + $this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeSave', $entity); + } - protected function afterSave(Entity $entity) - { - parent::afterSave($entity); - $this->getEntityManager()->getHookManager()->process($this->entityName, 'afterSave', $entity); - } + protected function afterSave(Entity $entity) + { + parent::afterSave($entity); + $this->getEntityManager()->getHookManager()->process($this->entityName, 'afterSave', $entity); + } - public function save(Entity $entity) - { - $nowString = date('Y-m-d H:i:s', time()); - $restoreData = array(); + public function save(Entity $entity) + { + $nowString = date('Y-m-d H:i:s', time()); + $restoreData = array(); - if ($entity->isNew()) { - if (!$entity->has('id')) { - $entity->set('id', uniqid()); - } + if ($entity->isNew()) { + if (!$entity->has('id')) { + $entity->set('id', uniqid()); + } - if ($entity->hasField('createdAt')) { - $entity->set('createdAt', $nowString); - } - if ($entity->hasField('createdById')) { - $entity->set('createdById', $this->entityManager->getUser()->id); - } + if ($entity->hasField('createdAt')) { + $entity->set('createdAt', $nowString); + } + if ($entity->hasField('createdById')) { + $entity->set('createdById', $this->entityManager->getUser()->id); + } - if ($entity->has('modifiedById')) { - $restoreData['modifiedById'] = $entity->get('modifiedById'); - } - if ($entity->has('modifiedAt')) { - $restoreData['modifiedAt'] = $entity->get('modifiedAt'); - } - $entity->clear('modifiedById'); - $entity->clear('modifiedAt'); - } else { - if ($entity->hasField('modifiedAt')) { - $entity->set('modifiedAt', $nowString); - } - if ($entity->hasField('modifiedById')) { - $entity->set('modifiedById', $this->entityManager->getUser()->id); - } + if ($entity->has('modifiedById')) { + $restoreData['modifiedById'] = $entity->get('modifiedById'); + } + if ($entity->has('modifiedAt')) { + $restoreData['modifiedAt'] = $entity->get('modifiedAt'); + } + $entity->clear('modifiedById'); + $entity->clear('modifiedAt'); + } else { + if ($entity->hasField('modifiedAt')) { + $entity->set('modifiedAt', $nowString); + } + if ($entity->hasField('modifiedById')) { + $entity->set('modifiedById', $this->entityManager->getUser()->id); + } - if ($entity->has('createdById')) { - $restoreData['createdById'] = $entity->get('createdById'); - } - if ($entity->has('createdAt')) { - $restoreData['createdAt'] = $entity->get('createdAt'); - } - $entity->clear('createdById'); - $entity->clear('createdAt'); - } - $result = parent::save($entity); + if ($entity->has('createdById')) { + $restoreData['createdById'] = $entity->get('createdById'); + } + if ($entity->has('createdAt')) { + $restoreData['createdAt'] = $entity->get('createdAt'); + } + $entity->clear('createdById'); + $entity->clear('createdAt'); + } + $result = parent::save($entity); - $entity->set($restoreData); + $entity->set($restoreData); - $this->handleEmailAddressSave($entity); - $this->handlePhoneNumberSave($entity); - $this->handleSpecifiedRelations($entity); + $this->handleEmailAddressSave($entity); + $this->handlePhoneNumberSave($entity); + $this->handleSpecifiedRelations($entity); - return $result; - } + return $result; + } - protected function handleEmailAddressSave(Entity $entity) - { - if ($entity->hasRelation('emailAddresses') && $entity->hasField('emailAddress')) { - $emailAddressRepository = $this->getEntityManager()->getRepository('EmailAddress')->storeEntityEmailAddress($entity); - } - } - - protected function handlePhoneNumberSave(Entity $entity) - { - if ($entity->hasRelation('phoneNumbers') && $entity->hasField('phoneNumber')) { - $emailAddressRepository = $this->getEntityManager()->getRepository('PhoneNumber')->storeEntityPhoneNumber($entity); - } - } + protected function handleEmailAddressSave(Entity $entity) + { + if ($entity->hasRelation('emailAddresses') && $entity->hasField('emailAddress')) { + $emailAddressRepository = $this->getEntityManager()->getRepository('EmailAddress')->storeEntityEmailAddress($entity); + } + } + + protected function handlePhoneNumberSave(Entity $entity) + { + if ($entity->hasRelation('phoneNumbers') && $entity->hasField('phoneNumber')) { + $emailAddressRepository = $this->getEntityManager()->getRepository('PhoneNumber')->storeEntityPhoneNumber($entity); + } + } - protected function handleSpecifiedRelations(Entity $entity) - { - $relationTypes = array($entity::HAS_MANY, $entity::MANY_MANY, $entity::HAS_CHILDREN); - foreach ($entity->getRelations() as $name => $defs) { - if (in_array($defs['type'], $relationTypes)) { - $fieldName = $name . 'Ids'; - if ($entity->has($fieldName)) { - $specifiedIds = $entity->get($fieldName); - if (is_array($specifiedIds)) { - $toRemoveIds = array(); - $existingIds = array(); - $toUpdateIds = array(); - $existingColumnsData = new \stdClass(); - - $defs = array(); - $columns = $this->getMetadata()->get("entityDefs." . $entity->getEntityName() . ".fields.{$name}.columns"); - if (!empty($columns)) { - $columnData = $entity->get($name . 'Columns'); - $defs['additionalColumns'] = $columns; + protected function handleSpecifiedRelations(Entity $entity) + { + $relationTypes = array($entity::HAS_MANY, $entity::MANY_MANY, $entity::HAS_CHILDREN); + foreach ($entity->getRelations() as $name => $defs) { + if (in_array($defs['type'], $relationTypes)) { + $fieldName = $name . 'Ids'; + if ($entity->has($fieldName)) { + $specifiedIds = $entity->get($fieldName); + if (is_array($specifiedIds)) { + $toRemoveIds = array(); + $existingIds = array(); + $toUpdateIds = array(); + $existingColumnsData = new \stdClass(); + + $defs = array(); + $columns = $this->getMetadata()->get("entityDefs." . $entity->getEntityName() . ".fields.{$name}.columns"); + if (!empty($columns)) { + $columnData = $entity->get($name . 'Columns'); + $defs['additionalColumns'] = $columns; - } - - foreach ($entity->get($name, $defs) as $foreignEntity) { - $existingIds[] = $foreignEntity->id; - if (!empty($columns)) { - $data = new \stdClass(); - foreach ($columns as $columnName => $columnField) { - $foreignId = $foreignEntity->id; - $data->$columnName = $foreignEntity->get($columnField); - } - $existingColumnsData->$foreignId = $data; - } - - } - foreach ($existingIds as $id) { - if (!in_array($id, $specifiedIds)) { - $toRemoveIds[] = $id; - } else { - if (!empty($columns)) { - foreach ($columns as $columnName => $columnField) { - if ($columnData->$id->$columnName != $existingColumnsData->$id->$columnName) { - $toUpdateIds[] = $id; - } - } - } - } - } - foreach ($specifiedIds as $id) { - if (!in_array($id, $existingIds)) { - $data = null; - if (!empty($columns)) { - $data = $columnData->$id; - } - $this->relate($entity, $name, $id, $data); - } - } - foreach ($toRemoveIds as $id) { - $this->unrelate($entity, $name, $id); - } - if (!empty($columns)) { - foreach ($toUpdateIds as $id) { - $data = $columnData->$id; - $this->updateRelation($entity, $name, $id, $data); - } - } - } - } - } - } - } + } + + foreach ($entity->get($name, $defs) as $foreignEntity) { + $existingIds[] = $foreignEntity->id; + if (!empty($columns)) { + $data = new \stdClass(); + foreach ($columns as $columnName => $columnField) { + $foreignId = $foreignEntity->id; + $data->$columnName = $foreignEntity->get($columnField); + } + $existingColumnsData->$foreignId = $data; + } + + } + foreach ($existingIds as $id) { + if (!in_array($id, $specifiedIds)) { + $toRemoveIds[] = $id; + } else { + if (!empty($columns)) { + foreach ($columns as $columnName => $columnField) { + if ($columnData->$id->$columnName != $existingColumnsData->$id->$columnName) { + $toUpdateIds[] = $id; + } + } + } + } + } + foreach ($specifiedIds as $id) { + if (!in_array($id, $existingIds)) { + $data = null; + if (!empty($columns)) { + $data = $columnData->$id; + } + $this->relate($entity, $name, $id, $data); + } + } + foreach ($toRemoveIds as $id) { + $this->unrelate($entity, $name, $id); + } + if (!empty($columns)) { + foreach ($toUpdateIds as $id) { + $data = $columnData->$id; + $this->updateRelation($entity, $name, $id, $data); + } + } + } + } + } + } + } } diff --git a/application/Espo/Core/ORM/Repository.php b/application/Espo/Core/ORM/Repository.php index a6386eae43..0c54abd89c 100644 --- a/application/Espo/Core/ORM/Repository.php +++ b/application/Espo/Core/ORM/Repository.php @@ -26,23 +26,23 @@ use \Espo\Core\Interfaces\Injectable; abstract class Repository extends \Espo\ORM\Repository implements Injectable { - protected $dependencies = array(); - - protected $injections = array(); - - public function inject($name, $object) - { - $this->injections[$name] = $object; - } - - protected function getInjection($name) - { - return $this->injections[$name]; - } - - public function getDependencyList() - { - return $this->dependencies; - } + protected $dependencies = array(); + + protected $injections = array(); + + public function inject($name, $object) + { + $this->injections[$name] = $object; + } + + protected function getInjection($name) + { + return $this->injections[$name]; + } + + public function getDependencyList() + { + return $this->dependencies; + } } diff --git a/application/Espo/Core/ORM/RepositoryFactory.php b/application/Espo/Core/ORM/RepositoryFactory.php index 6975192db8..6107565483 100644 --- a/application/Espo/Core/ORM/RepositoryFactory.php +++ b/application/Espo/Core/ORM/RepositoryFactory.php @@ -23,18 +23,18 @@ namespace Espo\Core\ORM; class RepositoryFactory extends \Espo\ORM\RepositoryFactory -{ - protected $defaultRepositoryClassName = '\\Espo\\Core\\ORM\\Repositories\\RDB'; +{ + protected $defaultRepositoryClassName = '\\Espo\\Core\\ORM\\Repositories\\RDB'; - public function create($name) - { - $repository = parent::create($name); - - $dependencies = $repository->getDependencyList(); - foreach ($dependencies as $name) { - $repository->inject($name, $this->entityManager->getContainer()->get($name)); - } - return $repository; - } + public function create($name) + { + $repository = parent::create($name); + + $dependencies = $repository->getDependencyList(); + foreach ($dependencies as $name) { + $repository->inject($name, $this->entityManager->getContainer()->get($name)); + } + return $repository; + } } diff --git a/application/Espo/Core/SelectManagerFactory.php b/application/Espo/Core/SelectManagerFactory.php index dd035fe8b8..333023ee73 100644 --- a/application/Espo/Core/SelectManagerFactory.php +++ b/application/Espo/Core/SelectManagerFactory.php @@ -28,41 +28,41 @@ use \Espo\Core\Utils\Util; class SelectManagerFactory { - private $entityManager; - - private $user; - - private $acl; - - private $metadata; + private $entityManager; + + private $user; + + private $acl; + + private $metadata; public function __construct($entityManager, \Espo\Entities\User $user, Acl $acl, $metadata) { - $this->entityManager = $entityManager; - $this->user = $user; - $this->acl = $acl; - $this->metadata = $metadata; + $this->entityManager = $entityManager; + $this->user = $user; + $this->acl = $acl; + $this->metadata = $metadata; } - public function create($entityName) - { - $className = '\\Espo\\Custom\\SelectManagers\\' . Util::normilizeClassName($entityName); - if (!class_exists($className)) { - $moduleName = $this->metadata->getScopeModuleName($entityName); - if ($moduleName) { - $className = '\\Espo\\Modules\\' . $moduleName . '\\SelectManagers\\' . Util::normilizeClassName($entityName); - } else { - $className = '\\Espo\\SelectManagers\\' . Util::normilizeClassName($entityName); - } - if (!class_exists($className)) { - $className = '\\Espo\\Core\\SelectManagers\\Base'; - } - } - - $selectManager = new $className($this->entityManager, $this->user, $this->acl, $this->metadata); - $selectManager->setEntityName($entityName); - - return $selectManager; - } + public function create($entityName) + { + $className = '\\Espo\\Custom\\SelectManagers\\' . Util::normilizeClassName($entityName); + if (!class_exists($className)) { + $moduleName = $this->metadata->getScopeModuleName($entityName); + if ($moduleName) { + $className = '\\Espo\\Modules\\' . $moduleName . '\\SelectManagers\\' . Util::normilizeClassName($entityName); + } else { + $className = '\\Espo\\SelectManagers\\' . Util::normilizeClassName($entityName); + } + if (!class_exists($className)) { + $className = '\\Espo\\Core\\SelectManagers\\Base'; + } + } + + $selectManager = new $className($this->entityManager, $this->user, $this->acl, $this->metadata); + $selectManager->setEntityName($entityName); + + return $selectManager; + } } diff --git a/application/Espo/Core/SelectManagers/Base.php b/application/Espo/Core/SelectManagers/Base.php index b32890dfd0..a017defb3a 100644 --- a/application/Espo/Core/SelectManagers/Base.php +++ b/application/Espo/Core/SelectManagers/Base.php @@ -28,374 +28,374 @@ use \Espo\Core\Acl; class Base { - protected $container; + protected $container; - protected $user; + protected $user; - protected $acl; + protected $acl; - protected $entityManager; + protected $entityManager; - protected $entityName; + protected $entityName; - protected $metadata; + protected $metadata; - const MIN_LENGTH_FOR_CONTENT_SEARCH = 4; + const MIN_LENGTH_FOR_CONTENT_SEARCH = 4; public function __construct($entityManager, \Espo\Entities\User $user, Acl $acl, $metadata) { - $this->entityManager = $entityManager; - $this->user = $user; - $this->acl = $acl; - $this->metadata = $metadata; + $this->entityManager = $entityManager; + $this->user = $user; + $this->acl = $acl; + $this->metadata = $metadata; } public function setEntityName($entityName) { - $this->entityName = $entityName; + $this->entityName = $entityName; } protected function limit($params, &$result) { - if (isset($params['offset']) && !is_null($params['offset'])) { - $result['offset'] = $params['offset']; - } - if (isset($params['maxSize']) && !is_null($params['maxSize'])) { - $result['limit'] = $params['maxSize']; - } + if (isset($params['offset']) && !is_null($params['offset'])) { + $result['offset'] = $params['offset']; + } + if (isset($params['maxSize']) && !is_null($params['maxSize'])) { + $result['limit'] = $params['maxSize']; + } } protected function order($params, &$result) { - if (!empty($params['sortBy'])) { - $result['orderBy'] = $params['sortBy']; - $type = $this->metadata->get("entityDefs.{$this->entityName}.fields." . $result['orderBy'] . ".type"); - if ($type == 'link') { - $result['orderBy'] .= 'Name'; - } else if ($type == 'linkParent') { - $result['orderBy'] .= 'Type'; - } - } - if (isset($params['asc'])) { - if ($params['asc']) { - $result['order'] = 'ASC'; - } else { - $result['order'] = 'DESC'; - } - } + if (!empty($params['sortBy'])) { + $result['orderBy'] = $params['sortBy']; + $type = $this->metadata->get("entityDefs.{$this->entityName}.fields." . $result['orderBy'] . ".type"); + if ($type == 'link') { + $result['orderBy'] .= 'Name'; + } else if ($type == 'linkParent') { + $result['orderBy'] .= 'Type'; + } + } + if (isset($params['asc'])) { + if ($params['asc']) { + $result['order'] = 'ASC'; + } else { + $result['order'] = 'DESC'; + } + } } protected function getTextFilterFields() { - return $this->metadata->get("entityDefs.{$this->entityName}.collection.textFilterFields", array('name')); + return $this->metadata->get("entityDefs.{$this->entityName}.collection.textFilterFields", array('name')); } protected function where($params, &$result) { - if (!empty($params['where']) && is_array($params['where'])) { - $where = array(); + if (!empty($params['where']) && is_array($params['where'])) { + $where = array(); - foreach ($params['where'] as $item) { - if ($item['type'] == 'boolFilters' && !empty($item['value']) && is_array($item['value'])) { - foreach ($item['value'] as $filter) { - $p = $this->getBoolFilterWhere($filter); - if (!empty($p)) { - $params['where'][] = $p; - } - } - } else if ($item['type'] == 'textFilter' && !empty($item['value'])) { - if (!empty($item['value'])) { - if (empty($result['whereClause'])) { - $result['whereClause'] = array(); - } - $fieldDefs = $this->entityManager->getEntity($this->entityName)->getFields(); - $fieldList = $this->getTextFilterFields(); - $d = array(); - foreach ($fieldList as $field) { - if ( - strlen($item['value']) >= self::MIN_LENGTH_FOR_CONTENT_SEARCH - && - !empty($fieldDefs[$field]['type']) && $fieldDefs[$field]['type'] == 'text' - ) { - $d[$field . '*'] = '%' . $item['value'] . '%'; - } else { - $d[$field . '*'] = $item['value'] . '%'; - } - } - $where['OR'] = $d; - } - } - } + foreach ($params['where'] as $item) { + if ($item['type'] == 'boolFilters' && !empty($item['value']) && is_array($item['value'])) { + foreach ($item['value'] as $filter) { + $p = $this->getBoolFilterWhere($filter); + if (!empty($p)) { + $params['where'][] = $p; + } + } + } else if ($item['type'] == 'textFilter' && !empty($item['value'])) { + if (!empty($item['value'])) { + if (empty($result['whereClause'])) { + $result['whereClause'] = array(); + } + $fieldDefs = $this->entityManager->getEntity($this->entityName)->getFields(); + $fieldList = $this->getTextFilterFields(); + $d = array(); + foreach ($fieldList as $field) { + if ( + strlen($item['value']) >= self::MIN_LENGTH_FOR_CONTENT_SEARCH + && + !empty($fieldDefs[$field]['type']) && $fieldDefs[$field]['type'] == 'text' + ) { + $d[$field . '*'] = '%' . $item['value'] . '%'; + } else { + $d[$field . '*'] = $item['value'] . '%'; + } + } + $where['OR'] = $d; + } + } + } - $linkedWith = array(); - $ignoreList = array('linkedWith', 'boolFilters'); - foreach ($params['where'] as $item) { - if (!in_array($item['type'], $ignoreList)) { - $part = $this->getWherePart($item); - if (!empty($part)) { - $where[] = $part; - } - } else { - if ($item['type'] == 'linkedWith' && !empty($item['value'])) { - $linkedWith[$item['field']] = $item['value']; - } - } - } + $linkedWith = array(); + $ignoreList = array('linkedWith', 'boolFilters'); + foreach ($params['where'] as $item) { + if (!in_array($item['type'], $ignoreList)) { + $part = $this->getWherePart($item); + if (!empty($part)) { + $where[] = $part; + } + } else { + if ($item['type'] == 'linkedWith' && !empty($item['value'])) { + $linkedWith[$item['field']] = $item['value']; + } + } + } - if (!empty($linkedWith)) { - $joins = array(); + if (!empty($linkedWith)) { + $joins = array(); - $part = array(); - foreach ($linkedWith as $link => $ids) { - $joins[] = $link; - $defs = $this->entityManager->getMetadata()->get($this->entityName); + $part = array(); + foreach ($linkedWith as $link => $ids) { + $joins[] = $link; + $defs = $this->entityManager->getMetadata()->get($this->entityName); - $entityName = $defs['relations'][$link]['entity']; - if ($entityName) { - $part[$entityName . '.id'] = $ids; - } - } + $entityName = $defs['relations'][$link]['entity']; + if ($entityName) { + $part[$entityName . '.id'] = $ids; + } + } - if (!empty($part)) { - $where[] = $part; - } - $result['joins'] = $joins; - $result['distinct'] = true; + if (!empty($part)) { + $where[] = $part; + } + $result['joins'] = $joins; + $result['distinct'] = true; - } + } - $result['whereClause'] = $where; - } + $result['whereClause'] = $where; + } } protected function q($params, &$result) { - if (!empty($params['q'])) { - if (empty($result['whereClause'])) { - $result['whereClause'] = array(); - } - - $fieldDefs = $this->entityManager->getEntity($this->entityName)->getFields(); + if (!empty($params['q'])) { + if (empty($result['whereClause'])) { + $result['whereClause'] = array(); + } + + $fieldDefs = $this->entityManager->getEntity($this->entityName)->getFields(); - $value = $params['q']; + $value = $params['q']; - $fieldList = $this->getTextFilterFields(); - $d = array(); - foreach ($fieldList as $field) { - if ( - strlen($item['value']) >= self::MIN_LENGTH_FOR_CONTENT_SEARCH - && - !empty($fieldDefs[$field]['type']) && $fieldDefs[$field]['type'] == 'text' - ) { - $d[$field . '*'] = '%' . $value . '%'; - } else { - $d[$field . '*'] = $value . '%'; - } - } + $fieldList = $this->getTextFilterFields(); + $d = array(); + foreach ($fieldList as $field) { + if ( + strlen($item['value']) >= self::MIN_LENGTH_FOR_CONTENT_SEARCH + && + !empty($fieldDefs[$field]['type']) && $fieldDefs[$field]['type'] == 'text' + ) { + $d[$field . '*'] = '%' . $value . '%'; + } else { + $d[$field . '*'] = $value . '%'; + } + } - $result['whereClause']['OR'] = $d; - } - } + $result['whereClause']['OR'] = $d; + } + } protected function access(&$result) { - if ($this->acl->checkReadOnlyOwn($this->entityName)) { + if ($this->acl->checkReadOnlyOwn($this->entityName)) { - if (!array_key_exists('whereClause', $result)) { - $result['whereClause'] = array(); - } - $result['whereClause']['assignedUserId'] = $this->user->id; - } - if (!$this->user->isAdmin() && $this->acl->checkReadOnlyTeam($this->entityName)) { - if (!array_key_exists('whereClause', $result)) { - $result['whereClause'] = array(); - } - $result['distinct'] = true; - if (!array_key_exists('joins', $result)) { - $result['joins'] = array(); - } - if (!in_array('teams', $result['joins'])) { - $result['leftJoins'][] = 'teams'; - } + if (!array_key_exists('whereClause', $result)) { + $result['whereClause'] = array(); + } + $result['whereClause']['assignedUserId'] = $this->user->id; + } + if (!$this->user->isAdmin() && $this->acl->checkReadOnlyTeam($this->entityName)) { + if (!array_key_exists('whereClause', $result)) { + $result['whereClause'] = array(); + } + $result['distinct'] = true; + if (!array_key_exists('joins', $result)) { + $result['joins'] = array(); + } + if (!in_array('teams', $result['joins'])) { + $result['leftJoins'][] = 'teams'; + } - $result['whereClause']['OR'] = array( - 'Team.id' => $this->user->get('teamsIds'), - 'assignedUserId' => $this->user->id - ); - //$result['whereClause']['Team.id'] = $this->user->get('teamsIds'); - } + $result['whereClause']['OR'] = array( + 'Team.id' => $this->user->get('teamsIds'), + 'assignedUserId' => $this->user->id + ); + //$result['whereClause']['Team.id'] = $this->user->get('teamsIds'); + } } public function getAclParams() { - $result = array(); - $this->access($result); - return $result; + $result = array(); + $this->access($result); + return $result; } - public function getSelectParams(array $params, $withAcl = false) - { - $result = array(); + public function getSelectParams(array $params, $withAcl = false) + { + $result = array(); - $this->order($params, $result); - $this->limit($params, $result); - $this->where($params, $result); - $this->q($params, $result); + $this->order($params, $result); + $this->limit($params, $result); + $this->where($params, $result); + $this->q($params, $result); - if ($withAcl) { - $this->access($result); - } + if ($withAcl) { + $this->access($result); + } - return $result; - } + return $result; + } - protected function getWherePart($item) - { - $part = array(); + protected function getWherePart($item) + { + $part = array(); - if (!empty($item['type'])) { - switch ($item['type']) { - case 'or': - case 'and': - if (is_array($item['value'])) { - $arr = array(); - foreach ($item['value'] as $i) { - $a = $this->getWherePart($i); - foreach ($a as $left => $right) { - if (!empty($right)) { - $arr[$left] = $right; - } - } - } - $part[strtoupper($item['type'])] = $arr; - } - break; - case 'like': - $part[$item['field'] . '*'] = $item['value']; - break; - case 'equals': - case 'on': - $part[$item['field'] . '='] = $item['value']; - break; - case 'notEquals': - case 'notOn': - $part[$item['field'] . '!='] = $item['value']; - break; - case 'greaterThan': - case 'after': - $part[$item['field'] . '>'] = $item['value']; - break; - case 'lessThan': - case 'before': - $part[$item['field'] . '<'] = $item['value']; - break; - case 'greaterThanOrEquals': - $part[$item['field'] . '>='] = $item['value']; - break; - case 'lessThanOrEquals': - $part[$item['field'] . '<'] = $item['value']; - break; - case 'in': - $part[$item['field'] . '='] = $item['value']; - break; - case 'notIn': - $part[$item['field'] . '!='] = $item['value']; - break; - case 'isTrue': - $part[$item['field'] . '='] = true; - break; - case 'isFalse': - $part[$item['field'] . '='] = false; - break; - case 'today': - $part[$item['field'] . '='] = date('Y-m-d'); - break; - case 'past': - $part[$item['field'] . '<'] = date('Y-m-d'); - break; - case 'future': - $part[$item['field'] . '>'] = date('Y-m-d'); - break; - case 'currentMonth': - $dt = new \DateTime(); - $part['AND'] = array( - $item['field'] . '>=' => $dt->modify('first day of this month')->format('Y-m-d'), - $item['field'] . '<' => $dt->add(new \DateInterval('P1M'))->format('Y-m-d'), - ); - break; - case 'lastMonth': - $dt = new \DateTime(); - $part['AND'] = array( - $item['field'] . '>=' => $dt->modify('first day of last month')->format('Y-m-d'), - $item['field'] . '<' => $dt->add(new \DateInterval('P1M'))->format('Y-m-d'), - ); - break; - case 'currentQuarter': - $dt = new \DateTime(); - $quarter = ceil($dt->format('m') / 3); - $dt->modify('first day of January this year'); - $part['AND'] = array( - $item['field'] . '>=' => $dt->add(new \DateInterval('P'.(($quarter - 1) * 3).'M'))->format('Y-m-d'), - $item['field'] . '<' => $dt->add(new \DateInterval('P3M'))->format('Y-m-d'), - ); - break; - case 'lastQuarter': - $dt = new \DateTime(); - $quarter = ceil($dt->format('m') / 3); - $dt->modify('first day of January this year'); - $quarter--; - if ($quarter == 0) { - $quarter = 4; - $dt->sub('P1Y'); - } - $part['AND'] = array( - $item['field'] . '>=' => $dt->add(new \DateInterval('P'.(($quarter - 1) * 3).'M'))->format('Y-m-d'), - $item['field'] . '<' => $dt->add(new \DateInterval('P3M'))->format('Y-m-d'), - ); - break; - case 'currentYear': - $dt = new \DateTime(); - $part['AND'] = array( - $item['field'] . '>=' => $dt->modify('first day of January this year')->format('Y-m-d'), - $item['field'] . '<' => $dt->add(new \DateInterval('P1Y'))->format('Y-m-d'), - ); - break; - case 'lastYear': - $dt = new \DateTime(); - $part['AND'] = array( - $item['field'] . '>=' => $dt->modify('first day of January last year')->format('Y-m-d'), - $item['field'] . '<' => $dt->add(new \DateInterval('P1Y'))->format('Y-m-d'), - ); - break; - case 'between': - if (is_array($item['value'])) { - $part['AND'] = array( - $item['field'] . '>=' => $item['value'][0], - $item['field'] . '<=' => $item['value'][1], - ); - } - break; - } - } + if (!empty($item['type'])) { + switch ($item['type']) { + case 'or': + case 'and': + if (is_array($item['value'])) { + $arr = array(); + foreach ($item['value'] as $i) { + $a = $this->getWherePart($i); + foreach ($a as $left => $right) { + if (!empty($right)) { + $arr[$left] = $right; + } + } + } + $part[strtoupper($item['type'])] = $arr; + } + break; + case 'like': + $part[$item['field'] . '*'] = $item['value']; + break; + case 'equals': + case 'on': + $part[$item['field'] . '='] = $item['value']; + break; + case 'notEquals': + case 'notOn': + $part[$item['field'] . '!='] = $item['value']; + break; + case 'greaterThan': + case 'after': + $part[$item['field'] . '>'] = $item['value']; + break; + case 'lessThan': + case 'before': + $part[$item['field'] . '<'] = $item['value']; + break; + case 'greaterThanOrEquals': + $part[$item['field'] . '>='] = $item['value']; + break; + case 'lessThanOrEquals': + $part[$item['field'] . '<'] = $item['value']; + break; + case 'in': + $part[$item['field'] . '='] = $item['value']; + break; + case 'notIn': + $part[$item['field'] . '!='] = $item['value']; + break; + case 'isTrue': + $part[$item['field'] . '='] = true; + break; + case 'isFalse': + $part[$item['field'] . '='] = false; + break; + case 'today': + $part[$item['field'] . '='] = date('Y-m-d'); + break; + case 'past': + $part[$item['field'] . '<'] = date('Y-m-d'); + break; + case 'future': + $part[$item['field'] . '>'] = date('Y-m-d'); + break; + case 'currentMonth': + $dt = new \DateTime(); + $part['AND'] = array( + $item['field'] . '>=' => $dt->modify('first day of this month')->format('Y-m-d'), + $item['field'] . '<' => $dt->add(new \DateInterval('P1M'))->format('Y-m-d'), + ); + break; + case 'lastMonth': + $dt = new \DateTime(); + $part['AND'] = array( + $item['field'] . '>=' => $dt->modify('first day of last month')->format('Y-m-d'), + $item['field'] . '<' => $dt->add(new \DateInterval('P1M'))->format('Y-m-d'), + ); + break; + case 'currentQuarter': + $dt = new \DateTime(); + $quarter = ceil($dt->format('m') / 3); + $dt->modify('first day of January this year'); + $part['AND'] = array( + $item['field'] . '>=' => $dt->add(new \DateInterval('P'.(($quarter - 1) * 3).'M'))->format('Y-m-d'), + $item['field'] . '<' => $dt->add(new \DateInterval('P3M'))->format('Y-m-d'), + ); + break; + case 'lastQuarter': + $dt = new \DateTime(); + $quarter = ceil($dt->format('m') / 3); + $dt->modify('first day of January this year'); + $quarter--; + if ($quarter == 0) { + $quarter = 4; + $dt->sub('P1Y'); + } + $part['AND'] = array( + $item['field'] . '>=' => $dt->add(new \DateInterval('P'.(($quarter - 1) * 3).'M'))->format('Y-m-d'), + $item['field'] . '<' => $dt->add(new \DateInterval('P3M'))->format('Y-m-d'), + ); + break; + case 'currentYear': + $dt = new \DateTime(); + $part['AND'] = array( + $item['field'] . '>=' => $dt->modify('first day of January this year')->format('Y-m-d'), + $item['field'] . '<' => $dt->add(new \DateInterval('P1Y'))->format('Y-m-d'), + ); + break; + case 'lastYear': + $dt = new \DateTime(); + $part['AND'] = array( + $item['field'] . '>=' => $dt->modify('first day of January last year')->format('Y-m-d'), + $item['field'] . '<' => $dt->add(new \DateInterval('P1Y'))->format('Y-m-d'), + ); + break; + case 'between': + if (is_array($item['value'])) { + $part['AND'] = array( + $item['field'] . '>=' => $item['value'][0], + $item['field'] . '<=' => $item['value'][1], + ); + } + break; + } + } - return $part; - } + return $part; + } - protected function getBoolFilterWhere($filterName) - { - $method = 'getBoolFilterWhere' . ucfirst($filterName); - if (method_exists($this, $method)) { - return $this->$method(); - } - } + protected function getBoolFilterWhere($filterName) + { + $method = 'getBoolFilterWhere' . ucfirst($filterName); + if (method_exists($this, $method)) { + return $this->$method(); + } + } - protected function getBoolFilterWhereOnlyMy() - { - return array( - 'type' => 'equals', - 'field' => 'assignedUserId', - 'value' => $this->user->id, - ); - } + protected function getBoolFilterWhereOnlyMy() + { + return array( + 'type' => 'equals', + 'field' => 'assignedUserId', + 'value' => $this->user->id, + ); + } } diff --git a/application/Espo/Core/ServiceFactory.php b/application/Espo/Core/ServiceFactory.php index b55d69b22b..b23c2cce3f 100644 --- a/application/Espo/Core/ServiceFactory.php +++ b/application/Espo/Core/ServiceFactory.php @@ -28,127 +28,127 @@ use \Espo\Core\Utils\Util; class ServiceFactory { - private $container; + private $container; - protected $cacheFile = 'data/cache/application/services.php'; + protected $cacheFile = 'data/cache/application/services.php'; - /** + /** * @var array - path to Service files */ - protected $paths = array( - 'corePath' => 'application/Espo/Services', - 'modulePath' => 'application/Espo/Modules/{*}/Services', - 'customPath' => 'custom/Espo/Custom/Services', - ); + protected $paths = array( + 'corePath' => 'application/Espo/Services', + 'modulePath' => 'application/Espo/Modules/{*}/Services', + 'customPath' => 'custom/Espo/Custom/Services', + ); - protected $data; + protected $data; public function __construct(Container $container) { - $this->container = $container; + $this->container = $container; } - protected function init() - { - $config = $this->getContainer()->get('config'); + protected function init() + { + $config = $this->getContainer()->get('config'); - if (file_exists($this->cacheFile) && $config->get('useCache')) { - $this->data = $this->getFileManager()->getContents($this->cacheFile); - } else { - $this->data = $this->getClassNameHash($this->paths['corePath']); + if (file_exists($this->cacheFile) && $config->get('useCache')) { + $this->data = $this->getFileManager()->getContents($this->cacheFile); + } else { + $this->data = $this->getClassNameHash($this->paths['corePath']); - foreach ($this->getContainer()->get('metadata')->getModuleList() as $moduleName) { - $path = str_replace('{*}', $moduleName, $this->paths['modulePath']); - $this->data = array_merge($this->data, $this->getClassNameHash($path)); - } + foreach ($this->getContainer()->get('metadata')->getModuleList() as $moduleName) { + $path = str_replace('{*}', $moduleName, $this->paths['modulePath']); + $this->data = array_merge($this->data, $this->getClassNameHash($path)); + } - $this->data = array_merge($this->data, $this->getClassNameHash($this->paths['customPath'])); + $this->data = array_merge($this->data, $this->getClassNameHash($this->paths['customPath'])); - if ($config->get('useCache')) { - $result = $this->getFileManager()->putContentsPHP($this->cacheFile, $this->data); - if ($result == false) { - throw new \Espo\Core\Exceptions\Error(); - } - } - } - } + if ($config->get('useCache')) { + $result = $this->getFileManager()->putContentsPHP($this->cacheFile, $this->data); + if ($result == false) { + throw new \Espo\Core\Exceptions\Error(); + } + } + } + } - protected function getFileManager() - { - return $this->container->get('fileManager'); - } + protected function getFileManager() + { + return $this->container->get('fileManager'); + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - protected function getClassName($name) - { - $name = Util::normilizeClassName($name); + protected function getClassName($name) + { + $name = Util::normilizeClassName($name); - if (!isset($this->data)) { - $this->init(); - } + if (!isset($this->data)) { + $this->init(); + } - $name = ucfirst($name); - if (isset($this->data[$name])) { - return $this->data[$name]; - } + $name = ucfirst($name); + if (isset($this->data[$name])) { + return $this->data[$name]; + } return false; - } + } - public function checkExists($name) { - $className = $this->getClassName($name); - if (!empty($className)) { - return true; - } - } + public function checkExists($name) { + $className = $this->getClassName($name); + if (!empty($className)) { + return true; + } + } public function create($name) { - $className = $this->getClassName($name); - if (empty($className)) { - throw new Error(); - } - return $this->createByClassName($className); + $className = $this->getClassName($name); + if (empty($className)) { + throw new Error(); + } + return $this->createByClassName($className); } - protected function createByClassName($className) - { - if (class_exists($className)) { - $service = new $className(); - $dependencies = $service->getDependencyList(); - foreach ($dependencies as $name) { - $service->inject($name, $this->container->get($name)); - } - return $service; - } - throw new Error("Class '$className' does not exist"); - } + protected function createByClassName($className) + { + if (class_exists($className)) { + $service = new $className(); + $dependencies = $service->getDependencyList(); + foreach ($dependencies as $name) { + $service->inject($name, $this->container->get($name)); + } + return $service; + } + throw new Error("Class '$className' does not exist"); + } - // TODO delegate to another class - protected function getClassNameHash($dirs) - { - if (is_string($dirs)) { - $dirs = (array) $dirs; - } + // TODO delegate to another class + protected function getClassNameHash($dirs) + { + if (is_string($dirs)) { + $dirs = (array) $dirs; + } - $data = array(); + $data = array(); - foreach ($dirs as $dir) { - if (file_exists($dir)) { - $fileList = $this->getFileManager()->getFileList($dir, false, '\.php$', 'file'); - foreach ($fileList as $file) { - $filePath = Util::concatPath($dir, $file); - $className = Util::getClassName($filePath); - $fileName = $this->getFileManager()->getFileName($filePath); - $data[$fileName] = $className; - } - } - } - return $data; - } + foreach ($dirs as $dir) { + if (file_exists($dir)) { + $fileList = $this->getFileManager()->getFileList($dir, false, '\.php$', 'file'); + foreach ($fileList as $file) { + $filePath = Util::concatPath($dir, $file); + $className = Util::getClassName($filePath); + $fileName = $this->getFileManager()->getFileName($filePath); + $data[$fileName] = $className; + } + } + } + return $data; + } } diff --git a/application/Espo/Core/Services/Base.php b/application/Espo/Core/Services/Base.php index d28a8afb23..95f11034f2 100644 --- a/application/Espo/Core/Services/Base.php +++ b/application/Espo/Core/Services/Base.php @@ -26,51 +26,51 @@ use \Espo\Core\Interfaces\Injectable; abstract class Base implements Injectable { - protected $dependencies = array( - 'config', - 'entityManager', - 'user', - ); - - 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]; - } - - public function getDependencyList() - { - return $this->dependencies; - } - - protected function getEntityManager() - { - return $this->getInjection('entityManager'); - } - - protected function getConfig() - { - return $this->getInjection('config'); - } + protected $dependencies = array( + 'config', + 'entityManager', + 'user', + ); + + 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]; + } + + public function getDependencyList() + { + return $this->dependencies; + } + + protected function getEntityManager() + { + return $this->getInjection('entityManager'); + } + + protected function getConfig() + { + return $this->getInjection('config'); + } - protected function getUser() - { - return $this->getInjection('user'); - } + protected function getUser() + { + return $this->getInjection('user'); + } } diff --git a/application/Espo/Core/UpgradeManager.php b/application/Espo/Core/UpgradeManager.php index 5d42afe3d7..e6e62bdd18 100644 --- a/application/Espo/Core/UpgradeManager.php +++ b/application/Espo/Core/UpgradeManager.php @@ -26,14 +26,14 @@ use Espo\Core\Exceptions\Error; class UpgradeManager extends Upgrades\Base { - protected $name = 'Upgrade'; + protected $name = 'Upgrade'; - protected $params = array( - 'packagePath' => 'data/upload/upgrades', + protected $params = array( + 'packagePath' => 'data/upload/upgrades', - 'scriptNames' => array( - 'before' => 'BeforeUpgrade', - 'after' => 'AfterUpgrade', - ) - ); + 'scriptNames' => array( + 'before' => 'BeforeUpgrade', + 'after' => 'AfterUpgrade', + ) + ); } \ No newline at end of file diff --git a/application/Espo/Core/Upgrades/ActionManager.php b/application/Espo/Core/Upgrades/ActionManager.php index 44a0fc7b8a..7b176230b4 100644 --- a/application/Espo/Core/Upgrades/ActionManager.php +++ b/application/Espo/Core/Upgrades/ActionManager.php @@ -26,77 +26,77 @@ use Espo\Core\Exceptions\Error; class ActionManager { - private $managerName; + private $managerName; - private $container; + private $container; - private $objects; + private $objects; - protected $currentAction; + protected $currentAction; - protected $params; + protected $params; - public function __construct($managerName, $container, $params) - { - $this->managerName = $managerName; - $this->container = $container; + public function __construct($managerName, $container, $params) + { + $this->managerName = $managerName; + $this->container = $container; - $params['name'] = $managerName; - $this->params = $params; - } + $params['name'] = $managerName; + $this->params = $params; + } - protected function getManagerName() - { - return $this->managerName; - } + protected function getManagerName() + { + return $this->managerName; + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - public function setAction($action) - { - $this->currentAction = $action; - } + public function setAction($action) + { + $this->currentAction = $action; + } - public function getAction() - { - return $this->currentAction; - } + public function getAction() + { + return $this->currentAction; + } - public function getParams() - { - return $this->params; - } + public function getParams() + { + return $this->params; + } - public function run($data) - { - $object = $this->getObject(); + public function run($data) + { + $object = $this->getObject(); - return $object->run($data); - } + return $object->run($data); + } - public function getManifest() - { - return $this->getObject()->getManifest(); - } + public function getManifest() + { + return $this->getObject()->getManifest(); + } - protected function getObject() - { - $managerName = $this->getManagerName(); - $actionName = $this->getAction(); + protected function getObject() + { + $managerName = $this->getManagerName(); + $actionName = $this->getAction(); - if (!isset($this->objects[$managerName][$actionName])) { - $class = '\Espo\Core\Upgrades\Actions\\' . ucfirst($managerName) . '\\' . ucfirst($actionName); + if (!isset($this->objects[$managerName][$actionName])) { + $class = '\Espo\Core\Upgrades\Actions\\' . ucfirst($managerName) . '\\' . ucfirst($actionName); - if (!class_exists($class)) { - throw new Error('Could not find an action ['.ucfirst($actionName).'], class ['.$class.'].'); - } + if (!class_exists($class)) { + throw new Error('Could not find an action ['.ucfirst($actionName).'], class ['.$class.'].'); + } - $this->objects[$managerName][$actionName] = new $class($this->container, $this); - } + $this->objects[$managerName][$actionName] = new $class($this->container, $this); + } - return $this->objects[$managerName][$actionName]; - } + return $this->objects[$managerName][$actionName]; + } } \ No newline at end of file diff --git a/application/Espo/Core/Upgrades/Actions/Base.php b/application/Espo/Core/Upgrades/Actions/Base.php index fb270cf0b9..be12914e85 100644 --- a/application/Espo/Core/Upgrades/Actions/Base.php +++ b/application/Espo/Core/Upgrades/Actions/Base.php @@ -23,466 +23,466 @@ namespace Espo\Core\Upgrades\Actions; use Espo\Core\Utils\Util, - Espo\Core\Utils\Json, - Espo\Core\Exceptions\Error; + Espo\Core\Utils\Json, + Espo\Core\Exceptions\Error; abstract class Base { - private $container; + private $container; - private $actionManager; + private $actionManager; - private $zipUtil; + private $zipUtil; - private $fileManager; - - private $config; + private $fileManager; + + private $config; - private $entityManager; - - protected $data; - - protected $params = null; - - protected $processId = null; + private $entityManager; + + protected $data; + + protected $params = null; + + protected $processId = null; - protected $manifestName = 'manifest.json'; - - protected $packagePostfix = 'z'; - - /** - * Directory name of files in a package - */ - const FILES = 'files'; + protected $manifestName = 'manifest.json'; + + protected $packagePostfix = 'z'; + + /** + * Directory name of files in a package + */ + const FILES = 'files'; - /** - * Directory name of scripts in a package - */ - const SCRIPTS = 'scripts'; - - /** - * Package types - */ - protected $packageTypes = array( - 'upgrade' => 'upgrade', - 'extension' => 'extension', - ); - - /** - * Default package type - */ - protected $defaultPackageType = 'extension'; - - - public function __construct(\Espo\Core\Container $container, \Espo\Core\Upgrades\ActionManager $actionManager) - { - $this->container = $container; - $this->actionManager = $actionManager; - $this->params = $actionManager->getParams(); - - $this->zipUtil = new \Espo\Core\Utils\File\ZipArchive($container->get('fileManager')); - } - - public function __destruct() - { - $this->processId = null; - $this->data = null; - } - - protected function getContainer() - { - return $this->container; - } - - protected function getActionManager() - { - return $this->actionManager; - } - - protected function getParams($name = null) - { - if (isset($this->params[$name])) { - return $this->params[$name]; - } - - return $this->params; - } - - protected function getZipUtil() - { - return $this->zipUtil; - } - - protected function getFileManager() - { - if (!isset($this->fileManager)) { - $this->fileManager = $this->getContainer()->get('fileManager'); - } - return $this->fileManager; - } - - protected function getConfig() - { - if (!isset($this->config)) { - $this->config = $this->getContainer()->get('config'); - } - return $this->config; - } - - protected function getEntityManager() - { - if (!isset($this->entityManager)) { - $this->entityManager = $this->getContainer()->get('entityManager'); - } - return $this->entityManager; - } - - protected function throwErrorAndRemovePackage($errorMessage = '') - { - $this->deletePackageFiles(); - $this->deletePackageArchive(); - throw new Error($errorMessage); - } - - abstract public function run($data); - - protected function createProcessId() - { - if (isset($this->processId)) { - throw new Error('Another installation process is currently running.'); - } - - $this->processId = uniqid(); - - return $this->processId; - } - - protected function getProcessId() - { - if (!isset($this->processId)) { - throw new Error('Installation ID was not specified.'); - } - - return $this->processId; - } - - protected function setProcessId($processId) - { - $this->processId = $processId; - } - - /** - * Check if version of upgrade/extension is acceptable to current version of EspoCRM - * - * @param string $version - * @return boolean - */ - protected function isAcceptable() - { - $res = $this->checkPackageType(); - $res &= $this->checkVersions(); - - return (bool) $res; - } - - protected function checkVersions() - { - $manifest = $this->getManifest(); - - /** check acceptable versions */ - $version = $manifest['acceptableVersions']; - if (empty($version)) { - return true; - } - - $currentVersion = $this->getConfig()->get('version'); - - if (is_string($version)) { - $version = (array) $version; - } - - foreach ($version as $strVersion) { - - $strVersion = trim($strVersion); - - if ($strVersion == $currentVersion) { - return true; - } - - $strVersion = str_replace('\\', '', $strVersion); - $strVersion = preg_quote($strVersion); - $strVersion = str_replace('\\*', '+', $strVersion); - - if (preg_match('/^'.$strVersion.'/', $currentVersion)) { - return true; - } - } - - $this->throwErrorAndRemovePackage('Your EspoCRM version doesn\'t match for this installation package.'); - } - - protected function checkPackageType() - { - $manifest = $this->getManifest(); - - /** check package type */ - $type = strtolower( $this->getParams('name') ); - $manifestType = isset($manifest['type']) ? strtolower($manifest['type']) : $this->defaultPackageType; - - if (!in_array($manifestType, $this->packageTypes)) { - $this->throwErrorAndRemovePackage('Unknown package type.'); - } - - if ($type != $manifestType) { - $this->throwErrorAndRemovePackage('Wrong package type. You cannot install '.$manifestType.' package via '.ucfirst($type).' Manager.'); - } - - return true; - } - - /** - * Run scripts by type - * @param string $type Ex. "before", "after" - * @return void - */ - protected function runScript($type) - { - $packagePath = $this->getPackagePath(); - $scriptNames = $this->getParams('scriptNames'); - - $scriptName = $scriptNames[$type]; - if (!isset($scriptName)) { - return; - } - - $beforeInstallScript = Util::concatPath( array($packagePath, self::SCRIPTS, $scriptName) ) . '.php'; - - if (file_exists($beforeInstallScript)) { - require_once($beforeInstallScript); - $script = new $scriptName(); - - try { - $script->run($this->getContainer()); - } catch (\Exception $e) { - $this->throwErrorAndRemovePackage($e->getMessage()); - } - } - } - - /** - * Get package path - * - * @param string $processId - * @return string - */ - protected function getPath($name = 'packagePath', $isPackage = false) - { - $postfix = $isPackage ? $this->packagePostfix : ''; - - $processId = $this->getProcessId(); - $path = Util::concatPath($this->getParams($name), $processId); - - return $path . $postfix; - } - - protected function getPackagePath($isPackage = false) - { - return $this->getPath('packagePath', $isPackage); - } - - /** - * Get a list of files defined in manifest.json - * - * @return [type] [description] - */ - protected function getDeleteFileList() - { - $manifest = $this->getManifest(); - - if (!empty($manifest['delete'])) { - return $manifest['delete']; - } - - return array(); - } - - /** - * Delete files defined in a manifest - * - * @return boolen - */ - protected function deleteFiles() - { - $deleteFileList = $this->getDeleteFileList(); - - if (!empty($deleteFileList)) { - return $this->getFileManager()->remove($deleteFileList); - } - - return true; - } - - protected function getCopyFileList() - { - if (!isset($this->data['fileList'])) { - $packagePath = $this->getPackagePath(); - $filesPath = Util::concatPath($packagePath, self::FILES); - - $this->data['fileList'] = $this->getFileManager()->getFileList($filesPath, true, '', 'all', true); - } - - return $this->data['fileList']; - } - - protected function copy($sourcePath, $destPath, $recursively = false, array $fileList = null, $copyOnlyFiles = false) - { - try { - $res = $this->getFileManager()->copy($sourcePath, $destPath, $recursively, $fileList, $copyOnlyFiles); - } catch (\Exception $e) { - $this->throwErrorAndRemovePackage($e->getMessage()); - } - - return $res; - } - - /** - * Copy files from upgrade/extension package - * - * @param string $processId - * @return boolean - */ - protected function copyFiles() - { - $packagePath = $this->getPackagePath(); - $filesPath = Util::concatPath($packagePath, self::FILES); - - return $this->copy($filesPath, '', true); - } - - public function getManifest() - { - if (!isset($this->data['manifest'])) { - $packagePath = $this->getPackagePath(); - - $manifestPath = Util::concatPath($packagePath, $this->manifestName); - if (!file_exists($manifestPath)) { - $this->throwErrorAndRemovePackage('It\'s not an Installation package.'); - } - - $manifestJson = $this->getFileManager()->getContents($manifestPath); - $this->data['manifest'] = Json::decode($manifestJson, true); - - if (!$this->data['manifest']) { - $this->throwErrorAndRemovePackage('Syntax error in manifest.json.'); - } - - if (!$this->checkManifest($this->data['manifest'])) { - $this->throwErrorAndRemovePackage('Unsupported package.'); - } - } - - return $this->data['manifest']; - } - - /** - * Check if the manifest is correct - * - * @param array $manifest - * @return boolean - */ - protected function checkManifest(array $manifest) - { - $requiredFields = array( - 'name', - 'version', - ); - - foreach ($requiredFields as $fieldName) { - if (empty($manifest[$fieldName])) { - return false; - } - } - - return true; - } - - /** - * Unzip a package archieve - * - * @return void - */ - protected function unzipArchive($packagePath = null) - { - $packagePath = isset($packagePath) ? $packagePath : $this->getPackagePath(); - $packageArchivePath = $this->getPackagePath(true); - - if (!file_exists($packageArchivePath)) { - throw new Error('Package Archive doesn\'t exist.'); - } - - $res = $this->getZipUtil()->unzip($packageArchivePath, $packagePath); - if ($res === false) { - throw new Error('Unnable to unzip the file - '.$packagePath.'.'); - } - } - - /** - * Delete temporary package files - * - * @return boolean - */ - protected function deletePackageFiles() - { - $packagePath = $this->getPackagePath(); - $res = $this->getFileManager()->removeInDir($packagePath, true); - - return $res; - } - - /** - * Delete temporary package archive - * - * @return boolean - */ - protected function deletePackageArchive() - { - $packageArchive = $this->getPackagePath(true); - $res = $this->getFileManager()->removeFile($packageArchive); - - return $res; - } - - protected function systemRebuild() - { - return $this->getContainer()->get('dataManager')->rebuild(); - } - - /** - * Execute an action. For ex., execute uninstall action in install - * - * @param [type] $actionName [description] - * @param [type] $data [description] - * @return [type] [description] - */ - protected function executeAction($actionName, $data) - { - $currentAction = $this->getActionManager()->getAction(); - - $this->getActionManager()->setAction($actionName); - $this->getActionManager()->run($data); - - $this->getActionManager()->setAction($currentAction); - } - - protected function beforeRunAction() - { - - } - - protected function afterRunAction() - { - - } + /** + * Directory name of scripts in a package + */ + const SCRIPTS = 'scripts'; + + /** + * Package types + */ + protected $packageTypes = array( + 'upgrade' => 'upgrade', + 'extension' => 'extension', + ); + + /** + * Default package type + */ + protected $defaultPackageType = 'extension'; + + + public function __construct(\Espo\Core\Container $container, \Espo\Core\Upgrades\ActionManager $actionManager) + { + $this->container = $container; + $this->actionManager = $actionManager; + $this->params = $actionManager->getParams(); + + $this->zipUtil = new \Espo\Core\Utils\File\ZipArchive($container->get('fileManager')); + } + + public function __destruct() + { + $this->processId = null; + $this->data = null; + } + + protected function getContainer() + { + return $this->container; + } + + protected function getActionManager() + { + return $this->actionManager; + } + + protected function getParams($name = null) + { + if (isset($this->params[$name])) { + return $this->params[$name]; + } + + return $this->params; + } + + protected function getZipUtil() + { + return $this->zipUtil; + } + + protected function getFileManager() + { + if (!isset($this->fileManager)) { + $this->fileManager = $this->getContainer()->get('fileManager'); + } + return $this->fileManager; + } + + protected function getConfig() + { + if (!isset($this->config)) { + $this->config = $this->getContainer()->get('config'); + } + return $this->config; + } + + protected function getEntityManager() + { + if (!isset($this->entityManager)) { + $this->entityManager = $this->getContainer()->get('entityManager'); + } + return $this->entityManager; + } + + protected function throwErrorAndRemovePackage($errorMessage = '') + { + $this->deletePackageFiles(); + $this->deletePackageArchive(); + throw new Error($errorMessage); + } + + abstract public function run($data); + + protected function createProcessId() + { + if (isset($this->processId)) { + throw new Error('Another installation process is currently running.'); + } + + $this->processId = uniqid(); + + return $this->processId; + } + + protected function getProcessId() + { + if (!isset($this->processId)) { + throw new Error('Installation ID was not specified.'); + } + + return $this->processId; + } + + protected function setProcessId($processId) + { + $this->processId = $processId; + } + + /** + * Check if version of upgrade/extension is acceptable to current version of EspoCRM + * + * @param string $version + * @return boolean + */ + protected function isAcceptable() + { + $res = $this->checkPackageType(); + $res &= $this->checkVersions(); + + return (bool) $res; + } + + protected function checkVersions() + { + $manifest = $this->getManifest(); + + /** check acceptable versions */ + $version = $manifest['acceptableVersions']; + if (empty($version)) { + return true; + } + + $currentVersion = $this->getConfig()->get('version'); + + if (is_string($version)) { + $version = (array) $version; + } + + foreach ($version as $strVersion) { + + $strVersion = trim($strVersion); + + if ($strVersion == $currentVersion) { + return true; + } + + $strVersion = str_replace('\\', '', $strVersion); + $strVersion = preg_quote($strVersion); + $strVersion = str_replace('\\*', '+', $strVersion); + + if (preg_match('/^'.$strVersion.'/', $currentVersion)) { + return true; + } + } + + $this->throwErrorAndRemovePackage('Your EspoCRM version doesn\'t match for this installation package.'); + } + + protected function checkPackageType() + { + $manifest = $this->getManifest(); + + /** check package type */ + $type = strtolower( $this->getParams('name') ); + $manifestType = isset($manifest['type']) ? strtolower($manifest['type']) : $this->defaultPackageType; + + if (!in_array($manifestType, $this->packageTypes)) { + $this->throwErrorAndRemovePackage('Unknown package type.'); + } + + if ($type != $manifestType) { + $this->throwErrorAndRemovePackage('Wrong package type. You cannot install '.$manifestType.' package via '.ucfirst($type).' Manager.'); + } + + return true; + } + + /** + * Run scripts by type + * @param string $type Ex. "before", "after" + * @return void + */ + protected function runScript($type) + { + $packagePath = $this->getPackagePath(); + $scriptNames = $this->getParams('scriptNames'); + + $scriptName = $scriptNames[$type]; + if (!isset($scriptName)) { + return; + } + + $beforeInstallScript = Util::concatPath( array($packagePath, self::SCRIPTS, $scriptName) ) . '.php'; + + if (file_exists($beforeInstallScript)) { + require_once($beforeInstallScript); + $script = new $scriptName(); + + try { + $script->run($this->getContainer()); + } catch (\Exception $e) { + $this->throwErrorAndRemovePackage($e->getMessage()); + } + } + } + + /** + * Get package path + * + * @param string $processId + * @return string + */ + protected function getPath($name = 'packagePath', $isPackage = false) + { + $postfix = $isPackage ? $this->packagePostfix : ''; + + $processId = $this->getProcessId(); + $path = Util::concatPath($this->getParams($name), $processId); + + return $path . $postfix; + } + + protected function getPackagePath($isPackage = false) + { + return $this->getPath('packagePath', $isPackage); + } + + /** + * Get a list of files defined in manifest.json + * + * @return [type] [description] + */ + protected function getDeleteFileList() + { + $manifest = $this->getManifest(); + + if (!empty($manifest['delete'])) { + return $manifest['delete']; + } + + return array(); + } + + /** + * Delete files defined in a manifest + * + * @return boolen + */ + protected function deleteFiles() + { + $deleteFileList = $this->getDeleteFileList(); + + if (!empty($deleteFileList)) { + return $this->getFileManager()->remove($deleteFileList); + } + + return true; + } + + protected function getCopyFileList() + { + if (!isset($this->data['fileList'])) { + $packagePath = $this->getPackagePath(); + $filesPath = Util::concatPath($packagePath, self::FILES); + + $this->data['fileList'] = $this->getFileManager()->getFileList($filesPath, true, '', 'all', true); + } + + return $this->data['fileList']; + } + + protected function copy($sourcePath, $destPath, $recursively = false, array $fileList = null, $copyOnlyFiles = false) + { + try { + $res = $this->getFileManager()->copy($sourcePath, $destPath, $recursively, $fileList, $copyOnlyFiles); + } catch (\Exception $e) { + $this->throwErrorAndRemovePackage($e->getMessage()); + } + + return $res; + } + + /** + * Copy files from upgrade/extension package + * + * @param string $processId + * @return boolean + */ + protected function copyFiles() + { + $packagePath = $this->getPackagePath(); + $filesPath = Util::concatPath($packagePath, self::FILES); + + return $this->copy($filesPath, '', true); + } + + public function getManifest() + { + if (!isset($this->data['manifest'])) { + $packagePath = $this->getPackagePath(); + + $manifestPath = Util::concatPath($packagePath, $this->manifestName); + if (!file_exists($manifestPath)) { + $this->throwErrorAndRemovePackage('It\'s not an Installation package.'); + } + + $manifestJson = $this->getFileManager()->getContents($manifestPath); + $this->data['manifest'] = Json::decode($manifestJson, true); + + if (!$this->data['manifest']) { + $this->throwErrorAndRemovePackage('Syntax error in manifest.json.'); + } + + if (!$this->checkManifest($this->data['manifest'])) { + $this->throwErrorAndRemovePackage('Unsupported package.'); + } + } + + return $this->data['manifest']; + } + + /** + * Check if the manifest is correct + * + * @param array $manifest + * @return boolean + */ + protected function checkManifest(array $manifest) + { + $requiredFields = array( + 'name', + 'version', + ); + + foreach ($requiredFields as $fieldName) { + if (empty($manifest[$fieldName])) { + return false; + } + } + + return true; + } + + /** + * Unzip a package archieve + * + * @return void + */ + protected function unzipArchive($packagePath = null) + { + $packagePath = isset($packagePath) ? $packagePath : $this->getPackagePath(); + $packageArchivePath = $this->getPackagePath(true); + + if (!file_exists($packageArchivePath)) { + throw new Error('Package Archive doesn\'t exist.'); + } + + $res = $this->getZipUtil()->unzip($packageArchivePath, $packagePath); + if ($res === false) { + throw new Error('Unnable to unzip the file - '.$packagePath.'.'); + } + } + + /** + * Delete temporary package files + * + * @return boolean + */ + protected function deletePackageFiles() + { + $packagePath = $this->getPackagePath(); + $res = $this->getFileManager()->removeInDir($packagePath, true); + + return $res; + } + + /** + * Delete temporary package archive + * + * @return boolean + */ + protected function deletePackageArchive() + { + $packageArchive = $this->getPackagePath(true); + $res = $this->getFileManager()->removeFile($packageArchive); + + return $res; + } + + protected function systemRebuild() + { + return $this->getContainer()->get('dataManager')->rebuild(); + } + + /** + * Execute an action. For ex., execute uninstall action in install + * + * @param [type] $actionName [description] + * @param [type] $data [description] + * @return [type] [description] + */ + protected function executeAction($actionName, $data) + { + $currentAction = $this->getActionManager()->getAction(); + + $this->getActionManager()->setAction($actionName); + $this->getActionManager()->run($data); + + $this->getActionManager()->setAction($currentAction); + } + + protected function beforeRunAction() + { + + } + + protected function afterRunAction() + { + + } } diff --git a/application/Espo/Core/Upgrades/Actions/Base/Delete.php b/application/Espo/Core/Upgrades/Actions/Base/Delete.php index 210dceb73d..445f6b7209 100644 --- a/application/Espo/Core/Upgrades/Actions/Base/Delete.php +++ b/application/Espo/Core/Upgrades/Actions/Base/Delete.php @@ -24,32 +24,32 @@ namespace Espo\Core\Upgrades\Actions\Base; class Delete extends \Espo\Core\Upgrades\Actions\Base { - public function run($processId) - { - $GLOBALS['log']->debug('Delete package process ['.$processId.']: start run.'); + public function run($processId) + { + $GLOBALS['log']->debug('Delete package process ['.$processId.']: start run.'); - if (empty($processId)) { - throw new Error('Delete package package ID was not specified.'); - } + if (empty($processId)) { + throw new Error('Delete package package ID was not specified.'); + } - $this->setProcessId($processId); + $this->setProcessId($processId); - $this->beforeRunAction(); + $this->beforeRunAction(); - /* delete a package */ - $this->deletePackage(); + /* delete a package */ + $this->deletePackage(); - $this->afterRunAction(); + $this->afterRunAction(); - $GLOBALS['log']->debug('Delete package process ['.$processId.']: end run.'); - } + $GLOBALS['log']->debug('Delete package process ['.$processId.']: end run.'); + } - protected function deletePackage() - { - $packageArchivePath = $this->getPackagePath(true); - $res = $this->getFileManager()->removeFile($packageArchivePath); + protected function deletePackage() + { + $packageArchivePath = $this->getPackagePath(true); + $res = $this->getFileManager()->removeFile($packageArchivePath); - return $res; - } + return $res; + } } \ No newline at end of file diff --git a/application/Espo/Core/Upgrades/Actions/Base/Install.php b/application/Espo/Core/Upgrades/Actions/Base/Install.php index 4eb235165d..c1e0c83080 100644 --- a/application/Espo/Core/Upgrades/Actions/Base/Install.php +++ b/application/Espo/Core/Upgrades/Actions/Base/Install.php @@ -26,87 +26,87 @@ use Espo\Core\Exceptions\Error; class Install extends \Espo\Core\Upgrades\Actions\Base { - /** - * Is copied extension files to Espo - * - * @var [type] - */ - protected $isCopied = null; + /** + * Is copied extension files to Espo + * + * @var [type] + */ + protected $isCopied = null; - /** - * Main installation process - * - * @param string $processId Upgrade/Extension ID, gotten in upload stage - * @return bool - */ - public function run($processId) - { - $GLOBALS['log']->debug('Installation process ['.$processId.']: start run.'); + /** + * Main installation process + * + * @param string $processId Upgrade/Extension ID, gotten in upload stage + * @return bool + */ + public function run($processId) + { + $GLOBALS['log']->debug('Installation process ['.$processId.']: start run.'); - if (empty($processId)) { - throw new Error('Installation package ID was not specified.'); - } + if (empty($processId)) { + throw new Error('Installation package ID was not specified.'); + } - $this->setProcessId($processId); + $this->setProcessId($processId); - $this->isCopied = false; + $this->isCopied = false; - /** check if an archive is unzipped, if no then unzip */ - $packagePath = $this->getPackagePath(); - if (!file_exists($packagePath)) { - $this->unzipArchive(); - $this->isAcceptable(); - } + /** check if an archive is unzipped, if no then unzip */ + $packagePath = $this->getPackagePath(); + if (!file_exists($packagePath)) { + $this->unzipArchive(); + $this->isAcceptable(); + } - $this->beforeRunAction(); + $this->beforeRunAction(); - /* run before install script */ - $this->runScript('before'); + /* run before install script */ + $this->runScript('before'); - /* remove files defined in a manifest */ - if (!$this->deleteFiles()) { - $this->throwErrorAndRemovePackage('Permission denied to delete files.'); - } + /* remove files defined in a manifest */ + if (!$this->deleteFiles()) { + $this->throwErrorAndRemovePackage('Permission denied to delete files.'); + } - /* copy files from directory "Files" to EspoCRM files */ - if (!$this->copyFiles()) { - $this->throwErrorAndRemovePackage('Cannot copy files.'); - } - $this->isCopied = true; + /* copy files from directory "Files" to EspoCRM files */ + if (!$this->copyFiles()) { + $this->throwErrorAndRemovePackage('Cannot copy files.'); + } + $this->isCopied = true; - if (!$this->systemRebuild()) { - $this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.'); - } + if (!$this->systemRebuild()) { + $this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.'); + } - /* run before install script */ - $this->runScript('after'); + /* run before install script */ + $this->runScript('after'); - $this->afterRunAction(); + $this->afterRunAction(); - /* delete unziped files */ - $this->deletePackageFiles(); + /* delete unziped files */ + $this->deletePackageFiles(); - $GLOBALS['log']->debug('Installation process ['.$processId.']: end run.'); - } + $GLOBALS['log']->debug('Installation process ['.$processId.']: end run.'); + } - protected function restoreFiles() - { - $backupPath = $this->getPath('backupPath'); + protected function restoreFiles() + { + $backupPath = $this->getPath('backupPath'); - $res = true; - if ($this->isCopied) { - $res &= $this->copy(array($backupPath, self::FILES), '', true); - $GLOBALS['log']->info('Restore: copy back'); - } + $res = true; + if ($this->isCopied) { + $res &= $this->copy(array($backupPath, self::FILES), '', true); + $GLOBALS['log']->info('Restore: copy back'); + } - $res &= $this->getFileManager()->removeInDir($backupPath, true); + $res &= $this->getFileManager()->removeInDir($backupPath, true); - return $res; - } + return $res; + } - protected function throwErrorAndRemovePackage($errorMessage = '') - { - $this->restoreFiles(); - parent::throwErrorAndRemovePackage($errorMessage); - } + protected function throwErrorAndRemovePackage($errorMessage = '') + { + $this->restoreFiles(); + parent::throwErrorAndRemovePackage($errorMessage); + } } diff --git a/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php b/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php index 68528b50bd..717a98ca50 100644 --- a/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php +++ b/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php @@ -23,110 +23,110 @@ namespace Espo\Core\Upgrades\Actions\Base; use Espo\Core\Exceptions\Error, - Espo\Core\Utils\Util; + Espo\Core\Utils\Util; class Uninstall extends \Espo\Core\Upgrades\Actions\Base { - public function run($processId) - { - $GLOBALS['log']->debug('Uninstallation process ['.$processId.']: start run.'); + public function run($processId) + { + $GLOBALS['log']->debug('Uninstallation process ['.$processId.']: start run.'); - if (empty($processId)) { - throw new Error('Uninstallation package ID was not specified.'); - } + if (empty($processId)) { + throw new Error('Uninstallation package ID was not specified.'); + } - $this->setProcessId($processId); + $this->setProcessId($processId); - $this->beforeRunAction(); + $this->beforeRunAction(); - /* run before install script */ - $this->runScript('beforeUninstall'); + /* run before install script */ + $this->runScript('beforeUninstall'); - $backupPath = $this->getPath('backupPath'); - if (file_exists($backupPath)) { + $backupPath = $this->getPath('backupPath'); + if (file_exists($backupPath)) { - /* remove extension files, saved in fileList */ - if (!$this->deleteFiles()) { - throw new Error('Permission denied to delete files.'); - } + /* remove extension files, saved in fileList */ + if (!$this->deleteFiles()) { + throw new Error('Permission denied to delete files.'); + } - /* copy core files */ - if (!$this->copyFiles()) { - throw new Error('Cannot copy files.'); - } - } + /* copy core files */ + if (!$this->copyFiles()) { + throw new Error('Cannot copy files.'); + } + } - if (!$this->systemRebuild()) { - throw new Error('Error occurred while EspoCRM rebuild.'); - } + if (!$this->systemRebuild()) { + throw new Error('Error occurred while EspoCRM rebuild.'); + } - /* run before install script */ - $this->runScript('afterUninstall'); + /* run before install script */ + $this->runScript('afterUninstall'); - $this->afterRunAction(); + $this->afterRunAction(); - /* delete backup files */ - $this->deletePackageFiles(); + /* delete backup files */ + $this->deletePackageFiles(); - $GLOBALS['log']->debug('Uninstallation process ['.$processId.']: end run.'); - } + $GLOBALS['log']->debug('Uninstallation process ['.$processId.']: end run.'); + } - protected function getDeleteFileList() - { - $extensionEntity = $this->getExtensionEntity(); - return $extensionEntity->get('fileList'); - } + protected function getDeleteFileList() + { + $extensionEntity = $this->getExtensionEntity(); + return $extensionEntity->get('fileList'); + } - protected function restoreFiles() - { - $packagePath = $this->getPath('packagePath'); - $filesPath = Util::concatPath($packagePath, self::FILES); + protected function restoreFiles() + { + $packagePath = $this->getPath('packagePath'); + $filesPath = Util::concatPath($packagePath, self::FILES); - if (!file_exists($filesPath)) { - $this->unzipArchive($packagePath); - } + if (!file_exists($filesPath)) { + $this->unzipArchive($packagePath); + } - $res = $this->copy($filesPath, '', true); - $res &= $this->getFileManager()->removeInDir($packagePath, true); + $res = $this->copy($filesPath, '', true); + $res &= $this->getFileManager()->removeInDir($packagePath, true); - return $res; - } + return $res; + } - protected function copyFiles() - { - $backupPath = $this->getPath('backupPath'); - $res = $this->copy(array($backupPath, self::FILES), '', true); + protected function copyFiles() + { + $backupPath = $this->getPath('backupPath'); + $res = $this->copy(array($backupPath, self::FILES), '', true); - return $res; - } + return $res; + } - /** - * Get backup path - * - * @param string $processId - * @return string - */ - protected function getPackagePath($isPackage = false) - { - if ($isPackage) { - return $this->getPath('packagePath', $isPackage); - } + /** + * Get backup path + * + * @param string $processId + * @return string + */ + protected function getPackagePath($isPackage = false) + { + if ($isPackage) { + return $this->getPath('packagePath', $isPackage); + } - return $this->getPath('backupPath'); - } + return $this->getPath('backupPath'); + } - protected function deletePackageFiles() - { - $backupPath = $this->getPath('backupPath'); - $res = $this->getFileManager()->removeInDir($backupPath, true); + protected function deletePackageFiles() + { + $backupPath = $this->getPath('backupPath'); + $res = $this->getFileManager()->removeInDir($backupPath, true); - return $res; - } + return $res; + } - protected function throwErrorAndRemovePackage($errorMessage = '') - { - $this->restoreFiles(); - throw new Error($errorMessage); - } + protected function throwErrorAndRemovePackage($errorMessage = '') + { + $this->restoreFiles(); + throw new Error($errorMessage); + } } diff --git a/application/Espo/Core/Upgrades/Actions/Base/Upload.php b/application/Espo/Core/Upgrades/Actions/Base/Upload.php index aff8d61a84..9a4d7bfd3a 100644 --- a/application/Espo/Core/Upgrades/Actions/Base/Upload.php +++ b/application/Espo/Core/Upgrades/Actions/Base/Upload.php @@ -26,37 +26,37 @@ use Espo\Core\Exceptions\Error; class Upload extends \Espo\Core\Upgrades\Actions\Base { - /** - * Upload an upgrade/extension package - * - * @param [type] $contents - * @return string ID of upgrade/extension process - */ - public function run($data) - { - $processId = $this->createProcessId(); + /** + * Upload an upgrade/extension package + * + * @param [type] $contents + * @return string ID of upgrade/extension process + */ + public function run($data) + { + $processId = $this->createProcessId(); - $GLOBALS['log']->debug('Installation process ['.$processId.']: start upload the package.'); + $GLOBALS['log']->debug('Installation process ['.$processId.']: start upload the package.'); - $packagePath = $this->getPackagePath(); - $packageArchivePath = $this->getPackagePath(true); + $packagePath = $this->getPackagePath(); + $packageArchivePath = $this->getPackagePath(true); - if (!empty($data)) { - list($prefix, $contents) = explode(',', $data); - $contents = base64_decode($contents); - } + if (!empty($data)) { + list($prefix, $contents) = explode(',', $data); + $contents = base64_decode($contents); + } - $res = $this->getFileManager()->putContents($packageArchivePath, $contents); - if ($res === false) { - throw new Error('Could not upload the package.'); - } + $res = $this->getFileManager()->putContents($packageArchivePath, $contents); + if ($res === false) { + throw new Error('Could not upload the package.'); + } - $this->unzipArchive(); + $this->unzipArchive(); - $this->isAcceptable(); + $this->isAcceptable(); - $GLOBALS['log']->debug('Installation process ['.$processId.']: end upload the package.'); + $GLOBALS['log']->debug('Installation process ['.$processId.']: end upload the package.'); - return $processId; - } + return $processId; + } } \ No newline at end of file diff --git a/application/Espo/Core/Upgrades/Actions/Extension/Delete.php b/application/Espo/Core/Upgrades/Actions/Extension/Delete.php index 4edc165261..cc8ad25a32 100644 --- a/application/Espo/Core/Upgrades/Actions/Extension/Delete.php +++ b/application/Espo/Core/Upgrades/Actions/Extension/Delete.php @@ -26,44 +26,44 @@ use Espo\Core\Exceptions\Error; class Delete extends \Espo\Core\Upgrades\Actions\Base\Delete { - protected $extensionEntity; + protected $extensionEntity; - /** - * Get entity of this extension - * - * @return \Espo\Entities\Extension - */ - protected function getExtensionEntity() - { - return $this->extensionEntity; - } + /** + * Get entity of this extension + * + * @return \Espo\Entities\Extension + */ + protected function getExtensionEntity() + { + return $this->extensionEntity; + } - /** - * Set Extension Entity - * - * @param \Espo\Entities\Extension $extensionEntity - */ - protected function setExtensionEntity(\Espo\Entities\Extension $extensionEntity) - { - $this->extensionEntity = $extensionEntity; - } + /** + * Set Extension Entity + * + * @param \Espo\Entities\Extension $extensionEntity + */ + protected function setExtensionEntity(\Espo\Entities\Extension $extensionEntity) + { + $this->extensionEntity = $extensionEntity; + } - protected function beforeRunAction() - { - $processId = $this->getProcessId(); + protected function beforeRunAction() + { + $processId = $this->getProcessId(); - /** get extension entity */ - $extensionEntity = $this->getEntityManager()->getEntity('Extension', $processId); - if (!isset($extensionEntity)) { - throw new Error('Extension Entity not found.'); - } - $this->setExtensionEntity($extensionEntity); - } + /** get extension entity */ + $extensionEntity = $this->getEntityManager()->getEntity('Extension', $processId); + if (!isset($extensionEntity)) { + throw new Error('Extension Entity not found.'); + } + $this->setExtensionEntity($extensionEntity); + } - protected function afterRunAction() - { - /** Delete extension entity */ - $extensionEntity = $this->getExtensionEntity(); - $this->getEntityManager()->removeEntity($extensionEntity); - } + protected function afterRunAction() + { + /** Delete extension entity */ + $extensionEntity = $this->getExtensionEntity(); + $this->getEntityManager()->removeEntity($extensionEntity); + } } \ No newline at end of file diff --git a/application/Espo/Core/Upgrades/Actions/Extension/Install.php b/application/Espo/Core/Upgrades/Actions/Extension/Install.php index b5425c41b3..0221a7b7f0 100644 --- a/application/Espo/Core/Upgrades/Actions/Extension/Install.php +++ b/application/Espo/Core/Upgrades/Actions/Extension/Install.php @@ -23,205 +23,205 @@ namespace Espo\Core\Upgrades\Actions\Extension; use Espo\Core\Exceptions\Error, - Espo\Core\ExtensionManager; + Espo\Core\ExtensionManager; class Install extends \Espo\Core\Upgrades\Actions\Base\Install { - protected $extensionEntity = null; + protected $extensionEntity = null; - protected function beforeRunAction() - { - $this->findExtension(); - if (!$this->isNew()) { - $this->compareVersion(); - $this->uninstallExtension(); - $this->deleteExtension(); - } + protected function beforeRunAction() + { + $this->findExtension(); + if (!$this->isNew()) { + $this->compareVersion(); + $this->uninstallExtension(); + $this->deleteExtension(); + } - $this->copyExistingFiles(); - } + $this->copyExistingFiles(); + } - protected function afterRunAction() - { - $this->storeExtension(); - } + protected function afterRunAction() + { + $this->storeExtension(); + } - /** - * Copy Existing files to backup directory - * - * @return bool - */ - protected function copyExistingFiles() - { - $fileList = $this->getCopyFileList(); - $backupPath = $this->getPath('backupPath'); + /** + * Copy Existing files to backup directory + * + * @return bool + */ + protected function copyExistingFiles() + { + $fileList = $this->getCopyFileList(); + $backupPath = $this->getPath('backupPath'); - $res = $this->copy('', array($backupPath, self::FILES), false, $fileList); + $res = $this->copy('', array($backupPath, self::FILES), false, $fileList); - /** copy scripts files */ - $packagePath = $this->getPackagePath(); - $res &= $this->copy(array($packagePath, self::SCRIPTS), array($backupPath, self::SCRIPTS), true); + /** copy scripts files */ + $packagePath = $this->getPackagePath(); + $res &= $this->copy(array($packagePath, self::SCRIPTS), array($backupPath, self::SCRIPTS), true); - return $res; - } + return $res; + } - protected function restoreFiles() - { - $res = true; - if ($this->isCopied) { - $extensionFileList = $this->getCopyFileList(); - $res &= $this->getFileManager()->remove($extensionFileList); - } + protected function restoreFiles() + { + $res = true; + if ($this->isCopied) { + $extensionFileList = $this->getCopyFileList(); + $res &= $this->getFileManager()->remove($extensionFileList); + } - $res &= parent::restoreFiles(); + $res &= parent::restoreFiles(); - return $res; - } + return $res; + } - protected function isNew() - { - $extensionEntity = $this->getExtensionEntity(); + protected function isNew() + { + $extensionEntity = $this->getExtensionEntity(); - if (isset($extensionEntity)) { - $id = $this->getExtensionEntity()->get('id'); - } + if (isset($extensionEntity)) { + $id = $this->getExtensionEntity()->get('id'); + } - return isset($id) ? false : true; - } + return isset($id) ? false : true; + } - /** - * Get extension ID. It's an ID of existing entity (if available) or Installation ID - * - * @return string - */ - protected function getExtensionId() - { - $extensionEntity = $this->getExtensionEntity(); - if (isset($extensionEntity)) { - $extensionEntityId = $extensionEntity->get('id'); - } + /** + * Get extension ID. It's an ID of existing entity (if available) or Installation ID + * + * @return string + */ + protected function getExtensionId() + { + $extensionEntity = $this->getExtensionEntity(); + if (isset($extensionEntity)) { + $extensionEntityId = $extensionEntity->get('id'); + } - if (!isset($extensionEntityId)) { - return $this->getProcessId(); - } + if (!isset($extensionEntityId)) { + return $this->getProcessId(); + } - return $extensionEntityId; - } + return $extensionEntityId; + } - /** - * Get entity of this extension - * - * @return \Espo\Entities\Extension - */ - protected function getExtensionEntity() - { - return $this->extensionEntity; - } + /** + * Get entity of this extension + * + * @return \Espo\Entities\Extension + */ + protected function getExtensionEntity() + { + return $this->extensionEntity; + } - /** - * Find Extension entity - * - * @return \Espo\Entities\Extension - */ - protected function findExtension() - { - $manifest = $this->getManifest(); + /** + * Find Extension entity + * + * @return \Espo\Entities\Extension + */ + protected function findExtension() + { + $manifest = $this->getManifest(); - $this->extensionEntity = $this->getEntityManager()->getRepository('Extension')->where(array( - 'name' => $manifest['name'], - 'isInstalled' => true, - ))->findOne(); + $this->extensionEntity = $this->getEntityManager()->getRepository('Extension')->where(array( + 'name' => $manifest['name'], + 'isInstalled' => true, + ))->findOne(); - return $this->extensionEntity; - } + return $this->extensionEntity; + } - /** - * Create a record of Extension Entity - * - * @return bool - */ - protected function storeExtension() - { - $entityManager = $this->getEntityManager(); + /** + * Create a record of Extension Entity + * + * @return bool + */ + protected function storeExtension() + { + $entityManager = $this->getEntityManager(); - $extensionEntity = $entityManager->getEntity('Extension', $this->getProcessId()); - if (!isset($extensionEntity)) { - $extensionEntity = $entityManager->getEntity('Extension'); - } + $extensionEntity = $entityManager->getEntity('Extension', $this->getProcessId()); + if (!isset($extensionEntity)) { + $extensionEntity = $entityManager->getEntity('Extension'); + } - $manifest = $this->getManifest(); - $fileList = $this->getCopyFileList(); + $manifest = $this->getManifest(); + $fileList = $this->getCopyFileList(); - $data = array( - 'id' => $this->getProcessId(), - 'name' => $manifest['name'], - 'isInstalled' => true, - 'version' => $manifest['version'], - 'fileList' => $fileList, - 'description' => $manifest['description'], - ); - $extensionEntity->set($data); + $data = array( + 'id' => $this->getProcessId(), + 'name' => $manifest['name'], + 'isInstalled' => true, + 'version' => $manifest['version'], + 'fileList' => $fileList, + 'description' => $manifest['description'], + ); + $extensionEntity->set($data); - return $entityManager->saveEntity($extensionEntity); - } + return $entityManager->saveEntity($extensionEntity); + } - /** - * Compare version between installed and a new extensions - * - * @return void - */ - protected function compareVersion() - { - $manifest = $this->getManifest(); - $extensionEntity = $this->getExtensionEntity(); + /** + * Compare version between installed and a new extensions + * + * @return void + */ + protected function compareVersion() + { + $manifest = $this->getManifest(); + $extensionEntity = $this->getExtensionEntity(); - if (isset($extensionEntity)) { - $comparedVersion = version_compare($manifest['version'], $extensionEntity->get('version')); - if ($comparedVersion <= 0) { - $this->throwErrorAndRemovePackage('You cannot install an older version of this extension.'); - } - } - } + if (isset($extensionEntity)) { + $comparedVersion = version_compare($manifest['version'], $extensionEntity->get('version')); + if ($comparedVersion <= 0) { + $this->throwErrorAndRemovePackage('You cannot install an older version of this extension.'); + } + } + } - /** - * Throw an exception and remove package files. - * Redeclared to prevent of deleting a package of installed extension. - * - * @param string $errorMessage [description] - * @return [type] [description] - */ - protected function throwErrorAndRemovePackage($errorMessage = '') - { - if (!$this->isNew()) { - throw new Error($errorMessage); - } + /** + * Throw an exception and remove package files. + * Redeclared to prevent of deleting a package of installed extension. + * + * @param string $errorMessage [description] + * @return [type] [description] + */ + protected function throwErrorAndRemovePackage($errorMessage = '') + { + if (!$this->isNew()) { + throw new Error($errorMessage); + } - return parent::throwErrorAndRemovePackage($errorMessage); - } + return parent::throwErrorAndRemovePackage($errorMessage); + } - /** - * If extension already installed, uninstall an old version - * - * @return void - */ - protected function uninstallExtension() - { - $extensionEntity = $this->getExtensionEntity(); + /** + * If extension already installed, uninstall an old version + * + * @return void + */ + protected function uninstallExtension() + { + $extensionEntity = $this->getExtensionEntity(); - $this->executeAction(ExtensionManager::UNINSTALL, $extensionEntity->get('id')); - } + $this->executeAction(ExtensionManager::UNINSTALL, $extensionEntity->get('id')); + } - /** - * Delete extension package - * - * @return void - */ - protected function deleteExtension() - { - $extensionEntity = $this->getExtensionEntity(); + /** + * Delete extension package + * + * @return void + */ + protected function deleteExtension() + { + $extensionEntity = $this->getExtensionEntity(); - $this->executeAction(ExtensionManager::DELETE, $extensionEntity->get('id')); - } + $this->executeAction(ExtensionManager::DELETE, $extensionEntity->get('id')); + } diff --git a/application/Espo/Core/Upgrades/Actions/Extension/Uninstall.php b/application/Espo/Core/Upgrades/Actions/Extension/Uninstall.php index a405e6beea..bc8a4ded94 100644 --- a/application/Espo/Core/Upgrades/Actions/Extension/Uninstall.php +++ b/application/Espo/Core/Upgrades/Actions/Extension/Uninstall.php @@ -26,46 +26,46 @@ use Espo\Core\Exceptions\Error; class Uninstall extends \Espo\Core\Upgrades\Actions\Base\Uninstall { - protected $extensionEntity; + protected $extensionEntity; - /** - * Get entity of this extension - * - * @return \Espo\Entities\Extension - */ - protected function getExtensionEntity() - { - return $this->extensionEntity; - } + /** + * Get entity of this extension + * + * @return \Espo\Entities\Extension + */ + protected function getExtensionEntity() + { + return $this->extensionEntity; + } - /** - * Set Extension Entity - * - * @param \Espo\Entities\Extension $extensionEntity [description] - */ - protected function setExtensionEntity(\Espo\Entities\Extension $extensionEntity) - { - $this->extensionEntity = $extensionEntity; - } + /** + * Set Extension Entity + * + * @param \Espo\Entities\Extension $extensionEntity [description] + */ + protected function setExtensionEntity(\Espo\Entities\Extension $extensionEntity) + { + $this->extensionEntity = $extensionEntity; + } - protected function beforeRunAction() - { - $processId = $this->getProcessId(); + protected function beforeRunAction() + { + $processId = $this->getProcessId(); - /** get extension entity */ - $extensionEntity = $this->getEntityManager()->getEntity('Extension', $processId); - if (!isset($extensionEntity)) { - throw new Error('Extension Entity not found.'); - } - $this->setExtensionEntity($extensionEntity); - } + /** get extension entity */ + $extensionEntity = $this->getEntityManager()->getEntity('Extension', $processId); + if (!isset($extensionEntity)) { + throw new Error('Extension Entity not found.'); + } + $this->setExtensionEntity($extensionEntity); + } - protected function afterRunAction() - { - /** Set extension entity, isInstalled = false */ - $extensionEntity = $this->getExtensionEntity(); + protected function afterRunAction() + { + /** Set extension entity, isInstalled = false */ + $extensionEntity = $this->getExtensionEntity(); - $extensionEntity->set('isInstalled', false); - $this->getEntityManager()->saveEntity($extensionEntity); - } + $extensionEntity->set('isInstalled', false); + $this->getEntityManager()->saveEntity($extensionEntity); + } } \ No newline at end of file diff --git a/application/Espo/Core/Upgrades/Actions/Upgrade/Install.php b/application/Espo/Core/Upgrades/Actions/Upgrade/Install.php index bff4a69052..ec3b787293 100644 --- a/application/Espo/Core/Upgrades/Actions/Upgrade/Install.php +++ b/application/Espo/Core/Upgrades/Actions/Upgrade/Install.php @@ -24,29 +24,29 @@ namespace Espo\Core\Upgrades\Actions\Upgrade; class Install extends \Espo\Core\Upgrades\Actions\Base\Install { - protected function systemRebuild() - { - $manifest = $this->getManifest(); + protected function systemRebuild() + { + $manifest = $this->getManifest(); - $res = $this->getConfig()->set('version', $manifest['version']); - if (method_exists($this->getConfig(), 'save')) { - $res = $this->getConfig()->save(); - } - $res &= parent::systemRebuild(); + $res = $this->getConfig()->set('version', $manifest['version']); + if (method_exists($this->getConfig(), 'save')) { + $res = $this->getConfig()->save(); + } + $res &= parent::systemRebuild(); - return $res; - } + return $res; + } - /** - * Delete temporary package files - * - * @return boolean - */ - protected function deletePackageFiles() - { - $res = parent::deletePackageFiles(); - $res &= $this->deletePackageArchive(); + /** + * Delete temporary package files + * + * @return boolean + */ + protected function deletePackageFiles() + { + $res = parent::deletePackageFiles(); + $res &= $this->deletePackageArchive(); - return $res; - } + return $res; + } } diff --git a/application/Espo/Core/Upgrades/Base.php b/application/Espo/Core/Upgrades/Base.php index 66129556a3..ff351f4485 100644 --- a/application/Espo/Core/Upgrades/Base.php +++ b/application/Espo/Core/Upgrades/Base.php @@ -23,72 +23,72 @@ namespace Espo\Core\Upgrades; use Espo\Core\Utils\Util, - Espo\Core\Utils\Json, - Espo\Core\Exceptions\Error; + Espo\Core\Utils\Json, + Espo\Core\Exceptions\Error; abstract class Base { - private $container; + private $container; - protected $name = null; + protected $name = null; - protected $params = array(); + protected $params = array(); - const UPLOAD = 'upload'; + const UPLOAD = 'upload'; - const INSTALL = 'install'; + const INSTALL = 'install'; - const UNINSTALL = 'uninstall'; + const UNINSTALL = 'uninstall'; - const DELETE = 'delete'; + const DELETE = 'delete'; - public function __construct($container) - { - $this->container = $container; + public function __construct($container) + { + $this->container = $container; - $this->actionManager = new ActionManager($this->name, $container, $this->params); - } + $this->actionManager = new ActionManager($this->name, $container, $this->params); + } - protected function getContainer() - { - return $this->container; - } + protected function getContainer() + { + return $this->container; + } - protected function getActionManager() - { - return $this->actionManager; - } + protected function getActionManager() + { + return $this->actionManager; + } - public function getManifest() - { - return $this->getActionManager()->getManifest(); - } + public function getManifest() + { + return $this->getActionManager()->getManifest(); + } - public function upload($data) - { - $this->getActionManager()->setAction(self::UPLOAD); + public function upload($data) + { + $this->getActionManager()->setAction(self::UPLOAD); - return $this->getActionManager()->run($data); - } + return $this->getActionManager()->run($data); + } - public function install($processId) - { - $this->getActionManager()->setAction(self::INSTALL); + public function install($processId) + { + $this->getActionManager()->setAction(self::INSTALL); - return $this->getActionManager()->run($processId); - } + return $this->getActionManager()->run($processId); + } - public function uninstall($processId) - { - $this->getActionManager()->setAction(self::UNINSTALL); + public function uninstall($processId) + { + $this->getActionManager()->setAction(self::UNINSTALL); - return $this->getActionManager()->run($processId); - } + return $this->getActionManager()->run($processId); + } - public function delete($processId) - { - $this->getActionManager()->setAction(self::DELETE); + public function delete($processId) + { + $this->getActionManager()->setAction(self::DELETE); - return $this->getActionManager()->run($processId); - } + return $this->getActionManager()->run($processId); + } } diff --git a/application/Espo/Core/Utils/Api/Auth.php b/application/Espo/Core/Utils/Api/Auth.php index 5394fa16f1..d9ec0b96e7 100644 --- a/application/Espo/Core/Utils/Api/Auth.php +++ b/application/Espo/Core/Utils/Api/Auth.php @@ -26,108 +26,108 @@ use \Espo\Core\Utils\Api\Slim; class Auth extends \Slim\Middleware { - protected $auth; + protected $auth; - protected $authRequired = null; + protected $authRequired = null; - protected $showDialog = false; + protected $showDialog = false; - public function __construct(\Espo\Core\Utils\Auth $auth, $authRequired = null, $showDialog = false) - { - $this->auth = $auth; - $this->authRequired = $authRequired; - $this->showDialog = $showDialog; - } + public function __construct(\Espo\Core\Utils\Auth $auth, $authRequired = null, $showDialog = false) + { + $this->auth = $auth; + $this->authRequired = $authRequired; + $this->showDialog = $showDialog; + } - function call() - { - $req = $this->app->request(); + function call() + { + $req = $this->app->request(); - $uri = $req->getResourceUri(); - $httpMethod = $req->getMethod(); + $uri = $req->getResourceUri(); + $httpMethod = $req->getMethod(); - $authUsername = $req->headers('PHP_AUTH_USER'); - $authPassword = $req->headers('PHP_AUTH_PW'); + $authUsername = $req->headers('PHP_AUTH_USER'); + $authPassword = $req->headers('PHP_AUTH_PW'); - $espoAuth = $req->headers('HTTP_ESPO_AUTHORIZATION'); - if (isset($espoAuth)) { - list($authUsername, $authPassword) = explode(':', base64_decode($espoAuth)); - } + $espoAuth = $req->headers('HTTP_ESPO_AUTHORIZATION'); + if (isset($espoAuth)) { + list($authUsername, $authPassword) = explode(':', base64_decode($espoAuth)); + } - $espoCgiAuth = $req->headers('HTTP_ESPO_CGI_AUTH'); - if ( !isset($authUsername) && !isset($authPassword) && isset($espoCgiAuth) ) { - list($authUsername, $authPassword) = explode(':' , base64_decode(substr($espoCgiAuth, 6))); - } + $espoCgiAuth = $req->headers('HTTP_ESPO_CGI_AUTH'); + if ( !isset($authUsername) && !isset($authPassword) && isset($espoCgiAuth) ) { + list($authUsername, $authPassword) = explode(':' , base64_decode(substr($espoCgiAuth, 6))); + } - if (is_null($this->authRequired)) { - $routes = $this->app->router()->getMatchedRoutes($httpMethod, $uri); + if (is_null($this->authRequired)) { + $routes = $this->app->router()->getMatchedRoutes($httpMethod, $uri); - if (!empty($routes[0])) { - $routeConditions = $routes[0]->getConditions(); - if (isset($routeConditions['auth']) && $routeConditions['auth'] === false) { + if (!empty($routes[0])) { + $routeConditions = $routes[0]->getConditions(); + if (isset($routeConditions['auth']) && $routeConditions['auth'] === false) { - if ($authUsername && $authPassword) { - $isAuthenticated = $this->auth->login($authUsername, $authPassword); - if ($isAuthenticated) { - $this->next->call(); - return; - } - } + if ($authUsername && $authPassword) { + $isAuthenticated = $this->auth->login($authUsername, $authPassword); + if ($isAuthenticated) { + $this->next->call(); + return; + } + } - $this->auth->useNoAuth(); - $this->next->call(); - return; - } - } - } else { - if (!$this->authRequired) { - $this->auth->useNoAuth(); - $this->next->call(); - return; - } - } + $this->auth->useNoAuth(); + $this->next->call(); + return; + } + } + } else { + if (!$this->authRequired) { + $this->auth->useNoAuth(); + $this->next->call(); + return; + } + } - if ($authUsername && $authPassword) { + if ($authUsername && $authPassword) { - $isAuthenticated = $this->auth->login($authUsername, $authPassword); + $isAuthenticated = $this->auth->login($authUsername, $authPassword); - if ($isAuthenticated) { - $this->next->call(); - } else { - $this->processUnauthorized(); - } - } else { - if (!$this->isXMLHttpRequest()) { - $this->showDialog = true; - } - $this->processUnauthorized(); - } - } + if ($isAuthenticated) { + $this->next->call(); + } else { + $this->processUnauthorized(); + } + } else { + if (!$this->isXMLHttpRequest()) { + $this->showDialog = true; + } + $this->processUnauthorized(); + } + } - protected function processUnauthorized() - { - $res = $this->app->response(); + protected function processUnauthorized() + { + $res = $this->app->response(); - if ($this->showDialog) { - $res->header('WWW-Authenticate', 'Basic realm=""'); - } else { - $res->header('WWW-Authenticate'); - } - $res->status(401); - } + if ($this->showDialog) { + $res->header('WWW-Authenticate', 'Basic realm=""'); + } else { + $res->header('WWW-Authenticate'); + } + $res->status(401); + } - protected function isXMLHttpRequest() - { - $req = $this->app->request(); + protected function isXMLHttpRequest() + { + $req = $this->app->request(); - $httpXRequestedWith = $req->headers('HTTP_X_REQUESTED_WITH'); + $httpXRequestedWith = $req->headers('HTTP_X_REQUESTED_WITH'); - if (isset($httpXRequestedWith) && strtolower($httpXRequestedWith) == 'xmlhttprequest') { - return true; - } + if (isset($httpXRequestedWith) && strtolower($httpXRequestedWith) == 'xmlhttprequest') { + return true; + } - return false; - } + return false; + } } diff --git a/application/Espo/Core/Utils/Api/Output.php b/application/Espo/Core/Utils/Api/Output.php index 8955f25f62..e1791ec1c2 100644 --- a/application/Espo/Core/Utils/Api/Output.php +++ b/application/Espo/Core/Utils/Api/Output.php @@ -24,94 +24,94 @@ namespace Espo\Core\Utils\Api; class Output { - private $slim; + private $slim; - protected $errorDesc = array( - 400 => 'Bad Request', - 401 => 'Unauthorized', - 403 => 'Forbidden', - 404 => 'Page Not Found', - 409 => 'Conflict', - 500 => 'Internal Server Error', - ); + protected $errorDesc = array( + 400 => 'Bad Request', + 401 => 'Unauthorized', + 403 => 'Forbidden', + 404 => 'Page Not Found', + 409 => 'Conflict', + 500 => 'Internal Server Error', + ); - public function __construct(\Espo\Core\Utils\Api\Slim $slim) - { - $this->slim = $slim; - } + public function __construct(\Espo\Core\Utils\Api\Slim $slim) + { + $this->slim = $slim; + } - protected function getSlim() - { - return $this->slim; - } + protected function getSlim() + { + return $this->slim; + } - /** - * Output the result - * - * @param mixed $data - JSON - */ - public function render($data = null) - { - if (is_array($data)) { - $dataArr = array_values($data); - $data = empty($dataArr[0]) ? false : $dataArr[0]; - } + /** + * Output the result + * + * @param mixed $data - JSON + */ + public function render($data = null) + { + if (is_array($data)) { + $dataArr = array_values($data); + $data = empty($dataArr[0]) ? false : $dataArr[0]; + } - ob_clean(); - echo $data; - } + ob_clean(); + echo $data; + } - public function processError($message = 'Error', $code = 500, $isPrint = false) - { - $GLOBALS['log']->error('API ['.$this->getSlim()->request()->getMethod().']:'.$this->getSlim()->router()->getCurrentRoute()->getPattern().', Params:'.print_r($this->getSlim()->router()->getCurrentRoute()->getParams(), true).', InputData: '.$this->getSlim()->request()->getBody().' - '.$message); - $this->displayError($message, $code, $isPrint); - } + public function processError($message = 'Error', $code = 500, $isPrint = false) + { + $GLOBALS['log']->error('API ['.$this->getSlim()->request()->getMethod().']:'.$this->getSlim()->router()->getCurrentRoute()->getPattern().', Params:'.print_r($this->getSlim()->router()->getCurrentRoute()->getParams(), true).', InputData: '.$this->getSlim()->request()->getBody().' - '.$message); + $this->displayError($message, $code, $isPrint); + } - /** - * Output the error and stop app execution - * - * @param string $text - * @param int $statusCode - * - * @return void - */ - public function displayError($text, $statusCode = 500, $isPrint = false) - { - $GLOBALS['log']->error('Display Error: '.$text.', Code: '.$statusCode.' URL: '.$_SERVER['REQUEST_URI']); + /** + * Output the error and stop app execution + * + * @param string $text + * @param int $statusCode + * + * @return void + */ + public function displayError($text, $statusCode = 500, $isPrint = false) + { + $GLOBALS['log']->error('Display Error: '.$text.', Code: '.$statusCode.' URL: '.$_SERVER['REQUEST_URI']); - if (!empty( $this->slim)) { - $this->getSlim()->response()->status($statusCode); - $this->getSlim()->response()->header('X-Status-Reason', $text); + if (!empty( $this->slim)) { + $this->getSlim()->response()->status($statusCode); + $this->getSlim()->response()->header('X-Status-Reason', $text); - if ($isPrint) { - $status = $this->getCodeDesc($statusCode); - $status = isset($status) ? $statusCode.' '.$status : 'HTTP '.$statusCode; - $this->getSlim()->printError($text, $status); - } + if ($isPrint) { + $status = $this->getCodeDesc($statusCode); + $status = isset($status) ? $statusCode.' '.$status : 'HTTP '.$statusCode; + $this->getSlim()->printError($text, $status); + } - $this->getSlim()->stop(); - } - else { - $GLOBALS['log']->info('Could not get Slim instance. It looks like a direct call (bypass API). URL: '.$_SERVER['REQUEST_URI']); - die($text); - } - } + $this->getSlim()->stop(); + } + else { + $GLOBALS['log']->info('Could not get Slim instance. It looks like a direct call (bypass API). URL: '.$_SERVER['REQUEST_URI']); + die($text); + } + } - /** - * Get status code desription - * - * @param int $statusCode - * @return string | null - */ - protected function getCodeDesc($statusCode) - { - if (isset($this->errorDesc[$statusCode])) { - return $this->errorDesc[$statusCode]; - } + /** + * Get status code desription + * + * @param int $statusCode + * @return string | null + */ + protected function getCodeDesc($statusCode) + { + if (isset($this->errorDesc[$statusCode])) { + return $this->errorDesc[$statusCode]; + } - return null; - } + return null; + } diff --git a/application/Espo/Core/Utils/Api/Slim.php b/application/Espo/Core/Utils/Api/Slim.php index b91d4acda8..e03e55fb6f 100644 --- a/application/Espo/Core/Utils/Api/Slim.php +++ b/application/Espo/Core/Utils/Api/Slim.php @@ -26,60 +26,60 @@ namespace Espo\Core\Utils\Api; class Slim extends \Slim\Slim { - /** - * Redefine the run method - * - * We no need to use a Slim handler - */ - public function run() - { - //set_error_handler(array('\Slim\Slim', 'handleErrors')); //Espo: no needs to use this handler + /** + * Redefine the run method + * + * We no need to use a Slim handler + */ + public function run() + { + //set_error_handler(array('\Slim\Slim', 'handleErrors')); //Espo: no needs to use this handler - //Apply final outer middleware layers - if ($this->config('debug')) { - //Apply pretty exceptions only in debug to avoid accidental information leakage in production - //$this->add(new \Slim\Middleware\PrettyExceptions()); //Espo: no needs to use this handler - } + //Apply final outer middleware layers + if ($this->config('debug')) { + //Apply pretty exceptions only in debug to avoid accidental information leakage in production + //$this->add(new \Slim\Middleware\PrettyExceptions()); //Espo: no needs to use this handler + } - //Invoke middleware and application stack - $this->middleware[0]->call(); + //Invoke middleware and application stack + $this->middleware[0]->call(); - //Fetch status, header, and body - list($status, $headers, $body) = $this->response->finalize(); + //Fetch status, header, and body + list($status, $headers, $body) = $this->response->finalize(); - // Serialize cookies (with optional encryption) - \Slim\Http\Util::serializeCookies($headers, $this->response->cookies, $this->settings); + // Serialize cookies (with optional encryption) + \Slim\Http\Util::serializeCookies($headers, $this->response->cookies, $this->settings); - //Send headers - if (headers_sent() === false) { - //Send status - if (strpos(PHP_SAPI, 'cgi') === 0) { - header(sprintf('Status: %s', \Slim\Http\Response::getMessageForCode($status))); - } else { - header(sprintf('HTTP/%s %s', $this->config('http.version'), \Slim\Http\Response::getMessageForCode($status))); - } + //Send headers + if (headers_sent() === false) { + //Send status + if (strpos(PHP_SAPI, 'cgi') === 0) { + header(sprintf('Status: %s', \Slim\Http\Response::getMessageForCode($status))); + } else { + header(sprintf('HTTP/%s %s', $this->config('http.version'), \Slim\Http\Response::getMessageForCode($status))); + } - //Send headers - foreach ($headers as $name => $value) { - $hValues = explode("\n", $value); - foreach ($hValues as $hVal) { - header("$name: $hVal", false); - } - } - } + //Send headers + foreach ($headers as $name => $value) { + $hValues = explode("\n", $value); + foreach ($hValues as $hVal) { + header("$name: $hVal", false); + } + } + } - //Send body, but only if it isn't a HEAD request - if (!$this->request->isHead()) { - echo $body; - } + //Send body, but only if it isn't a HEAD request + if (!$this->request->isHead()) { + echo $body; + } - //restore_error_handler(); //Espo: no needs to use this handler - } + //restore_error_handler(); //Espo: no needs to use this handler + } - public function printError($error, $status) - { - echo static::generateTemplateMarkup($status, '

'.$error.'

Visit the Home Page'); - } + public function printError($error, $status) + { + echo static::generateTemplateMarkup($status, '

'.$error.'

Visit the Home Page'); + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Auth.php b/application/Espo/Core/Utils/Auth.php index f8d56b0530..b35bafb358 100644 --- a/application/Espo/Core/Utils/Auth.php +++ b/application/Espo/Core/Utils/Auth.php @@ -26,88 +26,88 @@ use \Espo\Core\Exceptions\Error; class Auth { - protected $container; + protected $container; - protected $authentication; + protected $authentication; - protected $config; + protected $config; - protected $entityManager; + protected $entityManager; - public function __construct(\Espo\Core\Container $container) - { - $this->container = $container; + public function __construct(\Espo\Core\Container $container) + { + $this->container = $container; - $this->entityManager = $this->container->get('entityManager'); - $this->config = $this->container->get('config'); + $this->entityManager = $this->container->get('entityManager'); + $this->config = $this->container->get('config'); - $authenticationMethod = $this->config->get('authenticationMethod', 'Espo'); - $authenticationClassName = "\\Espo\\Core\\Utils\\Authentication\\" . $authenticationMethod; - $this->authentication = new $authenticationClassName($this->config, $this->entityManager, $this); - } + $authenticationMethod = $this->config->get('authenticationMethod', 'Espo'); + $authenticationClassName = "\\Espo\\Core\\Utils\\Authentication\\" . $authenticationMethod; + $this->authentication = new $authenticationClassName($this->config, $this->entityManager, $this); + } - public function useNoAuth($isAdmin = false) - { - $entityManager = $this->container->get('entityManager'); + public function useNoAuth($isAdmin = false) + { + $entityManager = $this->container->get('entityManager'); - $user = $entityManager->getRepository('User')->get('system'); - if (!$user) { - throw new Error('System user is not found'); - } + $user = $entityManager->getRepository('User')->get('system'); + if (!$user) { + throw new Error('System user is not found'); + } - $user->set('isAdmin', $isAdmin); + $user->set('isAdmin', $isAdmin); - $entityManager->setUser($user); - $this->container->setUser($user); - } + $entityManager->setUser($user); + $this->container->setUser($user); + } - public function login($username, $password) - { - $GLOBALS['log']->debug('AUTH: Try to authenticate'); + public function login($username, $password) + { + $GLOBALS['log']->debug('AUTH: Try to authenticate'); - $entityManager = $this->entityManager; + $entityManager = $this->entityManager; - $authToken = $entityManager->getRepository('AuthToken')->where(array('token' => $password))->findOne(); + $authToken = $entityManager->getRepository('AuthToken')->where(array('token' => $password))->findOne(); - $user = $this->authentication->login($username, $password, $authToken); + $user = $this->authentication->login($username, $password, $authToken); - if ($user) { - $entityManager->setUser($user); - $this->container->setUser($user); - $GLOBALS['log']->debug('AUTH: Result of authenticate is [true]'); + if ($user) { + $entityManager->setUser($user); + $this->container->setUser($user); + $GLOBALS['log']->debug('AUTH: Result of authenticate is [true]'); - if (!$authToken) { - $authToken = $entityManager->getEntity('AuthToken'); - $token = $this->createToken($user); - $authToken->set('token', $token); - $authToken->set('hash', $user->get('password')); - $authToken->set('ipAddress', $_SERVER['REMOTE_ADDR']); - $authToken->set('userId', $user->id); - } + if (!$authToken) { + $authToken = $entityManager->getEntity('AuthToken'); + $token = $this->createToken($user); + $authToken->set('token', $token); + $authToken->set('hash', $user->get('password')); + $authToken->set('ipAddress', $_SERVER['REMOTE_ADDR']); + $authToken->set('userId', $user->id); + } - $authToken->set('lastAccess', date('Y-m-d H:i:s')); + $authToken->set('lastAccess', date('Y-m-d H:i:s')); - $entityManager->saveEntity($authToken); - $user->set('token', $authToken->get('token')); + $entityManager->saveEntity($authToken); + $user->set('token', $authToken->get('token')); - return true; - } - } + return true; + } + } - protected function createToken($user) - { - return md5(uniqid($user->get('id'))); - } + protected function createToken($user) + { + return md5(uniqid($user->get('id'))); + } - public function destroyAuthToken($token) - { - $entityManager = $this->container->get('entityManager'); + public function destroyAuthToken($token) + { + $entityManager = $this->container->get('entityManager'); - $authToken = $entityManager->getRepository('AuthToken')->where(array('token' => $token))->findOne(); - if ($authToken) { - $entityManager->removeEntity($authToken); - return true; - } - } + $authToken = $entityManager->getRepository('AuthToken')->where(array('token' => $token))->findOne(); + if ($authToken) { + $entityManager->removeEntity($authToken); + return true; + } + } } diff --git a/application/Espo/Core/Utils/Authentication/Base.php b/application/Espo/Core/Utils/Authentication/Base.php index 144d108686..e196cd2156 100644 --- a/application/Espo/Core/Utils/Authentication/Base.php +++ b/application/Espo/Core/Utils/Authentication/Base.php @@ -28,44 +28,44 @@ use \Espo\Core\Utils\Auth; abstract class Base { - private $config; + private $config; - private $entityManager; + private $entityManager; - private $auth; + private $auth; - private $passwordHash; + private $passwordHash; - public function __construct(Config $config, EntityManager $entityManager, Auth $auth) - { - $this->config = $config; - $this->entityManager = $entityManager; - $this->auth = $auth; - } + public function __construct(Config $config, EntityManager $entityManager, Auth $auth) + { + $this->config = $config; + $this->entityManager = $entityManager; + $this->auth = $auth; + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - protected function getEntityManager() - { - return $this->entityManager; - } + protected function getEntityManager() + { + return $this->entityManager; + } - protected function getAuth() - { - return $this->auth; - } + protected function getAuth() + { + return $this->auth; + } - protected function getPasswordHash() - { - if (!isset($this->passwordHash)) { - $this->passwordHash = new \Espo\Core\Utils\PasswordHash($this->config); - } + protected function getPasswordHash() + { + if (!isset($this->passwordHash)) { + $this->passwordHash = new \Espo\Core\Utils\PasswordHash($this->config); + } - return $this->passwordHash; - } + return $this->passwordHash; + } } diff --git a/application/Espo/Core/Utils/Authentication/Espo.php b/application/Espo/Core/Utils/Authentication/Espo.php index 42735b76d7..ba220e1d35 100644 --- a/application/Espo/Core/Utils/Authentication/Espo.php +++ b/application/Espo/Core/Utils/Authentication/Espo.php @@ -26,22 +26,22 @@ use \Espo\Core\Exceptions\Error; class Espo extends Base { - public function login($username, $password, \Espo\Entities\AuthToken $authToken = null) - { - if ($authToken) { - $hash = $authToken->get('hash'); - } else { - $hash = $this->getPasswordHash()->hash($password); - } + public function login($username, $password, \Espo\Entities\AuthToken $authToken = null) + { + if ($authToken) { + $hash = $authToken->get('hash'); + } else { + $hash = $this->getPasswordHash()->hash($password); + } - $user = $this->getEntityManager()->getRepository('User')->findOne(array( - 'whereClause' => array( - 'userName' => $username, - 'password' => $hash - ), - )); + $user = $this->getEntityManager()->getRepository('User')->findOne(array( + 'whereClause' => array( + 'userName' => $username, + 'password' => $hash + ), + )); - return $user; - } + return $user; + } } diff --git a/application/Espo/Core/Utils/Authentication/LDAP.php b/application/Espo/Core/Utils/Authentication/LDAP.php index 8b53c9bbe7..8bbb90ad7b 100644 --- a/application/Espo/Core/Utils/Authentication/LDAP.php +++ b/application/Espo/Core/Utils/Authentication/LDAP.php @@ -23,177 +23,177 @@ namespace Espo\Core\Utils\Authentication; use Espo\Core\Exceptions\Error, - Espo\Core\Utils\Config, - Espo\Core\ORM\EntityManager, - Espo\Core\Utils\Auth; + Espo\Core\Utils\Config, + Espo\Core\ORM\EntityManager, + Espo\Core\Utils\Auth; class LDAP extends Base { - private $utils; + private $utils; - private $zendLdap; + private $zendLdap; - /** - * Espo => LDAP name - * - * @var array - */ - private $fields = array( - 'userName' => 'cn', - 'firstName' => 'givenname', - 'lastName' => 'sn', - 'title' => 'title', - 'emailAddress' => 'mail', - 'phoneNumber' => 'telephonenumber', - ); + /** + * Espo => LDAP name + * + * @var array + */ + private $fields = array( + 'userName' => 'cn', + 'firstName' => 'givenname', + 'lastName' => 'sn', + 'title' => 'title', + 'emailAddress' => 'mail', + 'phoneNumber' => 'telephonenumber', + ); - public function __construct(Config $config, EntityManager $entityManager, Auth $auth) - { - parent::__construct($config, $entityManager, $auth); + public function __construct(Config $config, EntityManager $entityManager, Auth $auth) + { + parent::__construct($config, $entityManager, $auth); - $this->zendLdap = new LDAP\LDAP(); - $this->utils = new LDAP\Utils($config); - } + $this->zendLdap = new LDAP\LDAP(); + $this->utils = new LDAP\Utils($config); + } - protected function getZendLdap() - { - return $this->zendLdap; - } + protected function getZendLdap() + { + return $this->zendLdap; + } - protected function getUtils() - { - return $this->utils; - } + protected function getUtils() + { + return $this->utils; + } - /** - * LDAP login - * - * @param string $username - * @param string $password - * @param \Espo\Entities\AuthToken $authToken - * @return \Espo\Entities\User | null - */ - public function login($username, $password, \Espo\Entities\AuthToken $authToken = null) - { - if ($authToken) { - return $this->loginByToken($username, $authToken); - } + /** + * LDAP login + * + * @param string $username + * @param string $password + * @param \Espo\Entities\AuthToken $authToken + * @return \Espo\Entities\User | null + */ + public function login($username, $password, \Espo\Entities\AuthToken $authToken = null) + { + if ($authToken) { + return $this->loginByToken($username, $authToken); + } - $options = $this->getUtils()->getZendOptions(); + $options = $this->getUtils()->getZendOptions(); - $ldap = $this->getZendLdap(); - $ldap = $ldap->setOptions($options); + $ldap = $this->getZendLdap(); + $ldap = $ldap->setOptions($options); - try { - $ldap->bind($username, $password); + try { + $ldap->bind($username, $password); - $dn = $ldap->getDn($username); + $dn = $ldap->getDn($username); - $loginFilter = $this->getUtils()->getOption('userLoginFilter'); - $userData = $ldap->searchByLoginFilter($loginFilter, $dn, 3); + $loginFilter = $this->getUtils()->getOption('userLoginFilter'); + $userData = $ldap->searchByLoginFilter($loginFilter, $dn, 3); - } catch (\Zend\Ldap\Exception\LdapException $zle) { + } catch (\Zend\Ldap\Exception\LdapException $zle) { - $admin = $this->adminLogin($username, $password); - if (!isset($admin)) { - $GLOBALS['log']->info('LDAP Authentication: ' . $zle->getMessage()); - return null; - } + $admin = $this->adminLogin($username, $password); + if (!isset($admin)) { + $GLOBALS['log']->info('LDAP Authentication: ' . $zle->getMessage()); + return null; + } - $GLOBALS['log']->info('LDAP Authentication: Administrator login by username ['.$username.']'); - } + $GLOBALS['log']->info('LDAP Authentication: Administrator login by username ['.$username.']'); + } - $user = $this->getEntityManager()->getRepository('User')->findOne(array( - 'whereClause' => array( - 'userName' => $username, - ), - )); + $user = $this->getEntityManager()->getRepository('User')->findOne(array( + 'whereClause' => array( + 'userName' => $username, + ), + )); - $isCreateUser = $this->getUtils()->getOption('createEspoUser'); - if (!isset($user) && $isCreateUser) { - $this->getAuth()->useNoAuth(); /** Required to fix Acl "isFetched()" error */ - $user = $this->createUser($userData); - } + $isCreateUser = $this->getUtils()->getOption('createEspoUser'); + if (!isset($user) && $isCreateUser) { + $this->getAuth()->useNoAuth(); /** Required to fix Acl "isFetched()" error */ + $user = $this->createUser($userData); + } - return $user; - } + return $user; + } - /** - * Login by authorization token - * - * @param string $username - * @param \Espo\Entities\AuthToken $authToken - * @return \Espo\Entities\User | null - */ - protected function loginByToken($username, \Espo\Entities\AuthToken $authToken = null) - { - if (!isset($authToken)) { - return null; - } + /** + * Login by authorization token + * + * @param string $username + * @param \Espo\Entities\AuthToken $authToken + * @return \Espo\Entities\User | null + */ + protected function loginByToken($username, \Espo\Entities\AuthToken $authToken = null) + { + if (!isset($authToken)) { + return null; + } - $userId = $authToken->get('userId'); - $user = $this->getEntityManager()->getEntity('User', $userId); + $userId = $authToken->get('userId'); + $user = $this->getEntityManager()->getEntity('User', $userId); - $tokenUsername = $user->get('userName'); - if ($username != $tokenUsername) { - $GLOBALS['log']->alert('Unauthorized access attempt for user ['.$username.'] from IP ['.$_SERVER['REMOTE_ADDR'].']'); - return null; - } + $tokenUsername = $user->get('userName'); + if ($username != $tokenUsername) { + $GLOBALS['log']->alert('Unauthorized access attempt for user ['.$username.'] from IP ['.$_SERVER['REMOTE_ADDR'].']'); + return null; + } - $user = $this->getEntityManager()->getRepository('User')->findOne(array( - 'whereClause' => array( - 'userName' => $username, - ), - )); + $user = $this->getEntityManager()->getRepository('User')->findOne(array( + 'whereClause' => array( + 'userName' => $username, + ), + )); - return $user; - } + return $user; + } - /** - * Login user with administrator rights - * - * @param string $username - * @param string $password - * @return \Espo\Entities\User | null - */ - protected function adminLogin($username, $password) - { - $hash = $this->getPasswordHash()->hash($password); + /** + * Login user with administrator rights + * + * @param string $username + * @param string $password + * @return \Espo\Entities\User | null + */ + protected function adminLogin($username, $password) + { + $hash = $this->getPasswordHash()->hash($password); - $user = $this->getEntityManager()->getRepository('User')->findOne(array( - 'whereClause' => array( - 'userName' => $username, - 'password' => $hash, - 'isAdmin' => 1 - ), - )); + $user = $this->getEntityManager()->getRepository('User')->findOne(array( + 'whereClause' => array( + 'userName' => $username, + 'password' => $hash, + 'isAdmin' => 1 + ), + )); - return $user; - } + return $user; + } - /** - * Create Espo user with data gets from LDAP server - * - * @param array $userData LDAP entity data - * @return \Espo\Entities\User - */ - protected function createUser(array $userData) - { - $data = array(); - foreach ($this->fields as $espo => $ldap) { - if (isset($userData[$ldap][0])) { - $data[$espo] = $userData[$ldap][0]; - } - } + /** + * Create Espo user with data gets from LDAP server + * + * @param array $userData LDAP entity data + * @return \Espo\Entities\User + */ + protected function createUser(array $userData) + { + $data = array(); + foreach ($this->fields as $espo => $ldap) { + if (isset($userData[$ldap][0])) { + $data[$espo] = $userData[$ldap][0]; + } + } - $user = $this->getEntityManager()->getEntity('User'); - $user->set($data); + $user = $this->getEntityManager()->getEntity('User'); + $user->set($data); - $this->getEntityManager()->saveEntity($user); + $this->getEntityManager()->saveEntity($user); - return $user; - } + return $user; + } diff --git a/application/Espo/Core/Utils/Authentication/LDAP/LDAP.php b/application/Espo/Core/Utils/Authentication/LDAP/LDAP.php index 0361d617e0..eda42a9b16 100644 --- a/application/Espo/Core/Utils/Authentication/LDAP/LDAP.php +++ b/application/Espo/Core/Utils/Authentication/LDAP/LDAP.php @@ -24,100 +24,100 @@ namespace Espo\Core\Utils\Authentication\LDAP; class LDAP extends \Zend\Ldap\Ldap { - protected $usernameAttribute = 'cn'; + protected $usernameAttribute = 'cn'; - /** - * Get DN depends on options, ex. "cn=test,ou=People,dc=maxcrc,dc=com" - * - * @return string DN format - */ - public function getDn($acctname) - { - return $this->getAccountDn($acctname, \Zend\Ldap\Ldap::ACCTNAME_FORM_DN); - } + /** + * Get DN depends on options, ex. "cn=test,ou=People,dc=maxcrc,dc=com" + * + * @return string DN format + */ + public function getDn($acctname) + { + return $this->getAccountDn($acctname, \Zend\Ldap\Ldap::ACCTNAME_FORM_DN); + } - /** - * Fix a bug, ex. CN=Alice Baker,CN=Users,DC=example,DC=com - * - * @param string $acctname - * @return string - Account DN - */ - protected function getAccountDn($acctname) - { - $baseDn = $this->getBaseDn(); + /** + * Fix a bug, ex. CN=Alice Baker,CN=Users,DC=example,DC=com + * + * @param string $acctname + * @return string - Account DN + */ + protected function getAccountDn($acctname) + { + $baseDn = $this->getBaseDn(); - if ($this->getBindRequiresDn() && isset($baseDn)) { - try { - return parent::getAccountDn($acctname); - } catch (\Zend\Ldap\Exception\LdapException $zle) { - if ($zle->getCode() != \Zend\Ldap\Exception\LdapException::LDAP_NO_SUCH_OBJECT) { - throw $zle; - } - } + if ($this->getBindRequiresDn() && isset($baseDn)) { + try { + return parent::getAccountDn($acctname); + } catch (\Zend\Ldap\Exception\LdapException $zle) { + if ($zle->getCode() != \Zend\Ldap\Exception\LdapException::LDAP_NO_SUCH_OBJECT) { + throw $zle; + } + } - $acctname = $this->usernameAttribute . '=' . \Zend\Ldap\Filter\AbstractFilter::escapeValue($acctname) . ',' . $baseDn; - } + $acctname = $this->usernameAttribute . '=' . \Zend\Ldap\Filter\AbstractFilter::escapeValue($acctname) . ',' . $baseDn; + } - return parent::getAccountDn($acctname); - } + return parent::getAccountDn($acctname); + } - /** - * Search a user using userLoginFilter - * - * @param string $filter - * @param string $basedn - * @param int $scope - * @param array $attributes - * @return array - */ - public function searchByLoginFilter($filter, $basedn = null, $scope = self::SEARCH_SCOPE_SUB, array $attributes = array()) - { - $filter = $this->getLoginFilter($filter); + /** + * Search a user using userLoginFilter + * + * @param string $filter + * @param string $basedn + * @param int $scope + * @param array $attributes + * @return array + */ + public function searchByLoginFilter($filter, $basedn = null, $scope = self::SEARCH_SCOPE_SUB, array $attributes = array()) + { + $filter = $this->getLoginFilter($filter); - $result = $this->search($filter, $basedn, $scope, $attributes); + $result = $this->search($filter, $basedn, $scope, $attributes); - if ($result->count() > 0) { - return $result->getFirst(); - } + if ($result->count() > 0) { + return $result->getFirst(); + } - throw new \Zend\Ldap\Exception\LdapException($this, 'searching: ' . $filter); - } + throw new \Zend\Ldap\Exception\LdapException($this, 'searching: ' . $filter); + } - /** - * Get login filter in LDAP format - * - * @param string $filter - * @return string - */ - protected function getLoginFilter($filter) - { - $baseFilter = '(objectClass=*)'; + /** + * Get login filter in LDAP format + * + * @param string $filter + * @return string + */ + protected function getLoginFilter($filter) + { + $baseFilter = '(objectClass=*)'; - if (!empty($filter)) { - $baseFilter = '(&' . $baseFilter . $this->convertToFilterFormat($filter). ')'; - } + if (!empty($filter)) { + $baseFilter = '(&' . $baseFilter . $this->convertToFilterFormat($filter). ')'; + } - return $baseFilter; - } + return $baseFilter; + } - /** - * Check and convert filter item in LDAP format - * - * @param string $filter [description] - * @return string - */ - protected function convertToFilterFormat($filter) - { - $filter = trim($filter); - if (substr($filter, 0, 1) != '(') { - $filter = '(' . $filter; - } + /** + * Check and convert filter item in LDAP format + * + * @param string $filter [description] + * @return string + */ + protected function convertToFilterFormat($filter) + { + $filter = trim($filter); + if (substr($filter, 0, 1) != '(') { + $filter = '(' . $filter; + } - if (substr($filter, -1) != ')') { - $filter = $filter . ')'; - } + if (substr($filter, -1) != ')') { + $filter = $filter . ')'; + } - return $filter; - } + return $filter; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Authentication/LDAP/Utils.php b/application/Espo/Core/Utils/Authentication/LDAP/Utils.php index 35da2e3917..25ee732b06 100644 --- a/application/Espo/Core/Utils/Authentication/LDAP/Utils.php +++ b/application/Espo/Core/Utils/Authentication/LDAP/Utils.php @@ -26,130 +26,130 @@ use \Espo\Core\Utils\Config; class Utils { - private $config; + private $config; - protected $options = null; + protected $options = null; - /** - * Association between LDAP and Espo fields - * @var array - */ - protected $fieldMap = array( - 'host' => 'ldapHost', - 'port' => 'ldapPort', - 'useSsl' => 'ldapSecurity', - 'useStartTls' => 'ldapSecurity', - 'username' => 'ldapUsername', - 'password' => 'ldapPassword', - 'bindRequiresDn' => 'ldapBindRequiresDn', - 'baseDn' => 'ldapBaseDn', - 'accountCanonicalForm' => 'ldapAccountCanonicalForm', - 'accountDomainName' => 'ldapAccountDomainName', - 'accountDomainNameShort' => 'ldapAccountDomainNameShort', - 'accountFilterFormat' => 'ldapAccountFilterFormat', - 'optReferrals' => 'ldapOptReferrals', - 'tryUsernameSplit' => 'ldapTryUsernameSplit', - 'networkTimeout' => 'ldapNetworkTimeout', - 'createEspoUser' => 'ldapCreateEspoUser', - 'userLoginFilter' => 'ldapUserLoginFilter', - ); + /** + * Association between LDAP and Espo fields + * @var array + */ + protected $fieldMap = array( + 'host' => 'ldapHost', + 'port' => 'ldapPort', + 'useSsl' => 'ldapSecurity', + 'useStartTls' => 'ldapSecurity', + 'username' => 'ldapUsername', + 'password' => 'ldapPassword', + 'bindRequiresDn' => 'ldapBindRequiresDn', + 'baseDn' => 'ldapBaseDn', + 'accountCanonicalForm' => 'ldapAccountCanonicalForm', + 'accountDomainName' => 'ldapAccountDomainName', + 'accountDomainNameShort' => 'ldapAccountDomainNameShort', + 'accountFilterFormat' => 'ldapAccountFilterFormat', + 'optReferrals' => 'ldapOptReferrals', + 'tryUsernameSplit' => 'ldapTryUsernameSplit', + 'networkTimeout' => 'ldapNetworkTimeout', + 'createEspoUser' => 'ldapCreateEspoUser', + 'userLoginFilter' => 'ldapUserLoginFilter', + ); - /** - * Permitted Espo Options - * - * @var array - */ - protected $permittedEspoOptions = array( - 'createEspoUser' => false, - 'userLoginFilter' => null, - ); + /** + * Permitted Espo Options + * + * @var array + */ + protected $permittedEspoOptions = array( + 'createEspoUser' => false, + 'userLoginFilter' => null, + ); - /** - * accountCanonicalForm Map between Espo and Zend value - * - * @var array - */ - protected $accountCanonicalFormMap = array( - 'Dn' => 1, - 'Username' => 2, - 'Backslash' => 3, - 'Principal' => 4, - ); + /** + * accountCanonicalForm Map between Espo and Zend value + * + * @var array + */ + protected $accountCanonicalFormMap = array( + 'Dn' => 1, + 'Username' => 2, + 'Backslash' => 3, + 'Principal' => 4, + ); - public function __construct(Config $config) - { - $this->config = $config; - } + public function __construct(Config $config) + { + $this->config = $config; + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - /** - * Get Options from espo config according to $this->fieldMap - * - * @return array - */ - public function getOptions() - { - if (isset($this->options)) { - return $this->options; - } + /** + * Get Options from espo config according to $this->fieldMap + * + * @return array + */ + public function getOptions() + { + if (isset($this->options)) { + return $this->options; + } - $options = array(); - foreach ($this->fieldMap as $ldapName => $espoName) { + $options = array(); + foreach ($this->fieldMap as $ldapName => $espoName) { - $option = $this->getConfig()->get($espoName); - if (isset($option)) { - $options[$ldapName] = $option; - } - } + $option = $this->getConfig()->get($espoName); + if (isset($option)) { + $options[$ldapName] = $option; + } + } - /** peculiar fields */ - $options['useSsl'] = (bool) ($options['useSsl'] == 'SSL'); - $options['useStartTls'] = (bool) ($options['useStartTls'] == 'TLS'); - $options['accountCanonicalForm'] = $this->accountCanonicalFormMap[ $options['accountCanonicalForm'] ]; + /** peculiar fields */ + $options['useSsl'] = (bool) ($options['useSsl'] == 'SSL'); + $options['useStartTls'] = (bool) ($options['useStartTls'] == 'TLS'); + $options['accountCanonicalForm'] = $this->accountCanonicalFormMap[ $options['accountCanonicalForm'] ]; - $this->options = $options; + $this->options = $options; - return $this->options; - } + return $this->options; + } - /** - * Get an ldap option - * - * @param string $name - * @param mixed $returns Return value - * @return mixed - */ - public function getOption($name, $returns = null) - { - if (isset($this->options)) { - $this->getOptions(); - } + /** + * Get an ldap option + * + * @param string $name + * @param mixed $returns Return value + * @return mixed + */ + public function getOption($name, $returns = null) + { + if (isset($this->options)) { + $this->getOptions(); + } - if (isset($this->options[$name])) { - return $this->options[$name]; - } + if (isset($this->options[$name])) { + return $this->options[$name]; + } - return $returns; - } + return $returns; + } - /** - * Get Zend options for using Zend\Ldap - * - * @return array - */ - public function getZendOptions() - { - $options = $this->getOptions(); - $espoOptions = array_keys($this->permittedEspoOptions); + /** + * Get Zend options for using Zend\Ldap + * + * @return array + */ + public function getZendOptions() + { + $options = $this->getOptions(); + $espoOptions = array_keys($this->permittedEspoOptions); - $zendOptions = array_diff_key($options, array_flip($espoOptions)); + $zendOptions = array_diff_key($options, array_flip($espoOptions)); - return $zendOptions; - } + return $zendOptions; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Config.php b/application/Espo/Core/Utils/Config.php index 09cde9ef46..9d1a18b727 100644 --- a/application/Espo/Core/Utils/Config.php +++ b/application/Espo/Core/Utils/Config.php @@ -24,265 +24,265 @@ namespace Espo\Core\Utils; class Config { - /** - * Path of default config file - * - * @access private - * @var string - */ - private $defaultConfigPath = 'application/Espo/Core/defaults/config.php'; + /** + * Path of default config file + * + * @access private + * @var string + */ + private $defaultConfigPath = 'application/Espo/Core/defaults/config.php'; - private $systemConfigPath = 'application/Espo/Core/defaults/systemConfig.php'; + private $systemConfigPath = 'application/Espo/Core/defaults/systemConfig.php'; - protected $configPath = 'data/config.php'; + protected $configPath = 'data/config.php'; - private $cacheTimestamp = 'cacheTimestamp'; + private $cacheTimestamp = 'cacheTimestamp'; - /** - * Array of admin items - * - * @access protected - * @var array - */ - protected $adminItems = array(); + /** + * Array of admin items + * + * @access protected + * @var array + */ + protected $adminItems = array(); - /** - * Contains content of config - * - * @access private - * @var array - */ - private $data; + /** + * Contains content of config + * + * @access private + * @var array + */ + private $data; - private $changedData = array(); - private $removeData = array(); + private $changedData = array(); + private $removeData = array(); - private $fileManager; + private $fileManager; - public function __construct(\Espo\Core\Utils\File\Manager $fileManager) //TODO - { - $this->fileManager = $fileManager; - } + public function __construct(\Espo\Core\Utils\File\Manager $fileManager) //TODO + { + $this->fileManager = $fileManager; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - public function getConfigPath() - { - return $this->configPath; - } + public function getConfigPath() + { + return $this->configPath; + } - /** - * Get an option from config - * - * @param string $name - * @param string $default - * @return string | array - */ - public function get($name, $default = null) - { - $keys = explode('.', $name); + /** + * Get an option from config + * + * @param string $name + * @param string $default + * @return string | array + */ + public function get($name, $default = null) + { + $keys = explode('.', $name); - $lastBranch = $this->loadConfig(); - foreach ($keys as $keyName) { - if (isset($lastBranch[$keyName]) && is_array($lastBranch)) { - $lastBranch = $lastBranch[$keyName]; - } else { - return $default; - } - } + $lastBranch = $this->loadConfig(); + foreach ($keys as $keyName) { + if (isset($lastBranch[$keyName]) && is_array($lastBranch)) { + $lastBranch = $lastBranch[$keyName]; + } else { + return $default; + } + } - return $lastBranch; - } + return $lastBranch; + } - /** - * Set an option to the config - * - * @param string $name - * @param string $value - * @return bool - */ - public function set($name, $value = '') - { - if (!is_array($name)) { - $name = array($name => $value); - } + /** + * Set an option to the config + * + * @param string $name + * @param string $value + * @return bool + */ + public function set($name, $value = '') + { + if (!is_array($name)) { + $name = array($name => $value); + } - foreach ($name as $key => $value) { + foreach ($name as $key => $value) { - if (is_object($value)) { - $value = (array) $value; - } + if (is_object($value)) { + $value = (array) $value; + } - $this->data[$key] = $value; - $this->changedData[$key] = $value; - } - } + $this->data[$key] = $value; + $this->changedData[$key] = $value; + } + } - /** - * Remove an option in config - * - * @param string $name - * @return bool | null - null if an option doesn't exist - */ - public function remove($name) - { - if (array_key_exists($name, $this->data)) { - unset($this->data[$name]); - $this->removeData[] = $name; - return true; - } + /** + * Remove an option in config + * + * @param string $name + * @return bool | null - null if an option doesn't exist + */ + public function remove($name) + { + if (array_key_exists($name, $this->data)) { + unset($this->data[$name]); + $this->removeData[] = $name; + return true; + } - return null; - } + return null; + } - public function save() - { - $values = $this->changedData; + public function save() + { + $values = $this->changedData; - if (!isset($values[$this->cacheTimestamp])) { - $values = array_merge($this->updateCacheTimestamp(true), $values); - } + if (!isset($values[$this->cacheTimestamp])) { + $values = array_merge($this->updateCacheTimestamp(true), $values); + } - $removeData = empty($this->removeData) ? null : $this->removeData; + $removeData = empty($this->removeData) ? null : $this->removeData; - $result = $this->getFileManager()->mergeContentsPHP($this->configPath, $values, $removeData); - if ($result) { - $this->changedData = array(); - $this->removeData = array(); - $this->loadConfig(true); - } + $result = $this->getFileManager()->mergeContentsPHP($this->configPath, $values, $removeData); + if ($result) { + $this->changedData = array(); + $this->removeData = array(); + $this->loadConfig(true); + } - return $result; - } + return $result; + } - public function getDefaults() - { - return $this->getFileManager()->getContents($this->defaultConfigPath); - } + public function getDefaults() + { + return $this->getFileManager()->getContents($this->defaultConfigPath); + } - /** - * Return an Object of all configs - * @param boolean $reload - * @return array() - */ - protected function loadConfig($reload = false) - { - if (!$reload && isset($this->data) && !empty($this->data)) { - return $this->data; - } + /** + * Return an Object of all configs + * @param boolean $reload + * @return array() + */ + protected function loadConfig($reload = false) + { + if (!$reload && isset($this->data) && !empty($this->data)) { + return $this->data; + } - $configPath = file_exists($this->configPath) ? $this->configPath : $this->defaultConfigPath; + $configPath = file_exists($this->configPath) ? $this->configPath : $this->defaultConfigPath; - $this->data = $this->getFileManager()->getContents($configPath); + $this->data = $this->getFileManager()->getContents($configPath); - $systemConfig = $this->getFileManager()->getContents($this->systemConfigPath); - $this->data = Util::merge($systemConfig, $this->data); + $systemConfig = $this->getFileManager()->getContents($this->systemConfigPath); + $this->data = Util::merge($systemConfig, $this->data); - return $this->data; - } + return $this->data; + } - /** - * Get config acording to restrictions for a user - * - * @param $isAdmin - * @return array - */ - public function getData($isAdmin = false) - { - $data = $this->loadConfig(); + /** + * Get config acording to restrictions for a user + * + * @param $isAdmin + * @return array + */ + public function getData($isAdmin = false) + { + $data = $this->loadConfig(); - $restrictedConfig = $data; - foreach($this->getRestrictItems($isAdmin) as $name) { - if (isset($restrictedConfig[$name])) { - unset($restrictedConfig[$name]); - } - } + $restrictedConfig = $data; + foreach($this->getRestrictItems($isAdmin) as $name) { + if (isset($restrictedConfig[$name])) { + unset($restrictedConfig[$name]); + } + } - return $restrictedConfig; - } + return $restrictedConfig; + } - /** - * Set JSON data acording to restrictions for a user - * - * @param $isAdmin - * @return bool - */ - public function setData($data, $isAdmin = false) - { - $restrictItems = $this->getRestrictItems($isAdmin); + /** + * Set JSON data acording to restrictions for a user + * + * @param $isAdmin + * @return bool + */ + public function setData($data, $isAdmin = false) + { + $restrictItems = $this->getRestrictItems($isAdmin); - $values = array(); - foreach($data as $key => $item) { - if (!in_array($key, $restrictItems)) { - $values[$key]= $item; - } - } + $values = array(); + foreach($data as $key => $item) { + if (!in_array($key, $restrictItems)) { + $values[$key]= $item; + } + } - return $this->set($values); - } + return $this->set($values); + } - /** - * Update cache timestamp - * - * @param $onlyValue - If need to return just timestamp array - * @return bool | array - */ - public function updateCacheTimestamp($onlyValue = false) - { - $timestamp = array( - $this->cacheTimestamp => time(), - ); + /** + * Update cache timestamp + * + * @param $onlyValue - If need to return just timestamp array + * @return bool | array + */ + public function updateCacheTimestamp($onlyValue = false) + { + $timestamp = array( + $this->cacheTimestamp => time(), + ); - if ($onlyValue) { - return $timestamp; - } + if ($onlyValue) { + return $timestamp; + } - return $this->set($timestamp); - } + return $this->set($timestamp); + } - /** - * Get admin items - * - * @return object - */ - protected function getRestrictItems($onlySystemItems = false) - { - $data = $this->loadConfig(); + /** + * Get admin items + * + * @return object + */ + protected function getRestrictItems($onlySystemItems = false) + { + $data = $this->loadConfig(); - if ($onlySystemItems) { - return $data['systemItems']; - } + if ($onlySystemItems) { + return $data['systemItems']; + } - if (empty($this->adminItems)) { - $this->adminItems= Util::merge($data['systemItems'], $data['adminItems']); - } + if (empty($this->adminItems)) { + $this->adminItems= Util::merge($data['systemItems'], $data['adminItems']); + } - return $this->adminItems; - } + return $this->adminItems; + } - /** - * Check if an item is allowed to get and save - * - * @param $name - * @param $isAdmin - * @return bool - */ - protected function isAllowed($name, $isAdmin = false) - { - if (in_array($name, $this->getRestrictItems($isAdmin))) { - return false; - } + /** + * Check if an item is allowed to get and save + * + * @param $name + * @param $isAdmin + * @return bool + */ + protected function isAllowed($name, $isAdmin = false) + { + if (in_array($name, $this->getRestrictItems($isAdmin))) { + return false; + } - return true; - } + return true; + } } ?> diff --git a/application/Espo/Core/Utils/Crypt.php b/application/Espo/Core/Utils/Crypt.php index f6e070666b..8d4e591232 100644 --- a/application/Espo/Core/Utils/Crypt.php +++ b/application/Espo/Core/Utils/Crypt.php @@ -24,39 +24,39 @@ namespace Espo\Core\Utils; class Crypt { - private $config; - - private $key = null; - - private $cryptKey = null; - - public function __construct($config) - { - $this->config = $config; - $this->cryptKey = $config->get('cryptKey', ''); - } - - protected function getKey() - { - if (empty($this->key)) { - $this->key = hash('sha256', $this->cryptKey, true); - } - return $this->key; - } - - public function encrypt($string) - { - return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->getKey(), $string, MCRYPT_MODE_CBC)); - } - - public function decrypt($encryptedString) - { - return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->getKey(), base64_decode($encryptedString), MCRYPT_MODE_CBC)); - } - - public function generateKey() - { - return md5(uniqid()); - } + private $config; + + private $key = null; + + private $cryptKey = null; + + public function __construct($config) + { + $this->config = $config; + $this->cryptKey = $config->get('cryptKey', ''); + } + + protected function getKey() + { + if (empty($this->key)) { + $this->key = hash('sha256', $this->cryptKey, true); + } + return $this->key; + } + + public function encrypt($string) + { + return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->getKey(), $string, MCRYPT_MODE_CBC)); + } + + public function decrypt($encryptedString) + { + return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->getKey(), base64_decode($encryptedString), MCRYPT_MODE_CBC)); + } + + public function generateKey() + { + return md5(uniqid()); + } } diff --git a/application/Espo/Core/Utils/Database/Converter.php b/application/Espo/Core/Utils/Database/Converter.php index 570ca66d43..a0704d9372 100644 --- a/application/Espo/Core/Utils/Database/Converter.php +++ b/application/Espo/Core/Utils/Database/Converter.php @@ -23,81 +23,81 @@ namespace Espo\Core\Utils\Database; use Espo\Core\Utils\Util, - Espo\ORM\Entity; + Espo\ORM\Entity; class Converter { - private $metadata; + private $metadata; - private $fileManager; + private $fileManager; - private $schemaConverter; + private $schemaConverter; - private $schemaFromMetadata = null; + private $schemaFromMetadata = null; - /** - * @var array $meta - metadata array - */ - //private $meta; + /** + * @var array $meta - metadata array + */ + //private $meta; - public function __construct(\Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\File\Manager $fileManager) - { - $this->metadata = $metadata; - $this->fileManager = $fileManager; + public function __construct(\Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\File\Manager $fileManager) + { + $this->metadata = $metadata; + $this->fileManager = $fileManager; - $this->ormConverter = new Orm\Converter($this->metadata, $this->fileManager); + $this->ormConverter = new Orm\Converter($this->metadata, $this->fileManager); - $this->schemaConverter = new Schema\Converter($this->fileManager); - } + $this->schemaConverter = new Schema\Converter($this->fileManager); + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - protected function getOrmConverter() - { - return $this->ormConverter; - } + protected function getOrmConverter() + { + return $this->ormConverter; + } - protected function getSchemaConverter() - { - return $this->schemaConverter; - } + protected function getSchemaConverter() + { + return $this->schemaConverter; + } - public function getSchemaFromMetadata($entityList = null) - { - $ormMeta = $this->getMetadata()->getOrmMetadata(); - $entityDefs = $this->getMetadata()->get('entityDefs'); + public function getSchemaFromMetadata($entityList = null) + { + $ormMeta = $this->getMetadata()->getOrmMetadata(); + $entityDefs = $this->getMetadata()->get('entityDefs'); - $this->schemaFromMetadata = $this->getSchemaConverter()->process($ormMeta, $entityDefs, $entityList); + $this->schemaFromMetadata = $this->getSchemaConverter()->process($ormMeta, $entityDefs, $entityList); - return $this->schemaFromMetadata; - } + return $this->schemaFromMetadata; + } - /** - * Main method of convertation from metadata to orm metadata and database schema - * - * @return bool - */ - public function process() - { - $GLOBALS['log']->debug('Orm\Converter - Start: orm convertation'); + /** + * Main method of convertation from metadata to orm metadata and database schema + * + * @return bool + */ + public function process() + { + $GLOBALS['log']->debug('Orm\Converter - Start: orm convertation'); - $ormMeta = $this->getOrmConverter()->process(); + $ormMeta = $this->getOrmConverter()->process(); - //save database meta to a file espoMetadata.php - $result = $this->getMetadata()->setOrmMetadata($ormMeta); + //save database meta to a file espoMetadata.php + $result = $this->getMetadata()->setOrmMetadata($ormMeta); - $GLOBALS['log']->debug('Orm\Converter - End: orm convertation, result=['.$result.']'); + $GLOBALS['log']->debug('Orm\Converter - End: orm convertation, result=['.$result.']'); - return $result; - } + return $result; + } diff --git a/application/Espo/Core/Utils/Database/DBAL/Driver/Mysqli/Driver.php b/application/Espo/Core/Utils/Database/DBAL/Driver/Mysqli/Driver.php index f7be7e83c8..15a66152b5 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Driver/Mysqli/Driver.php +++ b/application/Espo/Core/Utils/Database/DBAL/Driver/Mysqli/Driver.php @@ -25,7 +25,7 @@ namespace Espo\Core\Utils\Database\DBAL\Driver\Mysqli; class Driver extends \Doctrine\DBAL\Driver\Mysqli\Driver { - public function getDatabasePlatform() + public function getDatabasePlatform() { return new \Espo\Core\Utils\Database\DBAL\Platforms\MySqlPlatform(); } diff --git a/application/Espo/Core/Utils/Database/DBAL/Driver/PDOMySql/Driver.php b/application/Espo/Core/Utils/Database/DBAL/Driver/PDOMySql/Driver.php index db6f43b00b..11e5887e7b 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Driver/PDOMySql/Driver.php +++ b/application/Espo/Core/Utils/Database/DBAL/Driver/PDOMySql/Driver.php @@ -25,7 +25,7 @@ namespace Espo\Core\Utils\Database\DBAL\Driver\PDOMySql; class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver { - public function getDatabasePlatform() + public function getDatabasePlatform() { return new \Espo\Core\Utils\Database\DBAL\Platforms\MySqlPlatform(); } diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php index c6dce4d685..d43063b9c2 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php @@ -26,15 +26,15 @@ use Doctrine\DBAL\Types\BooleanType; class Bool extends BooleanType { - const BOOL = 'bool'; + const BOOL = 'bool'; - public function getName() + public function getName() { return self::BOOL; } - public static function getDbTypeName() - { - return 'TINYINT'; - } + public static function getDbTypeName() + { + return 'TINYINT'; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php index 0c0c688af0..5f3c06a03e 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php @@ -26,7 +26,7 @@ use Doctrine\DBAL\Types\IntegerType; class Int extends IntegerType { - const INTtype = 'int'; + const INTtype = 'int'; public function getName() { diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/JsonArray.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/JsonArray.php index cd822e27a0..2651398edc 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/JsonArray.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/JsonArray.php @@ -24,16 +24,16 @@ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; class JsonArray extends \Doctrine\DBAL\Types\JsonArrayType { - const JSON_ARRAY = 'jsonArray'; + const JSON_ARRAY = 'jsonArray'; - public function getName() - { - return self::JSON_ARRAY; - } + public function getName() + { + return self::JSON_ARRAY; + } - public static function getDbTypeName() - { - return 'TEXT'; - } + public static function getDbTypeName() + { + return 'TEXT'; + } } diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/JsonObject.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/JsonObject.php index f2f4f756ff..5d6382aef1 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/JsonObject.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/JsonObject.php @@ -24,16 +24,16 @@ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; class JsonObject extends \Doctrine\DBAL\Types\ObjectType { - const JSON_OBJECT = 'jsonObject'; + const JSON_OBJECT = 'jsonObject'; - public function getName() - { - return self::JSON_OBJECT; - } + public function getName() + { + return self::JSON_OBJECT; + } - public static function getDbTypeName() - { - return 'TEXT'; - } + public static function getDbTypeName() + { + return 'TEXT'; + } } diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php index 5d408dfec6..aaf6fcbfeb 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php @@ -28,14 +28,14 @@ class Password extends StringType { const PASSWORD = 'password'; - public function getName() + public function getName() { return self::PASSWORD; } - public static function getDbTypeName() - { - return 'VARCHAR'; - } + public static function getDbTypeName() + { + return 'VARCHAR'; + } } diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php index 77910cc1e3..e3ed0f7ff2 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php @@ -26,9 +26,9 @@ use Doctrine\DBAL\Types\StringType; class Varchar extends StringType { - const VARCHAR = 'varchar'; + const VARCHAR = 'varchar'; - public function getName() + public function getName() { return self::VARCHAR; } diff --git a/application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php b/application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php index 8b2947825f..0c92c2beb2 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php +++ b/application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php @@ -23,252 +23,252 @@ namespace Espo\Core\Utils\Database\DBAL\Platforms; use Doctrine\DBAL\Schema\TableDiff, - Doctrine\DBAL\Schema\Index, - Doctrine\DBAL\Schema\Table, - Doctrine\DBAL\Schema\Constraint, - Doctrine\DBAL\Schema\ForeignKeyConstraint; + Doctrine\DBAL\Schema\Index, + Doctrine\DBAL\Schema\Table, + Doctrine\DBAL\Schema\Constraint, + Doctrine\DBAL\Schema\ForeignKeyConstraint; class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform { - public function getAlterTableSQL(TableDiff $diff) - { - $columnSql = array(); - $queryParts = array(); - if ($diff->newName !== false) { - $queryParts[] = 'RENAME TO ' . $diff->newName; - } + public function getAlterTableSQL(TableDiff $diff) + { + $columnSql = array(); + $queryParts = array(); + if ($diff->newName !== false) { + $queryParts[] = 'RENAME TO ' . $diff->newName; + } - foreach ($diff->addedColumns as $column) { - if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { - continue; - } + foreach ($diff->addedColumns as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } - $columnArray = $column->toArray(); - $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } + $columnArray = $column->toArray(); + $columnArray['comment'] = $this->getColumnComment($column); + $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); + } - foreach ($diff->removedColumns as $column) { - if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { - continue; - } + foreach ($diff->removedColumns as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } - //$queryParts[] = 'DROP ' . $column->getQuotedName($this); //espo: no needs to remove columns - } + //$queryParts[] = 'DROP ' . $column->getQuotedName($this); //espo: no needs to remove columns + } - foreach ($diff->changedColumns as $columnDiff) { - if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { - continue; - } + foreach ($diff->changedColumns as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } - /* @var $columnDiff \Doctrine\DBAL\Schema\ColumnDiff */ - $column = $columnDiff->column; - $columnArray = $column->toArray(); - $columnArray['comment'] = $this->getColumnComment($column); + /* @var $columnDiff \Doctrine\DBAL\Schema\ColumnDiff */ + $column = $columnDiff->column; + $columnArray = $column->toArray(); + $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'CHANGE ' . $this->espoQuote($columnDiff->oldColumnName) . ' ' - . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } + $queryParts[] = 'CHANGE ' . $this->espoQuote($columnDiff->oldColumnName) . ' ' + . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); + } - //espo: It works not correctly. It can rename some existing fields - foreach ($diff->renamedColumns as $oldColumnName => $column) { - if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { - continue; - } + //espo: It works not correctly. It can rename some existing fields + foreach ($diff->renamedColumns as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } - $columnArray = $column->toArray(); - $columnArray['comment'] = $this->getColumnComment($column); - /*$queryParts[] = 'CHANGE ' . $oldColumnName . ' ' - . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); */ - $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); //espo: fixed the problem - } //espo: END + $columnArray = $column->toArray(); + $columnArray['comment'] = $this->getColumnComment($column); + /*$queryParts[] = 'CHANGE ' . $oldColumnName . ' ' + . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); */ + $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); //espo: fixed the problem + } //espo: END - $sql = array(); - $tableSql = array(); + $sql = array(); + $tableSql = array(); - if ( ! $this->onSchemaAlterTable($diff, $tableSql)) { - if (count($queryParts) > 0) { - $sql[] = 'ALTER TABLE ' . $this->espoQuote($diff->name) . ' ' . implode(", ", $queryParts); - } - $sql = array_merge( - $this->getPreAlterTableIndexForeignKeySQL($diff), - $sql, - $this->getPostAlterTableIndexForeignKeySQL($diff) - ); - } + if ( ! $this->onSchemaAlterTable($diff, $tableSql)) { + if (count($queryParts) > 0) { + $sql[] = 'ALTER TABLE ' . $this->espoQuote($diff->name) . ' ' . implode(", ", $queryParts); + } + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff) + ); + } - return array_merge($sql, $tableSql, $columnSql); - } + return array_merge($sql, $tableSql, $columnSql); + } - protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) - { - $sql = array(); - $table = $diff->name; + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $sql = array(); + $table = $diff->name; - foreach ($diff->removedIndexes as $remKey => $remIndex) { + foreach ($diff->removedIndexes as $remKey => $remIndex) { - foreach ($diff->addedIndexes as $addKey => $addIndex) { - if ($remIndex->getColumns() == $addIndex->getColumns()) { + foreach ($diff->addedIndexes as $addKey => $addIndex) { + if ($remIndex->getColumns() == $addIndex->getColumns()) { - $type = ''; - if ($addIndex->isUnique()) { - $type = 'UNIQUE '; - } + $type = ''; + if ($addIndex->isUnique()) { + $type = 'UNIQUE '; + } - $query = 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP INDEX ' . $remIndex->getName() . ', '; - $query .= 'ADD ' . $type . 'INDEX ' . $addIndex->getName(); - $query .= ' (' . $this->getIndexFieldDeclarationListSQL($addIndex->getQuotedColumns($this)) . ')'; + $query = 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP INDEX ' . $remIndex->getName() . ', '; + $query .= 'ADD ' . $type . 'INDEX ' . $addIndex->getName(); + $query .= ' (' . $this->getIndexFieldDeclarationListSQL($addIndex->getQuotedColumns($this)) . ')'; - $sql[] = $query; + $sql[] = $query; - unset($diff->removedIndexes[$remKey]); - unset($diff->addedIndexes[$addKey]); + unset($diff->removedIndexes[$remKey]); + unset($diff->addedIndexes[$addKey]); - break; - } - } - } + break; + } + } + } - $sql = array_merge($sql, parent::getPreAlterTableIndexForeignKeySQL($diff)); + $sql = array_merge($sql, parent::getPreAlterTableIndexForeignKeySQL($diff)); - return $sql; - } + return $sql; + } - public function getDropIndexSQL($index, $table=null) - { - if ($index instanceof Index) { - $indexName = $index->getQuotedName($this); - } else if(is_string($index)) { - $indexName = $index; - } else { - throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); - } + public function getDropIndexSQL($index, $table=null) + { + if ($index instanceof Index) { + $indexName = $index->getQuotedName($this); + } else if(is_string($index)) { + $indexName = $index; + } else { + throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); + } - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } else if(!is_string($table)) { - throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); - } + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } else if(!is_string($table)) { + throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); + } - if ($index instanceof Index && $index->isPrimary()) { - // mysql primary keys are always named "PRIMARY", - // so we cannot use them in statements because of them being keyword. - return $this->getDropPrimaryKeySQL($table); - } + if ($index instanceof Index && $index->isPrimary()) { + // mysql primary keys are always named "PRIMARY", + // so we cannot use them in statements because of them being keyword. + return $this->getDropPrimaryKeySQL($table); + } - return 'DROP INDEX ' . $indexName . ' ON ' . $this->espoQuote($table); - } + return 'DROP INDEX ' . $indexName . ' ON ' . $this->espoQuote($table); + } - protected function getDropPrimaryKeySQL($table) - { - return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP PRIMARY KEY'; - } + protected function getDropPrimaryKeySQL($table) + { + return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP PRIMARY KEY'; + } - public function getDropTemporaryTableSQL($table) - { - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } else if(!is_string($table)) { - throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); - } + public function getDropTemporaryTableSQL($table) + { + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } else if(!is_string($table)) { + throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); + } - return 'DROP TEMPORARY TABLE ' . $this->espoQuote($table); - } + return 'DROP TEMPORARY TABLE ' . $this->espoQuote($table); + } - //ESPO: fix problem with quoting table name - public function espoQuote($name) - { - if ($name instanceof Table) { - $name = $name->getQuotedName($this); - } + //ESPO: fix problem with quoting table name + public function espoQuote($name) + { + if ($name instanceof Table) { + $name = $name->getQuotedName($this); + } - if (isset($name[0]) && $name[0] != '`') { - $name = $this->quoteIdentifier($name); - } - return $name; - } + if (isset($name[0]) && $name[0] != '`') { + $name = $this->quoteIdentifier($name); + } + return $name; + } - public function getCreateForeignKeySQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey, $table) - { - $query = 'ALTER TABLE ' . $this->espoQuote($table) . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey); + public function getCreateForeignKeySQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey, $table) + { + $query = 'ALTER TABLE ' . $this->espoQuote($table) . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey); - return $query; - } + return $query; + } - public function getIndexDeclarationSQL($name, Index $index) - { - $columns = $index->getQuotedColumns($this); + public function getIndexDeclarationSQL($name, Index $index) + { + $columns = $index->getQuotedColumns($this); - if (count($columns) === 0) { - throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); - } + if (count($columns) === 0) { + throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); + } - return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $this->espoQuote($name) . ' (' - . $this->getIndexFieldDeclarationListSQL($columns) - . ')'; - } + return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $this->espoQuote($name) . ' (' + . $this->getIndexFieldDeclarationListSQL($columns) + . ')'; + } - public function getCreateIndexSQL(Index $index, $table) - { - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } - $name = $index->getQuotedName($this); - $columns = $index->getQuotedColumns($this); + public function getCreateIndexSQL(Index $index, $table) + { + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } + $name = $index->getQuotedName($this); + $columns = $index->getQuotedColumns($this); - if (count($columns) == 0) { - throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); - } + if (count($columns) == 0) { + throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); + } - if ($index->isPrimary()) { - return $this->getCreatePrimaryKeySQL($index, $table); - } + if ($index->isPrimary()) { + return $this->getCreatePrimaryKeySQL($index, $table); + } - $query = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $this->espoQuote($table); - $query .= ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')'; + $query = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $this->espoQuote($table); + $query .= ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')'; - return $query; - } + return $query; + } - public function getDropConstraintSQL($constraint, $table) - { - if ($constraint instanceof Constraint) { - $constraint = $constraint->getQuotedName($this); - } + public function getDropConstraintSQL($constraint, $table) + { + if ($constraint instanceof Constraint) { + $constraint = $constraint->getQuotedName($this); + } - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } - return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP CONSTRAINT ' . $constraint; - } + return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP CONSTRAINT ' . $constraint; + } - public function getDropForeignKeySQL($foreignKey, $table) - { - if ($foreignKey instanceof ForeignKeyConstraint) { - $foreignKey = $foreignKey->getQuotedName($this); - } + public function getDropForeignKeySQL($foreignKey, $table) + { + if ($foreignKey instanceof ForeignKeyConstraint) { + $foreignKey = $foreignKey->getQuotedName($this); + } - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } - return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP FOREIGN KEY ' . $foreignKey; - } + return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP FOREIGN KEY ' . $foreignKey; + } - public function getCreatePrimaryKeySQL(Index $index, $table) - { - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } + public function getCreatePrimaryKeySQL(Index $index, $table) + { + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } - return 'ALTER TABLE ' . $this->espoQuote($table) . ' ADD PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index->getQuotedColumns($this)) . ')'; - } - //end: ESPO + return 'ALTER TABLE ' . $this->espoQuote($table) . ' ADD PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index->getQuotedColumns($this)) . ')'; + } + //end: ESPO } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/DBAL/Schema/Column.php b/application/Espo/Core/Utils/Database/DBAL/Schema/Column.php index ceb0e9aa97..afabc89dbd 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Schema/Column.php +++ b/application/Espo/Core/Utils/Database/DBAL/Schema/Column.php @@ -26,57 +26,57 @@ namespace Espo\Core\Utils\Database\DBAL\Schema; class Column extends \Doctrine\DBAL\Schema\Column { - /** - * @var boolean - */ - protected $_notnull = false; + /** + * @var boolean + */ + protected $_notnull = false; - /** - * @var boolean - */ - protected $_unique = false; + /** + * @var boolean + */ + protected $_unique = false; - /** - * @param boolean $unique - * - * @return \Doctrine\DBAL\Schema\Column - */ - public function setUnique($unique) - { - $this->_unique = (bool)$unique; + /** + * @param boolean $unique + * + * @return \Doctrine\DBAL\Schema\Column + */ + public function setUnique($unique) + { + $this->_unique = (bool)$unique; - return $this; - } + return $this; + } - /** - * @return boolean - */ - public function getUnique() - { - return $this->_unique; - } + /** + * @return boolean + */ + public function getUnique() + { + return $this->_unique; + } - /** - * @return array - */ - public function toArray() - { - return array_merge(array( - 'name' => $this->_name, - 'type' => $this->_type, - 'default' => $this->_default, - 'notnull' => $this->_notnull, - 'length' => $this->_length, - 'precision' => $this->_precision, - 'scale' => $this->_scale, - 'fixed' => $this->_fixed, - 'unsigned' => $this->_unsigned, - 'autoincrement' => $this->_autoincrement, - 'unique' => $this->_unique, - 'columnDefinition' => $this->_columnDefinition, - 'comment' => $this->_comment, - ), $this->_platformOptions, $this->_customSchemaOptions); - } + /** + * @return array + */ + public function toArray() + { + return array_merge(array( + 'name' => $this->_name, + 'type' => $this->_type, + 'default' => $this->_default, + 'notnull' => $this->_notnull, + 'length' => $this->_length, + 'precision' => $this->_precision, + 'scale' => $this->_scale, + 'fixed' => $this->_fixed, + 'unsigned' => $this->_unsigned, + 'autoincrement' => $this->_autoincrement, + 'unique' => $this->_unique, + 'columnDefinition' => $this->_columnDefinition, + 'comment' => $this->_comment, + ), $this->_platformOptions, $this->_customSchemaOptions); + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/DBAL/Schema/Comparator.php b/application/Espo/Core/Utils/Database/DBAL/Schema/Comparator.php index 4e9ee27a37..407901aac6 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Schema/Comparator.php +++ b/application/Espo/Core/Utils/Database/DBAL/Schema/Comparator.php @@ -28,86 +28,86 @@ use Doctrine\DBAL\Schema\Column; class Comparator extends \Doctrine\DBAL\Schema\Comparator { - public function diffColumn(Column $column1, Column $column2) - { - $changedProperties = array(); - if ( $column1->getType() != $column2->getType() ) { + public function diffColumn(Column $column1, Column $column2) + { + $changedProperties = array(); + if ( $column1->getType() != $column2->getType() ) { - //espo: fix problem with executing query for custom types - $column1DbTypeName = method_exists($column1->getType(), 'getDbTypeName') ? $column1->getType()->getDbTypeName() : $column1->getType()->getName(); - $column2DbTypeName = method_exists($column2->getType(), 'getDbTypeName') ? $column2->getType()->getDbTypeName() : $column2->getType()->getName(); + //espo: fix problem with executing query for custom types + $column1DbTypeName = method_exists($column1->getType(), 'getDbTypeName') ? $column1->getType()->getDbTypeName() : $column1->getType()->getName(); + $column2DbTypeName = method_exists($column2->getType(), 'getDbTypeName') ? $column2->getType()->getDbTypeName() : $column2->getType()->getName(); - if (strtolower($column1DbTypeName) != strtolower($column2DbTypeName)) { - $changedProperties[] = 'type'; - } - //END: espo - } + if (strtolower($column1DbTypeName) != strtolower($column2DbTypeName)) { + $changedProperties[] = 'type'; + } + //END: espo + } - if ($column1->getNotnull() != $column2->getNotnull()) { - $changedProperties[] = 'notnull'; - } + if ($column1->getNotnull() != $column2->getNotnull()) { + $changedProperties[] = 'notnull'; + } - if ($column1->getDefault() != $column2->getDefault()) { - $changedProperties[] = 'default'; - } + if ($column1->getDefault() != $column2->getDefault()) { + $changedProperties[] = 'default'; + } - if ($column1->getUnsigned() != $column2->getUnsigned()) { - $changedProperties[] = 'unsigned'; - } + if ($column1->getUnsigned() != $column2->getUnsigned()) { + $changedProperties[] = 'unsigned'; + } - if ($column1->getType() instanceof \Doctrine\DBAL\Types\StringType) { - // check if value of length is set at all, default value assumed otherwise. - $length1 = $column1->getLength() ?: 255; - $length2 = $column2->getLength() ?: 255; + if ($column1->getType() instanceof \Doctrine\DBAL\Types\StringType) { + // check if value of length is set at all, default value assumed otherwise. + $length1 = $column1->getLength() ?: 255; + $length2 = $column2->getLength() ?: 255; - /** Espo: column length can be increased only */ - /*if ($length1 != $length2) { - $changedProperties[] = 'length'; - }*/ - if ($length2 > $length1) { - $changedProperties[] = 'length'; - } - /** Espo: end */ + /** Espo: column length can be increased only */ + /*if ($length1 != $length2) { + $changedProperties[] = 'length'; + }*/ + if ($length2 > $length1) { + $changedProperties[] = 'length'; + } + /** Espo: end */ - if ($column1->getFixed() != $column2->getFixed()) { - $changedProperties[] = 'fixed'; - } - } + if ($column1->getFixed() != $column2->getFixed()) { + $changedProperties[] = 'fixed'; + } + } - if ($column1->getType() instanceof \Doctrine\DBAL\Types\DecimalType) { - if (($column1->getPrecision()?:10) != ($column2->getPrecision()?:10)) { - $changedProperties[] = 'precision'; - } - if ($column1->getScale() != $column2->getScale()) { - $changedProperties[] = 'scale'; - } - } + if ($column1->getType() instanceof \Doctrine\DBAL\Types\DecimalType) { + if (($column1->getPrecision()?:10) != ($column2->getPrecision()?:10)) { + $changedProperties[] = 'precision'; + } + if ($column1->getScale() != $column2->getScale()) { + $changedProperties[] = 'scale'; + } + } - if ($column1->getAutoincrement() != $column2->getAutoincrement()) { - $changedProperties[] = 'autoincrement'; - } + if ($column1->getAutoincrement() != $column2->getAutoincrement()) { + $changedProperties[] = 'autoincrement'; + } - // only allow to delete comment if its set to '' not to null. - if ($column1->getComment() !== null && $column1->getComment() != $column2->getComment()) { - $changedProperties[] = 'comment'; - } + // only allow to delete comment if its set to '' not to null. + if ($column1->getComment() !== null && $column1->getComment() != $column2->getComment()) { + $changedProperties[] = 'comment'; + } - $options1 = $column1->getCustomSchemaOptions(); - $options2 = $column2->getCustomSchemaOptions(); + $options1 = $column1->getCustomSchemaOptions(); + $options2 = $column2->getCustomSchemaOptions(); - $commonKeys = array_keys(array_intersect_key($options1, $options2)); + $commonKeys = array_keys(array_intersect_key($options1, $options2)); - foreach ($commonKeys as $key) { - if ($options1[$key] !== $options2[$key]) { - $changedProperties[] = $key; - } - } + foreach ($commonKeys as $key) { + if ($options1[$key] !== $options2[$key]) { + $changedProperties[] = $key; + } + } - $diffKeys = array_keys(array_diff_key($options1, $options2) + array_diff_key($options2, $options1)); + $diffKeys = array_keys(array_diff_key($options1, $options2) + array_diff_key($options2, $options1)); - $changedProperties = array_merge($changedProperties, $diffKeys); + $changedProperties = array_merge($changedProperties, $diffKeys); - return $changedProperties; - } + return $changedProperties; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/DBAL/Schema/Schema.php b/application/Espo/Core/Utils/Database/DBAL/Schema/Schema.php index 6cde05516d..d370412579 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Schema/Schema.php +++ b/application/Espo/Core/Utils/Database/DBAL/Schema/Schema.php @@ -25,23 +25,23 @@ namespace Espo\Core\Utils\Database\DBAL\Schema; class Schema extends \Doctrine\DBAL\Schema\Schema { - /** - * Creates a new table. - * - * @param string $tableName - * - * @return \Doctrine\DBAL\Schema\Table - */ - public function createTable($tableName) - { - $table = new Table($tableName); - $this->_addTable($table); + /** + * Creates a new table. + * + * @param string $tableName + * + * @return \Doctrine\DBAL\Schema\Table + */ + public function createTable($tableName) + { + $table = new Table($tableName); + $this->_addTable($table); - foreach ($this->_schemaConfig->getDefaultTableOptions() as $name => $value) { - $table->addOption($name, $value); - } + foreach ($this->_schemaConfig->getDefaultTableOptions() as $name => $value) { + $table->addOption($name, $value); + } - return $table; - } + return $table; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/DBAL/Schema/Table.php b/application/Espo/Core/Utils/Database/DBAL/Schema/Table.php index c6c82b1a93..d9b28b5a0b 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Schema/Table.php +++ b/application/Espo/Core/Utils/Database/DBAL/Schema/Table.php @@ -27,20 +27,20 @@ use Doctrine\DBAL\Types\Type; class Table extends \Doctrine\DBAL\Schema\Table { - /** - * @param string $columnName - * @param string $typeName - * @param array $options - * - * @return \Doctrine\DBAL\Schema\Column - */ - public function addColumn($columnName, $typeName, array $options=array()) - { - $column = new Column($columnName, Type::getType($typeName), $options); + /** + * @param string $columnName + * @param string $typeName + * @param array $options + * + * @return \Doctrine\DBAL\Schema\Column + */ + public function addColumn($columnName, $typeName, array $options=array()) + { + $column = new Column($columnName, Type::getType($typeName), $options); - $this->_addColumn($column); + $this->_addColumn($column); - return $column; - } + return $column; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Base.php b/application/Espo/Core/Utils/Database/Orm/Base.php index fae05139fe..5733e75360 100644 --- a/application/Espo/Core/Utils/Database/Orm/Base.php +++ b/application/Espo/Core/Utils/Database/Orm/Base.php @@ -26,245 +26,245 @@ use Espo\Core\Utils\Util; class Base { - private $itemName = null; + private $itemName = null; - private $entityName = null; + private $entityName = null; - private $metadata; + private $metadata; - private $ormEntityDefs; + private $ormEntityDefs; - private $entityDefs; + private $entityDefs; - public function __construct(\Espo\Core\Utils\Metadata $metadata, array $ormEntityDefs, array $entityDefs) - { - $this->metadata = $metadata; - $this->ormEntityDefs = $ormEntityDefs; - $this->entityDefs = $entityDefs; - } + public function __construct(\Espo\Core\Utils\Metadata $metadata, array $ormEntityDefs, array $entityDefs) + { + $this->metadata = $metadata; + $this->ormEntityDefs = $ormEntityDefs; + $this->entityDefs = $entityDefs; + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - protected function getOrmEntityDefs() - { - return $this->ormEntityDefs; - } + protected function getOrmEntityDefs() + { + return $this->ormEntityDefs; + } - protected function getEntityDefs() - { - return $this->entityDefs; - } + protected function getEntityDefs() + { + return $this->entityDefs; + } - /** - * Set current Field name OR Link name - * - * @param void - */ - protected function setItemName($itemName) - { - $this->itemName = $itemName; - } + /** + * Set current Field name OR Link name + * + * @param void + */ + protected function setItemName($itemName) + { + $this->itemName = $itemName; + } - /** - * Get current Field name - * - * @return string - */ - protected function getFieldName() - { - return $this->itemName; - } + /** + * Get current Field name + * + * @return string + */ + protected function getFieldName() + { + return $this->itemName; + } - /** - * Get current Link name - * - * @return string - */ - protected function getLinkName() - { - return $this->itemName; - } + /** + * Get current Link name + * + * @return string + */ + protected function getLinkName() + { + return $this->itemName; + } - /** - * Set current Entity Name - * - * @param void - */ - protected function setEntityName($entityName) - { - $this->entityName = $entityName; - } + /** + * Set current Entity Name + * + * @param void + */ + protected function setEntityName($entityName) + { + $this->entityName = $entityName; + } - /** - * Get current Entity Name - * - * @return string - */ - protected function getEntityName() - { - return $this->entityName; - } + /** + * Get current Entity Name + * + * @return string + */ + protected function getEntityName() + { + return $this->entityName; + } - protected function setMethods(array $keyValueList) - { - foreach ($keyValueList as $key => $value) { - $methodName = 'set' . ucfirst($key); - if (method_exists($this, $methodName)) { - $this->$methodName($value); - } - } - } + protected function setMethods(array $keyValueList) + { + foreach ($keyValueList as $key => $value) { + $methodName = 'set' . ucfirst($key); + if (method_exists($this, $methodName)) { + $this->$methodName($value); + } + } + } - /** - * Start process Orm converting for fields/relations - * - * @param string $itemName Field name OR Link name - * @param string $entityName - * @return array - */ - public function process($itemName, $entityName) - { - $inputs = array( - 'itemName' => $itemName, - 'entityName' => $entityName, - ); - $this->setMethods($inputs); + /** + * Start process Orm converting for fields/relations + * + * @param string $itemName Field name OR Link name + * @param string $entityName + * @return array + */ + public function process($itemName, $entityName) + { + $inputs = array( + 'itemName' => $itemName, + 'entityName' => $entityName, + ); + $this->setMethods($inputs); - $convertedDefs = $this->load($itemName, $entityName); + $convertedDefs = $this->load($itemName, $entityName); - $inputs = $this->setArrayValue(null, $inputs); - $this->setMethods($inputs); + $inputs = $this->setArrayValue(null, $inputs); + $this->setMethods($inputs); - return $convertedDefs; - } + return $convertedDefs; + } - /** - * Get Entity Defs by type (entity/orm) - * - * @param boolean $isOrmEntityDefs - * @return array - */ - protected function getDefs($isOrmEntityDefs = false) - { - $entityDefs = $isOrmEntityDefs ? $this->getOrmEntityDefs() : $this->getEntityDefs(); + /** + * Get Entity Defs by type (entity/orm) + * + * @param boolean $isOrmEntityDefs + * @return array + */ + protected function getDefs($isOrmEntityDefs = false) + { + $entityDefs = $isOrmEntityDefs ? $this->getOrmEntityDefs() : $this->getEntityDefs(); - return $entityDefs; - } + return $entityDefs; + } - /** - * Get entity params by name - * - * @param string $entityName - * @param bool $isOrmEntityDefs - * @param mixed $returns - * @return mixed - */ - protected function getEntityParams($entityName = null, $isOrmEntityDefs = false, $returns = null) - { - if (!isset($entityName)) { - $entityName = $this->getEntityName(); - } + /** + * Get entity params by name + * + * @param string $entityName + * @param bool $isOrmEntityDefs + * @param mixed $returns + * @return mixed + */ + protected function getEntityParams($entityName = null, $isOrmEntityDefs = false, $returns = null) + { + if (!isset($entityName)) { + $entityName = $this->getEntityName(); + } - $entityDefs = $this->getDefs($isOrmEntityDefs); + $entityDefs = $this->getDefs($isOrmEntityDefs); - if (isset($entityDefs[$entityName])) { - return $entityDefs[$entityName]; - } + if (isset($entityDefs[$entityName])) { + return $entityDefs[$entityName]; + } - return $returns; - } + return $returns; + } - /** - * Get field params by name for a specified entity - * - * @param string $fieldName - * @param string $entityName - * @param bool $isOrmEntityDefs - * @param mixed $returns - * @return mixed - */ - protected function getFieldParams($fieldName = null, $entityName = null, $isOrmEntityDefs = false, $returns = null) - { - if (!isset($fieldName)) { - $fieldName = $this->getFieldName(); - } - if (!isset($entityName)) { - $entityName = $this->getEntityName(); - } + /** + * Get field params by name for a specified entity + * + * @param string $fieldName + * @param string $entityName + * @param bool $isOrmEntityDefs + * @param mixed $returns + * @return mixed + */ + protected function getFieldParams($fieldName = null, $entityName = null, $isOrmEntityDefs = false, $returns = null) + { + if (!isset($fieldName)) { + $fieldName = $this->getFieldName(); + } + if (!isset($entityName)) { + $entityName = $this->getEntityName(); + } - $entityDefs = $this->getDefs($isOrmEntityDefs); + $entityDefs = $this->getDefs($isOrmEntityDefs); - if (isset($entityDefs[$entityName]) && isset($entityDefs[$entityName]['fields'][$fieldName])) { - return $entityDefs[$entityName]['fields'][$fieldName]; - } + if (isset($entityDefs[$entityName]) && isset($entityDefs[$entityName]['fields'][$fieldName])) { + return $entityDefs[$entityName]['fields'][$fieldName]; + } - return $returns; - } + return $returns; + } - /** - * Get relation params by name for a specified entity - * - * @param string $linkName - * @param string $entityName - * @param bool $isOrmEntityDefs - * @param mixed $returns - * @return mixed - */ - protected function getLinkParams($linkName = null, $entityName = null, $isOrmEntityDefs = false, $returns = null) - { - if (!isset($linkName)) { - $linkName = $this->getLinkName(); - } - if (!isset($entityName)) { - $entityName = $this->getEntityName(); - } + /** + * Get relation params by name for a specified entity + * + * @param string $linkName + * @param string $entityName + * @param bool $isOrmEntityDefs + * @param mixed $returns + * @return mixed + */ + protected function getLinkParams($linkName = null, $entityName = null, $isOrmEntityDefs = false, $returns = null) + { + if (!isset($linkName)) { + $linkName = $this->getLinkName(); + } + if (!isset($entityName)) { + $entityName = $this->getEntityName(); + } - $entityDefs = $this->getDefs($isOrmEntityDefs); - $relationKeyName = $isOrmEntityDefs ? 'relations' : 'links'; + $entityDefs = $this->getDefs($isOrmEntityDefs); + $relationKeyName = $isOrmEntityDefs ? 'relations' : 'links'; - if (isset($entityDefs[$entityName]) && isset($entityDefs[$entityName][$relationKeyName][$linkName])) { - return $entityDefs[$entityName][$relationKeyName][$linkName]; - } + if (isset($entityDefs[$entityName]) && isset($entityDefs[$entityName][$relationKeyName][$linkName])) { + return $entityDefs[$entityName][$relationKeyName][$linkName]; + } - return $returns; - } + return $returns; + } - /** - * Get Foreign field - * - * @param string $name - * @param string $entityName - * @return string - */ - protected function getForeignField($name, $entityName) - { - $foreignField = $this->getMetadata()->get('entityDefs.'.$entityName.'.fields.'.$name); + /** + * Get Foreign field + * + * @param string $name + * @param string $entityName + * @return string + */ + protected function getForeignField($name, $entityName) + { + $foreignField = $this->getMetadata()->get('entityDefs.'.$entityName.'.fields.'.$name); - if ($foreignField['type'] != 'varchar') { - if ($foreignField['type'] == 'personName') { - return array('first' . ucfirst($name), ' ', 'last' . ucfirst($name)); - } - } + if ($foreignField['type'] != 'varchar') { + if ($foreignField['type'] == 'personName') { + return array('first' . ucfirst($name), ' ', 'last' . ucfirst($name)); + } + } - return $name; - } + return $name; + } - /** - * Set a value for all elements of array. So, in result all elements will have the same values - * - * @param string $value - * @param array $array - */ - protected function setArrayValue($inputValue, array $array) - { - foreach ($array as &$value) { - $value = $inputValue; - } + /** + * Set a value for all elements of array. So, in result all elements will have the same values + * + * @param string $value + * @param array $array + */ + protected function setArrayValue($inputValue, array $array) + { + foreach ($array as &$value) { + $value = $inputValue; + } - return $array; - } + return $array; + } } diff --git a/application/Espo/Core/Utils/Database/Orm/Converter.php b/application/Espo/Core/Utils/Database/Orm/Converter.php index 5527ad3e09..07c9ac09df 100644 --- a/application/Espo/Core/Utils/Database/Orm/Converter.php +++ b/application/Espo/Core/Utils/Database/Orm/Converter.php @@ -23,402 +23,402 @@ namespace Espo\Core\Utils\Database\Orm; use Espo\Core\Utils\Util, - Espo\ORM\Entity; + Espo\ORM\Entity; class Converter { - private $metadata; - private $fileManager; - private $metadataUtils; - - private $relationManager; - - private $entityDefs; - - protected $defaultFieldType = 'varchar'; - protected $defaultNaming = 'postfix'; - - protected $defaultLength = array( - 'varchar' => 255, - 'int' => 11, - ); - - protected $defaultValue = array( - 'bool' => false, - ); - - /* - * //pair Espo => ORM - */ - protected $fieldAccordances = array( - 'type' => 'type', - 'dbType' => 'dbType', - 'maxLength' => 'len', - 'len' => 'len', - 'notNull' => 'notNull', - 'autoincrement' => 'autoincrement', - 'entity' => 'entity', - 'notStorable' => 'notStorable', - 'link' => 'relation', - 'field' => 'foreign', //todo change "foreign" to "field" - 'unique' => 'unique', - 'index' => 'index', - /*'conditions' => 'conditions', - 'additionalColumns' => 'additionalColumns', */ - 'default' => array( - 'condition' => '^javascript:', - 'conditionEquals' => false, - 'value' => array( - 'default' => '{0}', - ), - ), - 'select' => 'select', - 'orderBy' => 'orderBy', - 'where' => 'where', - ); - - protected $idParams = array( - 'dbType' => 'varchar', - 'len' => '24', - ); - - - public function __construct(\Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\File\Manager $fileManager) - { - $this->metadata = $metadata; - $this->fileManager = $fileManager; //need to featue with ormHooks. Ex. isFollowed field - - $this->relationManager = new RelationManager($this->metadata); - - $this->metadataUtils = new \Espo\Core\Utils\Metadata\Utils($this->metadata); - - $this->entityDefs = $this->getMetadata()->get('entityDefs'); - } - - - protected function getMetadata() - { - return $this->metadata; - } - - protected function getEntityDefs() - { - return $this->entityDefs; - } - - protected function getFileManager() - { - return $this->fileManager; - } - - protected function getRelationManager() - { - return $this->relationManager; - } - - protected function getMetadataUtils() - { - return $this->metadataUtils; - } - - public function process() - { - $entityDefs = $this->getEntityDefs(); - - $ormMeta = array(); - foreach($entityDefs as $entityName => $entityMeta) { - - if (empty($entityMeta)) { - $GLOBALS['log']->critical('Orm\Converter:process(), Entity:'.$entityName.' - metadata cannot be converted into ORM format'); - continue; - } - - $ormMeta = Util::merge($ormMeta, $this->convertEntity($entityName, $entityMeta)); - } - - $ormMeta = $this->afterProcess($ormMeta); - - return $ormMeta; - } - - protected function convertEntity($entityName, $entityMeta) - { - $ormMeta = array(); - $ormMeta[$entityName] = array( - 'fields' => array( - ), - 'relations' => array( - ), - ); - - $ormMeta[$entityName]['fields'] = $this->convertFields($entityName, $entityMeta); - - $convertedLinks = $this->convertLinks($entityName, $entityMeta, $ormMeta); - - $ormMeta = Util::merge($ormMeta, $convertedLinks); - - return $ormMeta; - } - - public function afterProcess(array $ormMeta) - { - $entityDefs = $this->getEntityDefs(); - - $currentOrmMeta = $ormMeta; - //load custom field definitions and customCodes - foreach($currentOrmMeta as $entityName => $entityParams) { - foreach($entityParams['fields'] as $fieldName => $fieldParams) { - - //load custom field definitions - $fieldType = ucfirst($fieldParams['type']); - $className = '\Espo\Custom\Core\Utils\Database\Orm\Fields\\'.$fieldType; - if (!class_exists($className)) { - $className = '\Espo\Core\Utils\Database\Orm\Fields\\'.$fieldType; - } - - if (class_exists($className) && method_exists($className, 'load')) { - $helperClass = new $className($this->metadata, $ormMeta, $entityDefs); - $fieldResult = $helperClass->process( $fieldName, $entityName ); - if (isset($fieldResult['unset'])) { - $ormMeta = Util::unsetInArray($ormMeta, $fieldResult['unset']); - unset($fieldResult['unset']); - } - - $ormMeta = Util::merge($ormMeta, $fieldResult); - - } //END: load custom field definitions - - //todo move to separate file - //add a field 'isFollowed' for scopes with 'stream => true' - $scopeDefs = $this->getMetadata()->get('scopes.'.$entityName); - if (isset($scopeDefs['stream']) && $scopeDefs['stream']) { - if (!isset($entityParams['fields']['isFollowed'])) { - $ormMeta[$entityName]['fields']['isFollowed'] = array( - 'type' => 'varchar', - 'notStorable' => true, - ); - } - } //END: add a field 'isFollowed' for stream => true - - } - } - - foreach($ormMeta as $entityName => &$entityParams) { - foreach($entityParams['fields'] as $fieldName => &$fieldParams) { - - switch ($fieldParams['type']) { - case 'id': - if ($fieldParams['dbType'] != 'int') { - $fieldParams = array_merge($fieldParams, $this->idParams); - } - break; - - case 'foreignId': - $fieldParams = array_merge($fieldParams, $this->idParams); - $fieldParams['notNull'] = false; - break; - - case 'foreignType': - $fieldParams['dbType'] = Entity::VARCHAR; - $fieldParams['len'] = $this->defaultLength['varchar']; - break; - - case 'bool': - $fieldParams['default'] = isset($fieldParams['default']) ? (bool) $fieldParams['default'] : $this->defaultValue['bool']; - break; - } - } - - } - - return $ormMeta; - } - - /** - * Metadata conversion from Espo format into Doctrine - * - * @param string $entityName - * @param array $entityMeta - * - * @return array - */ - protected function convertFields($entityName, &$entityMeta) - { - $outputMeta = array( - 'id' => array( - 'type' => Entity::ID, - 'dbType' => 'varchar', - ), - 'name' => array( - 'type' => isset($entityMeta['fields']['name']['type']) ? $entityMeta['fields']['name']['type'] : Entity::VARCHAR, - 'notStorable' => true, - ), - ); - - foreach($entityMeta['fields'] as $fieldName => $fieldParams) { - - /** check if "fields" option exists in $fieldMeta */ - $fieldTypeMeta = $this->getMetadataUtils()->getFieldDefsByType($fieldParams); - - if (isset($fieldTypeMeta['fields']) && is_array($fieldTypeMeta['fields'])) { - - foreach($fieldTypeMeta['actualFields'] as $subFieldName) { - - $subField = $this->convertActualFields($entityName, $fieldName, $fieldParams, $subFieldName, $fieldTypeMeta); - - if (!isset($outputMeta[ $subField['naming'] ])) { - $subFieldDefs = $this->convertField($entityName, $subField['name'], $subField['params']); - if ($subFieldDefs !== false) { - $outputMeta[ $subField['naming'] ] = $subFieldDefs; //push fieldDefs to the main array - } - } - } - } else { - $fieldDefs = $this->convertField($entityName, $fieldName, $fieldParams, $fieldTypeMeta); - if ($fieldDefs !== false) { - $outputMeta[$fieldName] = $fieldDefs; //push fieldDefs to the main array - } - } - - /** check and set the linkDefs from 'fields' metadata */ - if (isset($fieldTypeMeta['linkDefs'])) { - $linkDefs = $this->getMetadataUtils()->getLinkDefsInFieldMeta($entityName, $fieldParams, $fieldTypeMeta['linkDefs']); - if (isset($linkDefs)) { - $entityMeta['links'] = Util::merge( array($fieldName => $linkDefs), $entityMeta['links'] ); - } - } - } - - if (!isset($outputMeta['deleted'])) { - $outputMeta['deleted'] = array( - 'type' => Entity::BOOL, - 'default' => false, - ); - } - - return $outputMeta; - } - - protected function convertField($entityName, $fieldName, array $fieldParams, $fieldTypeMeta = null) - { - /** set default type if exists */ - if (!isset($fieldParams['type']) || empty($fieldParams['type'])) { - $GLOBALS['log']->debug('Field type does not exist for '.$entityName.':'.$fieldName.'. Use default type ['.$this->defaultFieldType.']'); - $fieldParams['type'] = $this->defaultFieldType; - } /** END: set default type if exists */ - - /** merge fieldDefs option from field definition */ - if (!isset($fieldTypeMeta)) { - $fieldTypeMeta = $this->getMetadataUtils()->getFieldDefsByType($fieldParams); - } - - if (isset($fieldTypeMeta['fieldDefs'])) { - $fieldParams = Util::merge($fieldParams, $fieldTypeMeta['fieldDefs']); - } - - /** check if need to skip this field in ORM metadata */ - if (isset($fieldParams['skip']) && $fieldParams['skip'] === true) { - return false; - } - - /** if defined 'notNull => false' and 'required => true', then remove 'notNull' */ - if (isset($fieldParams['notNull']) && !$fieldParams['notNull'] && isset($fieldParams['required']) && $fieldParams['required']) { - unset($fieldParams['notNull']); - } - - $fieldDefs = $this->getInitValues($fieldParams); - - /** check if the field need to be saved in database */ - if ( (isset($fieldParams['db']) && $fieldParams['db'] === false) ) { - $fieldDefs['notStorable'] = true; - } - - /** check and set the field length */ - if (!isset($fieldDefs['len']) && in_array($fieldDefs['type'], array_keys($this->defaultLength))) { - $fieldDefs['len'] = $this->defaultLength[$fieldDefs['type']]; - } - - return $fieldDefs; - } - - protected function convertActualFields($entityName, $fieldName, $fieldParams, $subFieldName, $fieldTypeMeta) - { - $subField = array(); - - $subField['params'] = $this->getInitValues($fieldParams); - - if (isset($fieldTypeMeta['fieldDefs'])) { - $subField['params'] = Util::merge($subField['params'], $fieldTypeMeta['fieldDefs']); - } - - //if empty field name, then use the main field - if (trim($subFieldName) == '') { + private $metadata; + private $fileManager; + private $metadataUtils; + + private $relationManager; + + private $entityDefs; + + protected $defaultFieldType = 'varchar'; + protected $defaultNaming = 'postfix'; + + protected $defaultLength = array( + 'varchar' => 255, + 'int' => 11, + ); + + protected $defaultValue = array( + 'bool' => false, + ); + + /* + * //pair Espo => ORM + */ + protected $fieldAccordances = array( + 'type' => 'type', + 'dbType' => 'dbType', + 'maxLength' => 'len', + 'len' => 'len', + 'notNull' => 'notNull', + 'autoincrement' => 'autoincrement', + 'entity' => 'entity', + 'notStorable' => 'notStorable', + 'link' => 'relation', + 'field' => 'foreign', //todo change "foreign" to "field" + 'unique' => 'unique', + 'index' => 'index', + /*'conditions' => 'conditions', + 'additionalColumns' => 'additionalColumns', */ + 'default' => array( + 'condition' => '^javascript:', + 'conditionEquals' => false, + 'value' => array( + 'default' => '{0}', + ), + ), + 'select' => 'select', + 'orderBy' => 'orderBy', + 'where' => 'where', + ); + + protected $idParams = array( + 'dbType' => 'varchar', + 'len' => '24', + ); + + + public function __construct(\Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\File\Manager $fileManager) + { + $this->metadata = $metadata; + $this->fileManager = $fileManager; //need to featue with ormHooks. Ex. isFollowed field + + $this->relationManager = new RelationManager($this->metadata); + + $this->metadataUtils = new \Espo\Core\Utils\Metadata\Utils($this->metadata); + + $this->entityDefs = $this->getMetadata()->get('entityDefs'); + } + + + protected function getMetadata() + { + return $this->metadata; + } + + protected function getEntityDefs() + { + return $this->entityDefs; + } + + protected function getFileManager() + { + return $this->fileManager; + } + + protected function getRelationManager() + { + return $this->relationManager; + } + + protected function getMetadataUtils() + { + return $this->metadataUtils; + } + + public function process() + { + $entityDefs = $this->getEntityDefs(); + + $ormMeta = array(); + foreach($entityDefs as $entityName => $entityMeta) { + + if (empty($entityMeta)) { + $GLOBALS['log']->critical('Orm\Converter:process(), Entity:'.$entityName.' - metadata cannot be converted into ORM format'); + continue; + } + + $ormMeta = Util::merge($ormMeta, $this->convertEntity($entityName, $entityMeta)); + } + + $ormMeta = $this->afterProcess($ormMeta); + + return $ormMeta; + } + + protected function convertEntity($entityName, $entityMeta) + { + $ormMeta = array(); + $ormMeta[$entityName] = array( + 'fields' => array( + ), + 'relations' => array( + ), + ); + + $ormMeta[$entityName]['fields'] = $this->convertFields($entityName, $entityMeta); + + $convertedLinks = $this->convertLinks($entityName, $entityMeta, $ormMeta); + + $ormMeta = Util::merge($ormMeta, $convertedLinks); + + return $ormMeta; + } + + public function afterProcess(array $ormMeta) + { + $entityDefs = $this->getEntityDefs(); + + $currentOrmMeta = $ormMeta; + //load custom field definitions and customCodes + foreach($currentOrmMeta as $entityName => $entityParams) { + foreach($entityParams['fields'] as $fieldName => $fieldParams) { + + //load custom field definitions + $fieldType = ucfirst($fieldParams['type']); + $className = '\Espo\Custom\Core\Utils\Database\Orm\Fields\\'.$fieldType; + if (!class_exists($className)) { + $className = '\Espo\Core\Utils\Database\Orm\Fields\\'.$fieldType; + } + + if (class_exists($className) && method_exists($className, 'load')) { + $helperClass = new $className($this->metadata, $ormMeta, $entityDefs); + $fieldResult = $helperClass->process( $fieldName, $entityName ); + if (isset($fieldResult['unset'])) { + $ormMeta = Util::unsetInArray($ormMeta, $fieldResult['unset']); + unset($fieldResult['unset']); + } + + $ormMeta = Util::merge($ormMeta, $fieldResult); + + } //END: load custom field definitions + + //todo move to separate file + //add a field 'isFollowed' for scopes with 'stream => true' + $scopeDefs = $this->getMetadata()->get('scopes.'.$entityName); + if (isset($scopeDefs['stream']) && $scopeDefs['stream']) { + if (!isset($entityParams['fields']['isFollowed'])) { + $ormMeta[$entityName]['fields']['isFollowed'] = array( + 'type' => 'varchar', + 'notStorable' => true, + ); + } + } //END: add a field 'isFollowed' for stream => true + + } + } + + foreach($ormMeta as $entityName => &$entityParams) { + foreach($entityParams['fields'] as $fieldName => &$fieldParams) { + + switch ($fieldParams['type']) { + case 'id': + if ($fieldParams['dbType'] != 'int') { + $fieldParams = array_merge($fieldParams, $this->idParams); + } + break; + + case 'foreignId': + $fieldParams = array_merge($fieldParams, $this->idParams); + $fieldParams['notNull'] = false; + break; + + case 'foreignType': + $fieldParams['dbType'] = Entity::VARCHAR; + $fieldParams['len'] = $this->defaultLength['varchar']; + break; + + case 'bool': + $fieldParams['default'] = isset($fieldParams['default']) ? (bool) $fieldParams['default'] : $this->defaultValue['bool']; + break; + } + } + + } + + return $ormMeta; + } + + /** + * Metadata conversion from Espo format into Doctrine + * + * @param string $entityName + * @param array $entityMeta + * + * @return array + */ + protected function convertFields($entityName, &$entityMeta) + { + $outputMeta = array( + 'id' => array( + 'type' => Entity::ID, + 'dbType' => 'varchar', + ), + 'name' => array( + 'type' => isset($entityMeta['fields']['name']['type']) ? $entityMeta['fields']['name']['type'] : Entity::VARCHAR, + 'notStorable' => true, + ), + ); + + foreach($entityMeta['fields'] as $fieldName => $fieldParams) { + + /** check if "fields" option exists in $fieldMeta */ + $fieldTypeMeta = $this->getMetadataUtils()->getFieldDefsByType($fieldParams); + + if (isset($fieldTypeMeta['fields']) && is_array($fieldTypeMeta['fields'])) { + + foreach($fieldTypeMeta['actualFields'] as $subFieldName) { + + $subField = $this->convertActualFields($entityName, $fieldName, $fieldParams, $subFieldName, $fieldTypeMeta); + + if (!isset($outputMeta[ $subField['naming'] ])) { + $subFieldDefs = $this->convertField($entityName, $subField['name'], $subField['params']); + if ($subFieldDefs !== false) { + $outputMeta[ $subField['naming'] ] = $subFieldDefs; //push fieldDefs to the main array + } + } + } + } else { + $fieldDefs = $this->convertField($entityName, $fieldName, $fieldParams, $fieldTypeMeta); + if ($fieldDefs !== false) { + $outputMeta[$fieldName] = $fieldDefs; //push fieldDefs to the main array + } + } + + /** check and set the linkDefs from 'fields' metadata */ + if (isset($fieldTypeMeta['linkDefs'])) { + $linkDefs = $this->getMetadataUtils()->getLinkDefsInFieldMeta($entityName, $fieldParams, $fieldTypeMeta['linkDefs']); + if (isset($linkDefs)) { + $entityMeta['links'] = Util::merge( array($fieldName => $linkDefs), $entityMeta['links'] ); + } + } + } + + if (!isset($outputMeta['deleted'])) { + $outputMeta['deleted'] = array( + 'type' => Entity::BOOL, + 'default' => false, + ); + } + + return $outputMeta; + } + + protected function convertField($entityName, $fieldName, array $fieldParams, $fieldTypeMeta = null) + { + /** set default type if exists */ + if (!isset($fieldParams['type']) || empty($fieldParams['type'])) { + $GLOBALS['log']->debug('Field type does not exist for '.$entityName.':'.$fieldName.'. Use default type ['.$this->defaultFieldType.']'); + $fieldParams['type'] = $this->defaultFieldType; + } /** END: set default type if exists */ + + /** merge fieldDefs option from field definition */ + if (!isset($fieldTypeMeta)) { + $fieldTypeMeta = $this->getMetadataUtils()->getFieldDefsByType($fieldParams); + } + + if (isset($fieldTypeMeta['fieldDefs'])) { + $fieldParams = Util::merge($fieldParams, $fieldTypeMeta['fieldDefs']); + } + + /** check if need to skip this field in ORM metadata */ + if (isset($fieldParams['skip']) && $fieldParams['skip'] === true) { + return false; + } + + /** if defined 'notNull => false' and 'required => true', then remove 'notNull' */ + if (isset($fieldParams['notNull']) && !$fieldParams['notNull'] && isset($fieldParams['required']) && $fieldParams['required']) { + unset($fieldParams['notNull']); + } + + $fieldDefs = $this->getInitValues($fieldParams); + + /** check if the field need to be saved in database */ + if ( (isset($fieldParams['db']) && $fieldParams['db'] === false) ) { + $fieldDefs['notStorable'] = true; + } + + /** check and set the field length */ + if (!isset($fieldDefs['len']) && in_array($fieldDefs['type'], array_keys($this->defaultLength))) { + $fieldDefs['len'] = $this->defaultLength[$fieldDefs['type']]; + } + + return $fieldDefs; + } + + protected function convertActualFields($entityName, $fieldName, $fieldParams, $subFieldName, $fieldTypeMeta) + { + $subField = array(); + + $subField['params'] = $this->getInitValues($fieldParams); + + if (isset($fieldTypeMeta['fieldDefs'])) { + $subField['params'] = Util::merge($subField['params'], $fieldTypeMeta['fieldDefs']); + } + + //if empty field name, then use the main field + if (trim($subFieldName) == '') { - $subField['name'] = $fieldName; - $subField['naming'] = $fieldName; - - } else { - - $namingType = isset($fieldTypeMeta['naming']) ? $fieldTypeMeta['naming'] : $this->defaultNaming; - - $subField['name'] = $subFieldName; - $subField['naming'] = Util::getNaming($fieldName, $subFieldName, $namingType); - if (isset($fieldTypeMeta['fields'][$subFieldName])) { - $subField['params'] = Util::merge($subField['params'], $fieldTypeMeta['fields'][$subFieldName]); - } - - } - - return $subField; - } - - protected function convertLinks($entityName, $entityMeta, $ormMeta) - { - if (!isset($entityMeta['links'])) { - return array(); - } + $subField['name'] = $fieldName; + $subField['naming'] = $fieldName; + + } else { + + $namingType = isset($fieldTypeMeta['naming']) ? $fieldTypeMeta['naming'] : $this->defaultNaming; + + $subField['name'] = $subFieldName; + $subField['naming'] = Util::getNaming($fieldName, $subFieldName, $namingType); + if (isset($fieldTypeMeta['fields'][$subFieldName])) { + $subField['params'] = Util::merge($subField['params'], $fieldTypeMeta['fields'][$subFieldName]); + } + + } + + return $subField; + } + + protected function convertLinks($entityName, $entityMeta, $ormMeta) + { + if (!isset($entityMeta['links'])) { + return array(); + } - $entityDefs = $this->getEntityDefs(); + $entityDefs = $this->getEntityDefs(); - $relationships = array(); - foreach($entityMeta['links'] as $linkName => $linkParams) { + $relationships = array(); + foreach($entityMeta['links'] as $linkName => $linkParams) { - $convertedLink = $this->getRelationManager()->convert($linkName, $linkParams, $entityName, $ormMeta); + $convertedLink = $this->getRelationManager()->convert($linkName, $linkParams, $entityName, $ormMeta); - if (isset($convertedLink)) { - $relationships = Util::merge($convertedLink, $relationships); - } - } + if (isset($convertedLink)) { + $relationships = Util::merge($convertedLink, $relationships); + } + } - return $relationships; - } + return $relationships; + } - protected function getInitValues(array $fieldParams) - { - $values = array(); - foreach($this->fieldAccordances as $espoType => $ormType) { + protected function getInitValues(array $fieldParams) + { + $values = array(); + foreach($this->fieldAccordances as $espoType => $ormType) { - if (isset($fieldParams[$espoType])) { + if (isset($fieldParams[$espoType])) { - if (is_array($ormType)) { + if (is_array($ormType)) { - $conditionRes = false; - if (!is_array($fieldParams[$espoType])) { - $conditionRes = preg_match('/'.$ormType['condition'].'/i', $fieldParams[$espoType]); - } + $conditionRes = false; + if (!is_array($fieldParams[$espoType])) { + $conditionRes = preg_match('/'.$ormType['condition'].'/i', $fieldParams[$espoType]); + } - if (!$conditionRes || ($conditionRes && $conditionRes === $ormType['conditionEquals']) ) { - $value = is_array($fieldParams[$espoType]) ? json_encode($fieldParams[$espoType]) : $fieldParams[$espoType]; - $values = Util::merge( $values, Util::replaceInArray('{0}', $value, $ormType['value']) ); - } - } else { - $values[$ormType] = $fieldParams[$espoType]; - } + if (!$conditionRes || ($conditionRes && $conditionRes === $ormType['conditionEquals']) ) { + $value = is_array($fieldParams[$espoType]) ? json_encode($fieldParams[$espoType]) : $fieldParams[$espoType]; + $values = Util::merge( $values, Util::replaceInArray('{0}', $value, $ormType['value']) ); + } + } else { + $values[$ormType] = $fieldParams[$espoType]; + } - } - } + } + } - return $values; - } + return $values; + } } diff --git a/application/Espo/Core/Utils/Database/Orm/Fields/Currency.php b/application/Espo/Core/Utils/Database/Orm/Fields/Currency.php index f3d56094a2..12013e34b1 100644 --- a/application/Espo/Core/Utils/Database/Orm/Fields/Currency.php +++ b/application/Espo/Core/Utils/Database/Orm/Fields/Currency.php @@ -26,39 +26,39 @@ use Espo\Core\Utils\Util; class Currency extends \Espo\Core\Utils\Database\Orm\Base { - protected function load($fieldName, $entityName) - { - $converedFieldName = $fieldName . 'Converted'; - - $currencyColumnName = Util::toUnderScore($fieldName); - - $alias = Util::toUnderScore($fieldName) . "_currency_alias"; - - return array( - $entityName => array( - 'fields' => array( - $fieldName => array( - "type" => "float", - "orderBy" => $converedFieldName . " {direction}" - ), - $fieldName . 'Converted' => array( - 'type' => 'float', - 'select' => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate" , - 'where' => - array ( - "=" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate = {value}", - ">" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate > {value}", - "<" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate < {value}", - ">=" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate >= {value}", - "<=" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate <= {value}", - "<>" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate <> {value}" - ), - 'notStorable' => true, - 'orderBy' => $converedFieldName . " {direction}" - ), - ), - ), - ); - } + protected function load($fieldName, $entityName) + { + $converedFieldName = $fieldName . 'Converted'; + + $currencyColumnName = Util::toUnderScore($fieldName); + + $alias = Util::toUnderScore($fieldName) . "_currency_alias"; + + return array( + $entityName => array( + 'fields' => array( + $fieldName => array( + "type" => "float", + "orderBy" => $converedFieldName . " {direction}" + ), + $fieldName . 'Converted' => array( + 'type' => 'float', + 'select' => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate" , + 'where' => + array ( + "=" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate = {value}", + ">" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate > {value}", + "<" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate < {value}", + ">=" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate >= {value}", + "<=" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate <= {value}", + "<>" => Util::toUnderScore($entityName) . "." . $currencyColumnName . " * {$alias}.rate <> {value}" + ), + 'notStorable' => true, + 'orderBy' => $converedFieldName . " {direction}" + ), + ), + ), + ); + } } diff --git a/application/Espo/Core/Utils/Database/Orm/Fields/Email.php b/application/Espo/Core/Utils/Database/Orm/Fields/Email.php index 0ecfc60968..422e34557b 100644 --- a/application/Espo/Core/Utils/Database/Orm/Fields/Email.php +++ b/application/Espo/Core/Utils/Database/Orm/Fields/Email.php @@ -24,74 +24,74 @@ namespace Espo\Core\Utils\Database\Orm\Fields; class Email extends \Espo\Core\Utils\Database\Orm\Base { - protected function load($fieldName, $entityName) - { - return array( - $entityName => array( - 'fields' => array( - $fieldName => array( - 'select' => 'email_address.name', - 'where' => - array ( - 'LIKE' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( - SELECT entity_id - FROM entity_email_address - JOIN email_address ON email_address.id = entity_email_address.email_address_id - WHERE - entity_email_address.deleted = 0 AND entity_email_address.entity_type = '{$entityName}' AND - email_address.deleted = 0 AND email_address.name LIKE {value} - )", - '=' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( - SELECT entity_id - FROM entity_email_address - JOIN email_address ON email_address.id = entity_email_address.email_address_id - WHERE - entity_email_address.deleted = 0 AND entity_email_address.entity_type = '{$entityName}' AND - email_address.deleted = 0 AND email_address.name = {value} - )", - '<>' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( - SELECT entity_id - FROM entity_email_address - JOIN email_address ON email_address.id = entity_email_address.email_address_id - WHERE - entity_email_address.deleted = 0 AND entity_email_address.entity_type = '{$entityName}' AND - email_address.deleted = 0 AND email_address.name <> {value} - )" - ), - 'orderBy' => 'email_address.name {direction}', - ), - $fieldName .'Data' => array( - 'type' => 'text', - 'notStorable' => true - ), - ), - 'relations' => array( - $fieldName.'es' => array( - 'type' => 'manyMany', - 'entity' => 'EmailAddress', - 'relationName' => 'entityEmailAddress', - 'midKeys' => array( - 'entity_id', - 'email_address_id', - ), - 'conditions' => array( - 'entityType' => $entityName, - ), - 'additionalColumns' => array( - 'entityType' => array( - 'type' => 'varchar', - 'len' => 100, - ), - 'primary' => array( - 'type' => 'bool', - 'default' => false, - ), - ), - ), - ), - ), - ); - } + protected function load($fieldName, $entityName) + { + return array( + $entityName => array( + 'fields' => array( + $fieldName => array( + 'select' => 'email_address.name', + 'where' => + array ( + 'LIKE' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( + SELECT entity_id + FROM entity_email_address + JOIN email_address ON email_address.id = entity_email_address.email_address_id + WHERE + entity_email_address.deleted = 0 AND entity_email_address.entity_type = '{$entityName}' AND + email_address.deleted = 0 AND email_address.name LIKE {value} + )", + '=' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( + SELECT entity_id + FROM entity_email_address + JOIN email_address ON email_address.id = entity_email_address.email_address_id + WHERE + entity_email_address.deleted = 0 AND entity_email_address.entity_type = '{$entityName}' AND + email_address.deleted = 0 AND email_address.name = {value} + )", + '<>' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( + SELECT entity_id + FROM entity_email_address + JOIN email_address ON email_address.id = entity_email_address.email_address_id + WHERE + entity_email_address.deleted = 0 AND entity_email_address.entity_type = '{$entityName}' AND + email_address.deleted = 0 AND email_address.name <> {value} + )" + ), + 'orderBy' => 'email_address.name {direction}', + ), + $fieldName .'Data' => array( + 'type' => 'text', + 'notStorable' => true + ), + ), + 'relations' => array( + $fieldName.'es' => array( + 'type' => 'manyMany', + 'entity' => 'EmailAddress', + 'relationName' => 'entityEmailAddress', + 'midKeys' => array( + 'entity_id', + 'email_address_id', + ), + 'conditions' => array( + 'entityType' => $entityName, + ), + 'additionalColumns' => array( + 'entityType' => array( + 'type' => 'varchar', + 'len' => 100, + ), + 'primary' => array( + 'type' => 'bool', + 'default' => false, + ), + ), + ), + ), + ), + ); + } } diff --git a/application/Espo/Core/Utils/Database/Orm/Fields/LinkMultiple.php b/application/Espo/Core/Utils/Database/Orm/Fields/LinkMultiple.php index fba8cfce4b..62e42b261e 100644 --- a/application/Espo/Core/Utils/Database/Orm/Fields/LinkMultiple.php +++ b/application/Espo/Core/Utils/Database/Orm/Fields/LinkMultiple.php @@ -24,38 +24,38 @@ namespace Espo\Core\Utils\Database\Orm\Fields; class LinkMultiple extends \Espo\Core\Utils\Database\Orm\Base { - protected function load($fieldName, $entityName) - { - $data = array( - $entityName => array ( - 'fields' => array( - $fieldName.'Ids' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - $fieldName.'Names' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - ), - ), - 'unset' => array( - $entityName => array( - 'fields.'.$fieldName, - ), - ), - ); + protected function load($fieldName, $entityName) + { + $data = array( + $entityName => array ( + 'fields' => array( + $fieldName.'Ids' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + $fieldName.'Names' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + ), + ), + 'unset' => array( + $entityName => array( + 'fields.'.$fieldName, + ), + ), + ); - $columns = $this->getMetadata()->get("entityDefs.{$entityName}.fields.{$fieldName}.columns"); - if (!empty($columns)) { - $data[$entityName]['fields'][$fieldName . 'Columns'] = array( - 'type' => 'varchar', - 'notStorable' => true, - ); - } + $columns = $this->getMetadata()->get("entityDefs.{$entityName}.fields.{$fieldName}.columns"); + if (!empty($columns)) { + $data[$entityName]['fields'][$fieldName . 'Columns'] = array( + 'type' => 'varchar', + 'notStorable' => true, + ); + } - return $data; - } + return $data; + } } diff --git a/application/Espo/Core/Utils/Database/Orm/Fields/LinkParent.php b/application/Espo/Core/Utils/Database/Orm/Fields/LinkParent.php index 34998bbd61..4006275eb0 100644 --- a/application/Espo/Core/Utils/Database/Orm/Fields/LinkParent.php +++ b/application/Espo/Core/Utils/Database/Orm/Fields/LinkParent.php @@ -24,28 +24,28 @@ namespace Espo\Core\Utils\Database\Orm\Fields; class LinkParent extends \Espo\Core\Utils\Database\Orm\Base { - protected function load($fieldName, $entityName) - { - return array( - $entityName => array ( - 'fields' => array( - $fieldName.'Id' => array( - 'type' => 'foreignId', - 'index' => $fieldName, - ), - $fieldName.'Type' => array( - 'type' => 'foreignType', - 'notNull' => false, - 'index' => $fieldName, - ), - $fieldName.'Name' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - ), - ), - ); - } + protected function load($fieldName, $entityName) + { + return array( + $entityName => array ( + 'fields' => array( + $fieldName.'Id' => array( + 'type' => 'foreignId', + 'index' => $fieldName, + ), + $fieldName.'Type' => array( + 'type' => 'foreignType', + 'notNull' => false, + 'index' => $fieldName, + ), + $fieldName.'Name' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + ), + ), + ); + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Fields/PersonName.php b/application/Espo/Core/Utils/Database/Orm/Fields/PersonName.php index b1bb17c231..b924a73aad 100644 --- a/application/Espo/Core/Utils/Database/Orm/Fields/PersonName.php +++ b/application/Espo/Core/Utils/Database/Orm/Fields/PersonName.php @@ -26,65 +26,65 @@ use Espo\Core\Utils\Util; class PersonName extends \Espo\Core\Utils\Database\Orm\Base { - protected function load($fieldName, $entityName) - { - $foreignField = array('first' . ucfirst($fieldName), ' ', 'last' . ucfirst($fieldName)); - - $tableName = Util::toUnderScore($entityName); + protected function load($fieldName, $entityName) + { + $foreignField = array('first' . ucfirst($fieldName), ' ', 'last' . ucfirst($fieldName)); + + $tableName = Util::toUnderScore($entityName); - $fullList = array(); //contains empty string (" ") like delimiter - $fullListReverse = array(); //reverse of $fullList - $fieldList = array(); //doesn't contain empty string (" ") like delimiter - $like = array(); - $equal = array(); + $fullList = array(); //contains empty string (" ") like delimiter + $fullListReverse = array(); //reverse of $fullList + $fieldList = array(); //doesn't contain empty string (" ") like delimiter + $like = array(); + $equal = array(); - foreach($foreignField as $foreignFieldName) { + foreach($foreignField as $foreignFieldName) { - $fieldNameTrimmed = trim($foreignFieldName); - if (!empty($fieldNameTrimmed)) { - $columnName = $tableName.'.'.Util::toUnderScore($fieldNameTrimmed); + $fieldNameTrimmed = trim($foreignFieldName); + if (!empty($fieldNameTrimmed)) { + $columnName = $tableName.'.'.Util::toUnderScore($fieldNameTrimmed); - $fullList[] = $fieldList[] = $columnName; - $like[] = $columnName." LIKE {value}"; - $equal[] = $columnName." = {value}"; - } else { - $fullList[] = "'".$foreignFieldName."'"; - } - } + $fullList[] = $fieldList[] = $columnName; + $like[] = $columnName." LIKE {value}"; + $equal[] = $columnName." = {value}"; + } else { + $fullList[] = "'".$foreignFieldName."'"; + } + } - $fullListReverse = array_reverse($fullList); + $fullListReverse = array_reverse($fullList); - return array( - $entityName => array ( - 'fields' => array( - $fieldName => array( - 'type' => 'varchar', - 'select' => $this->getSelect($fullList), - 'where' => array( - 'LIKE' => "(".implode(" OR ", $like)." OR CONCAT(".implode(", ", $fullList).") LIKE {value} OR CONCAT(".implode(", ", $fullListReverse).") LIKE {value})", - '=' => "(".implode(" OR ", $equal)." OR CONCAT(".implode(", ", $fullList).") = {value} OR CONCAT(".implode(", ", $fullListReverse).") = {value})", - ), - 'orderBy' => implode(", ", array_map(function ($item) {return $item . ' {direction}';}, $fieldList)), - ), - ), - ), - ); - } + return array( + $entityName => array ( + 'fields' => array( + $fieldName => array( + 'type' => 'varchar', + 'select' => $this->getSelect($fullList), + 'where' => array( + 'LIKE' => "(".implode(" OR ", $like)." OR CONCAT(".implode(", ", $fullList).") LIKE {value} OR CONCAT(".implode(", ", $fullListReverse).") LIKE {value})", + '=' => "(".implode(" OR ", $equal)." OR CONCAT(".implode(", ", $fullList).") = {value} OR CONCAT(".implode(", ", $fullListReverse).") = {value})", + ), + 'orderBy' => implode(", ", array_map(function ($item) {return $item . ' {direction}';}, $fieldList)), + ), + ), + ), + ); + } - protected function getSelect(array $fullList) - { - foreach ($fullList as &$item) { + protected function getSelect(array $fullList) + { + foreach ($fullList as &$item) { - $rowItem = trim($item, " '"); + $rowItem = trim($item, " '"); - if (!empty($rowItem)) { - $item = "IFNULL(".$item.", '')"; - } - } + if (!empty($rowItem)) { + $item = "IFNULL(".$item.", '')"; + } + } - $select = "TRIM(CONCAT(".implode(", ", $fullList)."))"; + $select = "TRIM(CONCAT(".implode(", ", $fullList)."))"; - return $select; - } + return $select; + } } diff --git a/application/Espo/Core/Utils/Database/Orm/Fields/Phone.php b/application/Espo/Core/Utils/Database/Orm/Fields/Phone.php index fb0a863b26..8e5baa60fa 100644 --- a/application/Espo/Core/Utils/Database/Orm/Fields/Phone.php +++ b/application/Espo/Core/Utils/Database/Orm/Fields/Phone.php @@ -24,74 +24,74 @@ namespace Espo\Core\Utils\Database\Orm\Fields; class Phone extends \Espo\Core\Utils\Database\Orm\Base { - protected function load($fieldName, $entityName) - { - return array( - $entityName => array( - 'fields' => array( - $fieldName => array( - 'select' => 'phone_number.name', - 'where' => - array ( - 'LIKE' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( - SELECT entity_id - FROM entity_phone_number - JOIN phone_number ON phone_number.id = entity_phone_number.phone_number_id - WHERE - entity_phone_number.deleted = 0 AND entity_phone_number.entity_type = '{$entityName}' AND - phone_number.deleted = 0 AND phone_number.name LIKE {value} - )", - '=' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( - SELECT entity_id - FROM entity_phone_number - JOIN phone_number ON phone_number.id = entity_phone_number.phone_number_id - WHERE - entity_phone_number.deleted = 0 AND entity_phone_number.entity_type = '{$entityName}' AND - phone_number.deleted = 0 AND phone_number.name = {value} - )", - '<>' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( - SELECT entity_id - FROM entity_phone_number - JOIN phone_number ON phone_number.id = entity_phone_number.phone_number_id - WHERE - entity_phone_number.deleted = 0 AND entity_phone_number.entity_type = '{$entityName}' AND - phone_number.deleted = 0 AND phone_number.name <> {value} - )" - ), - 'orderBy' => 'phone_number.name {direction}', - ), - $fieldName .'Data' => array( - 'type' => 'text', - 'notStorable' => true - ), - ), - 'relations' => array( - $fieldName.'s' => array( - 'type' => 'manyMany', - 'entity' => 'PhoneNumber', - 'relationName' => 'entityPhoneNumber', - 'midKeys' => array( - 'entity_id', - 'phone_number_id', - ), - 'conditions' => array( - 'entityType' => $entityName, - ), - 'additionalColumns' => array( - 'entityType' => array( - 'type' => 'varchar', - 'len' => 100, - ), - 'primary' => array( - 'type' => 'bool', - 'default' => false, - ), - ), - ), - ), - ), - ); - } + protected function load($fieldName, $entityName) + { + return array( + $entityName => array( + 'fields' => array( + $fieldName => array( + 'select' => 'phone_number.name', + 'where' => + array ( + 'LIKE' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( + SELECT entity_id + FROM entity_phone_number + JOIN phone_number ON phone_number.id = entity_phone_number.phone_number_id + WHERE + entity_phone_number.deleted = 0 AND entity_phone_number.entity_type = '{$entityName}' AND + phone_number.deleted = 0 AND phone_number.name LIKE {value} + )", + '=' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( + SELECT entity_id + FROM entity_phone_number + JOIN phone_number ON phone_number.id = entity_phone_number.phone_number_id + WHERE + entity_phone_number.deleted = 0 AND entity_phone_number.entity_type = '{$entityName}' AND + phone_number.deleted = 0 AND phone_number.name = {value} + )", + '<>' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN ( + SELECT entity_id + FROM entity_phone_number + JOIN phone_number ON phone_number.id = entity_phone_number.phone_number_id + WHERE + entity_phone_number.deleted = 0 AND entity_phone_number.entity_type = '{$entityName}' AND + phone_number.deleted = 0 AND phone_number.name <> {value} + )" + ), + 'orderBy' => 'phone_number.name {direction}', + ), + $fieldName .'Data' => array( + 'type' => 'text', + 'notStorable' => true + ), + ), + 'relations' => array( + $fieldName.'s' => array( + 'type' => 'manyMany', + 'entity' => 'PhoneNumber', + 'relationName' => 'entityPhoneNumber', + 'midKeys' => array( + 'entity_id', + 'phone_number_id', + ), + 'conditions' => array( + 'entityType' => $entityName, + ), + 'additionalColumns' => array( + 'entityType' => array( + 'type' => 'varchar', + 'len' => 100, + ), + 'primary' => array( + 'type' => 'bool', + 'default' => false, + ), + ), + ), + ), + ), + ); + } } diff --git a/application/Espo/Core/Utils/Database/Orm/RelationManager.php b/application/Espo/Core/Utils/Database/Orm/RelationManager.php index 14b0cc15f5..4d9903bcb0 100644 --- a/application/Espo/Core/Utils/Database/Orm/RelationManager.php +++ b/application/Espo/Core/Utils/Database/Orm/RelationManager.php @@ -26,118 +26,118 @@ use Espo\Core\Utils\Util; class RelationManager { - private $metadata; + private $metadata; - private $entityDefs; + private $entityDefs; - public function __construct(\Espo\Core\Utils\Metadata $metadata) - { - $this->metadata = $metadata; + public function __construct(\Espo\Core\Utils\Metadata $metadata) + { + $this->metadata = $metadata; - $this->entityDefs = $this->getMetadata()->get('entityDefs'); - } + $this->entityDefs = $this->getMetadata()->get('entityDefs'); + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - protected function getEntityDefs() - { - return $this->entityDefs; - } + protected function getEntityDefs() + { + return $this->entityDefs; + } - public function getLinkEntityName($entityName, $linkParams) - { - return isset($linkParams['entity']) ? $linkParams['entity'] : $entityName; - } + public function getLinkEntityName($entityName, $linkParams) + { + return isset($linkParams['entity']) ? $linkParams['entity'] : $entityName; + } - public function isRelationExists($relationName) - { - if ($this->getRelationClass($relationName) !== false) { - return true; - } + public function isRelationExists($relationName) + { + if ($this->getRelationClass($relationName) !== false) { + return true; + } - return false; - } + return false; + } - protected function getRelationClass($relationName) - { - $relationName = ucfirst($relationName); + protected function getRelationClass($relationName) + { + $relationName = ucfirst($relationName); - $className = '\Espo\Custom\Core\Utils\Database\Orm\Relations\\'.$relationName; - if (!class_exists($className)) { - $className = '\Espo\Core\Utils\Database\Orm\Relations\\'.$relationName; - } + $className = '\Espo\Custom\Core\Utils\Database\Orm\Relations\\'.$relationName; + if (!class_exists($className)) { + $className = '\Espo\Core\Utils\Database\Orm\Relations\\'.$relationName; + } - if (class_exists($className)) { - return $className; - } + if (class_exists($className)) { + return $className; + } - return false; - } + return false; + } - protected function isMethodExists($relationName) - { - $className = $this->getRelationClass($relationName); + protected function isMethodExists($relationName) + { + $className = $this->getRelationClass($relationName); - return method_exists($className, 'load'); - } + return method_exists($className, 'load'); + } - /** - * Get foreign Link - * - * @param string $parentLinkName - * @param array $parentLinkParams - * @param array $currentEntityDefs - * - * @return array - in format array('name', 'params') - */ - private function getForeignLink($parentLinkName, $parentLinkParams, $currentEntityDefs) - { - if (isset($parentLinkParams['foreign']) && isset($currentEntityDefs['links'][$parentLinkParams['foreign']])) { - return array( - 'name' => $parentLinkParams['foreign'], - 'params' => $currentEntityDefs['links'][$parentLinkParams['foreign']], - ); - } + /** + * Get foreign Link + * + * @param string $parentLinkName + * @param array $parentLinkParams + * @param array $currentEntityDefs + * + * @return array - in format array('name', 'params') + */ + private function getForeignLink($parentLinkName, $parentLinkParams, $currentEntityDefs) + { + if (isset($parentLinkParams['foreign']) && isset($currentEntityDefs['links'][$parentLinkParams['foreign']])) { + return array( + 'name' => $parentLinkParams['foreign'], + 'params' => $currentEntityDefs['links'][$parentLinkParams['foreign']], + ); + } - return false; - } + return false; + } - public function convert($linkName, $linkParams, $entityName, $ormMeta) - { - $entityDefs = $this->getEntityDefs(); + public function convert($linkName, $linkParams, $entityName, $ormMeta) + { + $entityDefs = $this->getEntityDefs(); - $foreignEntityName = $this->getLinkEntityName($entityName, $linkParams); - $foreignLink = $this->getForeignLink($linkName, $linkParams, $entityDefs[$foreignEntityName]); + $foreignEntityName = $this->getLinkEntityName($entityName, $linkParams); + $foreignLink = $this->getForeignLink($linkName, $linkParams, $entityDefs[$foreignEntityName]); - $currentType = $linkParams['type']; + $currentType = $linkParams['type']; - $method = $currentType; - if ($foreignLink !== false) { - $method .= '-'.$foreignLink['params']['type']; - } - $method = Util::toCamelCase($method); + $method = $currentType; + if ($foreignLink !== false) { + $method .= '-'.$foreignLink['params']['type']; + } + $method = Util::toCamelCase($method); - $relationName = $this->isRelationExists($method) ? $method /*hasManyHasMany*/ : $currentType /*hasMany*/; + $relationName = $this->isRelationExists($method) ? $method /*hasManyHasMany*/ : $currentType /*hasMany*/; - //relationDefs defined in separate file - if (isset($linkParams['relationName']) && $this->isMethodExists($linkParams['relationName'])) { - $className = $this->getRelationClass($linkParams['relationName']); - } else if ($this->isMethodExists($relationName)) { - $className = $this->getRelationClass($relationName); - } + //relationDefs defined in separate file + if (isset($linkParams['relationName']) && $this->isMethodExists($linkParams['relationName'])) { + $className = $this->getRelationClass($linkParams['relationName']); + } else if ($this->isMethodExists($relationName)) { + $className = $this->getRelationClass($relationName); + } - if (isset($className) && $className !== false) { - $helperClass = new $className($this->metadata, $ormMeta, $entityDefs); - return $helperClass->process($linkName, $entityName, $foreignLink['name'], $foreignEntityName); - } - //END: relationDefs defined in separate file + if (isset($className) && $className !== false) { + $helperClass = new $className($this->metadata, $ormMeta, $entityDefs); + return $helperClass->process($linkName, $entityName, $foreignLink['name'], $foreignEntityName); + } + //END: relationDefs defined in separate file - return null; - } + return null; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/Base.php b/application/Espo/Core/Utils/Database/Orm/Relations/Base.php index 5348e946f3..66c8ee5e9e 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/Base.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/Base.php @@ -24,128 +24,128 @@ namespace Espo\Core\Utils\Database\Orm\Relations; class Base extends \Espo\Core\Utils\Database\Orm\Base { - private $params; + private $params; - private $foreignParams; + private $foreignParams; - protected $foreignLinkName = null; - protected $foreignEntityName = null; + protected $foreignLinkName = null; + protected $foreignEntityName = null; - protected $allowedParams = array( - 'relationName', - 'conditions', - 'additionalColumns', - 'midKeys', - ); + protected $allowedParams = array( + 'relationName', + 'conditions', + 'additionalColumns', + 'midKeys', + ); - protected function getParams() - { - return $this->params; - } + protected function getParams() + { + return $this->params; + } - protected function getForeignParams() - { - return $this->foreignParams; - } + protected function getForeignParams() + { + return $this->foreignParams; + } - protected function setParams(array $params) - { - $this->params = $params; - } + protected function setParams(array $params) + { + $this->params = $params; + } - protected function setForeignParams(array $foreignParams) - { - $this->foreignParams = $foreignParams; - } + protected function setForeignParams(array $foreignParams) + { + $this->foreignParams = $foreignParams; + } - protected function setForeignLinkName($foreignLinkName) - { - $this->foreignLinkName = $foreignLinkName; - } + protected function setForeignLinkName($foreignLinkName) + { + $this->foreignLinkName = $foreignLinkName; + } - protected function getForeignLinkName() - { - return $this->foreignLinkName; - } + protected function getForeignLinkName() + { + return $this->foreignLinkName; + } - protected function setForeignEntityName($foreignEntityName) - { - $this->foreignEntityName = $foreignEntityName; - } + protected function setForeignEntityName($foreignEntityName) + { + $this->foreignEntityName = $foreignEntityName; + } - protected function getForeignEntityName() - { - return $this->foreignEntityName; - } + protected function getForeignEntityName() + { + return $this->foreignEntityName; + } - protected function getForeignLinkParams() - { - $foreignLinkName = $this->getForeignLinkName(); - $foreignEntityName = $this->getForeignEntityName(); - $foreignLinkParams = $this->getLinkParams($foreignLinkName, $foreignEntityName); + protected function getForeignLinkParams() + { + $foreignLinkName = $this->getForeignLinkName(); + $foreignEntityName = $this->getForeignEntityName(); + $foreignLinkParams = $this->getLinkParams($foreignLinkName, $foreignEntityName); - return $foreignLinkParams; - } + return $foreignLinkParams; + } - public function process($linkName, $entityName, $foreignLinkName, $foreignEntityName) - { - $inputs = array( - 'itemName' => $linkName, - 'entityName' => $entityName, - 'foreignLinkName' => $foreignLinkName, - 'foreignEntityName' => $foreignEntityName, - ); - $this->setMethods($inputs); + public function process($linkName, $entityName, $foreignLinkName, $foreignEntityName) + { + $inputs = array( + 'itemName' => $linkName, + 'entityName' => $entityName, + 'foreignLinkName' => $foreignLinkName, + 'foreignEntityName' => $foreignEntityName, + ); + $this->setMethods($inputs); - $convertedDefs = $this->load($linkName, $entityName); - $convertedDefs = $this->mergeAllowedParams($convertedDefs); + $convertedDefs = $this->load($linkName, $entityName); + $convertedDefs = $this->mergeAllowedParams($convertedDefs); - $inputs = $this->setArrayValue(null, $inputs); - $this->setMethods($inputs); + $inputs = $this->setArrayValue(null, $inputs); + $this->setMethods($inputs); - return $convertedDefs; - } + return $convertedDefs; + } - private function mergeAllowedParams($loads) - { - $linkName = $this->getLinkName(); - $entityName = $this->getEntityName(); + private function mergeAllowedParams($loads) + { + $linkName = $this->getLinkName(); + $entityName = $this->getEntityName(); - if (!empty($this->allowedParams)) { - $linkParams = &$loads[$entityName]['relations'][$linkName]; + if (!empty($this->allowedParams)) { + $linkParams = &$loads[$entityName]['relations'][$linkName]; - foreach ($this->allowedParams as $name) { + foreach ($this->allowedParams as $name) { - $additionalParrams = $this->getAllowedAdditionalParams($name); + $additionalParrams = $this->getAllowedAdditionalParams($name); - if (isset($additionalParrams) && !isset($linkParams[$name])) { - $linkParams[$name] = $additionalParrams; - } - } - } + if (isset($additionalParrams) && !isset($linkParams[$name])) { + $linkParams[$name] = $additionalParrams; + } + } + } - return $loads; - } + return $loads; + } - private function getAllowedAdditionalParams($allowedItemName) - { - $linkParams = $this->getLinkParams(); - $foreignLinkParams = $this->getForeignLinkParams(); + private function getAllowedAdditionalParams($allowedItemName) + { + $linkParams = $this->getLinkParams(); + $foreignLinkParams = $this->getForeignLinkParams(); - $itemLinkParams = isset($linkParams[$allowedItemName]) ? $linkParams[$allowedItemName] : null; - $itemForeignLinkParams = isset($foreignLinkParams[$allowedItemName]) ? $foreignLinkParams[$allowedItemName] : null; + $itemLinkParams = isset($linkParams[$allowedItemName]) ? $linkParams[$allowedItemName] : null; + $itemForeignLinkParams = isset($foreignLinkParams[$allowedItemName]) ? $foreignLinkParams[$allowedItemName] : null; - $additionalParrams = null; + $additionalParrams = null; - if (isset($itemLinkParams) && isset($itemForeignLinkParams)) { - $additionalParrams = Util::merge($itemLinkParams, $itemForeignLinkParams); - } else if (isset($itemLinkParams)) { - $additionalParrams = $itemLinkParams; - } else if (isset($itemForeignLinkParams)) { - $additionalParrams = $itemForeignLinkParams; - } + if (isset($itemLinkParams) && isset($itemForeignLinkParams)) { + $additionalParrams = Util::merge($itemLinkParams, $itemForeignLinkParams); + } else if (isset($itemLinkParams)) { + $additionalParrams = $itemLinkParams; + } else if (isset($itemForeignLinkParams)) { + $additionalParrams = $itemForeignLinkParams; + } - return $additionalParrams; - } + return $additionalParrams; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/BelongsTo.php b/application/Espo/Core/Utils/Database/Orm/Relations/BelongsTo.php index 1991ba3b14..6e2dd88dc4 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/BelongsTo.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/BelongsTo.php @@ -24,33 +24,33 @@ namespace Espo\Core\Utils\Database\Orm\Relations; class BelongsTo extends Base { - protected function load($linkName, $entityName) - { - $foreignEntityName = $this->getForeignEntityName(); + protected function load($linkName, $entityName) + { + $foreignEntityName = $this->getForeignEntityName(); - return array ( - $entityName => array ( - 'fields' => array( - $linkName.'Name' => array( - 'type' => 'foreign', - 'relation' => $linkName, - 'foreign' => $this->getForeignField('name', $foreignEntityName), - ), - $linkName.'Id' => array( - 'type' => 'foreignId', - 'index' => true, - ), - ), - 'relations' => array( - $linkName => array( - 'type' => 'belongsTo', - 'entity' => $foreignEntityName, - 'key' => $linkName.'Id', - 'foreignKey' => 'id', //???? - ), - ), - ), - ); - } + return array ( + $entityName => array ( + 'fields' => array( + $linkName.'Name' => array( + 'type' => 'foreign', + 'relation' => $linkName, + 'foreign' => $this->getForeignField('name', $foreignEntityName), + ), + $linkName.'Id' => array( + 'type' => 'foreignId', + 'index' => true, + ), + ), + 'relations' => array( + $linkName => array( + 'type' => 'belongsTo', + 'entity' => $foreignEntityName, + 'key' => $linkName.'Id', + 'foreignKey' => 'id', //???? + ), + ), + ), + ); + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/EmailEmailAddress.php b/application/Espo/Core/Utils/Database/Orm/Relations/EmailEmailAddress.php index 0349fab96b..c5de43f7e8 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/EmailEmailAddress.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/EmailEmailAddress.php @@ -24,28 +24,28 @@ namespace Espo\Core\Utils\Database\Orm\Relations; class EmailEmailAddress extends HasMany { - protected function load($linkName, $entityName) - { - $parentRelation = parent::load($linkName, $entityName); + protected function load($linkName, $entityName) + { + $parentRelation = parent::load($linkName, $entityName); - $foreignEntityName = $this->getForeignEntityName(); + $foreignEntityName = $this->getForeignEntityName(); - $relation = array( - $entityName => array ( - 'relations' => array( - $linkName => array( - 'midKeys' => array( - lcfirst($entityName).'Id', - lcfirst($foreignEntityName).'Id', - ), - ), - ), - ), - ); + $relation = array( + $entityName => array ( + 'relations' => array( + $linkName => array( + 'midKeys' => array( + lcfirst($entityName).'Id', + lcfirst($foreignEntityName).'Id', + ), + ), + ), + ), + ); - $relation = \Espo\Core\Utils\Util::merge($parentRelation, $relation); + $relation = \Espo\Core\Utils\Util::merge($parentRelation, $relation); - return $relation; - } + return $relation; + } } diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/EntityTeam.php b/application/Espo/Core/Utils/Database/Orm/Relations/EntityTeam.php index b387058e47..7f5f689995 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/EntityTeam.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/EntityTeam.php @@ -24,35 +24,35 @@ namespace Espo\Core\Utils\Database\Orm\Relations; class EntityTeam extends Base { - protected function load($linkName, $entityName) - { - $linkParams = $this->getLinkParams(); - $foreignEntityName = $this->getForeignEntityName(); + protected function load($linkName, $entityName) + { + $linkParams = $this->getLinkParams(); + $foreignEntityName = $this->getForeignEntityName(); - return array( - $entityName => array( - 'relations' => array( - $linkName => array( - 'type' => 'manyMany', - 'entity' => $foreignEntityName, - 'relationName' => lcfirst($linkParams['relationName']), - 'midKeys' => array( - 'entity_id', - 'team_id', - ), - 'conditions' => array( - 'entityType' => $entityName, - ), - 'additionalColumns' => array( - 'entityType' => array( - 'type' => 'varchar', - 'len' => 100, - ), - ), - ), - ), - ), - ); - } + return array( + $entityName => array( + 'relations' => array( + $linkName => array( + 'type' => 'manyMany', + 'entity' => $foreignEntityName, + 'relationName' => lcfirst($linkParams['relationName']), + 'midKeys' => array( + 'entity_id', + 'team_id', + ), + 'conditions' => array( + 'entityType' => $entityName, + ), + 'additionalColumns' => array( + 'entityType' => array( + 'type' => 'varchar', + 'len' => 100, + ), + ), + ), + ), + ), + ); + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/HasChildren.php b/application/Espo/Core/Utils/Database/Orm/Relations/HasChildren.php index cdc67ce6ce..486e0f448d 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/HasChildren.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/HasChildren.php @@ -24,34 +24,34 @@ namespace Espo\Core\Utils\Database\Orm\Relations; class HasChildren extends Base { - protected function load($linkName, $entityName) - { - $foreignLinkName = $this->getForeignLinkName(); - $foreignEntityName = $this->getForeignEntityName(); + protected function load($linkName, $entityName) + { + $foreignLinkName = $this->getForeignLinkName(); + $foreignEntityName = $this->getForeignEntityName(); - return array( - $entityName => array ( - 'fields' => array( - $linkName.'Ids' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - $linkName.'Names' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - ), - 'relations' => array( - $linkName => array( - 'type' => 'hasChildren', - 'entity' => $foreignEntityName, - 'foreignKey' => $foreignLinkName.'Id', - 'foreignType' => $foreignLinkName.'Type', - ), - ), - ), - ); - } + return array( + $entityName => array ( + 'fields' => array( + $linkName.'Ids' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + $linkName.'Names' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + ), + 'relations' => array( + $linkName => array( + 'type' => 'hasChildren', + 'entity' => $foreignEntityName, + 'foreignKey' => $foreignLinkName.'Id', + 'foreignType' => $foreignLinkName.'Type', + ), + ), + ), + ); + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/HasMany.php b/application/Espo/Core/Utils/Database/Orm/Relations/HasMany.php index be20d6d0ae..8e5b29e52a 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/HasMany.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/HasMany.php @@ -24,38 +24,38 @@ namespace Espo\Core\Utils\Database\Orm\Relations; class HasMany extends Base { - protected function load($linkName, $entityName) - { - $linkParams = $this->getLinkParams(); - $foreignLinkName = $this->getForeignLinkName(); - $foreignEntityName = $this->getForeignEntityName(); + protected function load($linkName, $entityName) + { + $linkParams = $this->getLinkParams(); + $foreignLinkName = $this->getForeignLinkName(); + $foreignEntityName = $this->getForeignEntityName(); - $relationType = isset($linkParams['relationName']) ? 'manyMany' : 'hasMany'; + $relationType = isset($linkParams['relationName']) ? 'manyMany' : 'hasMany'; - $relation = array( - $entityName => array ( - 'fields' => array( - $linkName.'Ids' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - $linkName.'Names' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - ), - 'relations' => array( - $linkName => array( - 'type' => $relationType, - 'entity' => $foreignEntityName, - 'foreignKey' => lcfirst($foreignLinkName.'Id'), - ), - ), - ), - ); + $relation = array( + $entityName => array ( + 'fields' => array( + $linkName.'Ids' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + $linkName.'Names' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + ), + 'relations' => array( + $linkName => array( + 'type' => $relationType, + 'entity' => $foreignEntityName, + 'foreignKey' => lcfirst($foreignLinkName.'Id'), + ), + ), + ), + ); return $relation; - } + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/ManyMany.php b/application/Espo/Core/Utils/Database/Orm/Relations/ManyMany.php index 0606901ffa..54e4e109a3 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/ManyMany.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/ManyMany.php @@ -26,56 +26,56 @@ use Espo\Core\Utils\Util; class ManyMany extends Base { - protected function load($linkName, $entityName) - { - $foreignEntityName = $this->getForeignEntityName(); + protected function load($linkName, $entityName) + { + $foreignEntityName = $this->getForeignEntityName(); - return array( - $entityName => array( - 'fields' => array( - $linkName.'Ids' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - $linkName.'Names' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - ), - 'relations' => array( - $linkName => array( - 'type' => 'manyMany', - 'entity' => $foreignEntityName, - 'relationName' => $this->getJoinTable($entityName, $foreignEntityName), - 'key' => 'id', //todo specify 'key' - 'foreignKey' => 'id', //todo specify 'foreignKey' - 'midKeys' => array( - lcfirst($entityName).'Id', - lcfirst($foreignEntityName).'Id', - ), - ), - ), - ), - ); - } + return array( + $entityName => array( + 'fields' => array( + $linkName.'Ids' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + $linkName.'Names' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + ), + 'relations' => array( + $linkName => array( + 'type' => 'manyMany', + 'entity' => $foreignEntityName, + 'relationName' => $this->getJoinTable($entityName, $foreignEntityName), + 'key' => 'id', //todo specify 'key' + 'foreignKey' => 'id', //todo specify 'foreignKey' + 'midKeys' => array( + lcfirst($entityName).'Id', + lcfirst($foreignEntityName).'Id', + ), + ), + ), + ), + ); + } - protected function getJoinTable($tableName1, $tableName2) - { - $tables = $this->getSortEntities($tableName1, $tableName2); + protected function getJoinTable($tableName1, $tableName2) + { + $tables = $this->getSortEntities($tableName1, $tableName2); - return Util::toCamelCase( implode('-', $tables) ); - } + return Util::toCamelCase( implode('-', $tables) ); + } protected function getSortEntities($entity1, $entity2) - { - $entities = array( - Util::toCamelCase(lcfirst($entity1)), - Util::toCamelCase(lcfirst($entity2)), - ); + { + $entities = array( + Util::toCamelCase(lcfirst($entity1)), + Util::toCamelCase(lcfirst($entity2)), + ); - sort($entities); + sort($entities); - return $entities; - } + return $entities; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/NoteAttachments.php b/application/Espo/Core/Utils/Database/Orm/Relations/NoteAttachments.php index fb937000a5..713a617ae1 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/NoteAttachments.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/NoteAttachments.php @@ -24,24 +24,24 @@ namespace Espo\Core\Utils\Database\Orm\Relations; class NoteAttachments extends HasChildren { - protected function load($linkName, $entityName) - { - $parentRelation = parent::load($linkName, $entityName); + protected function load($linkName, $entityName) + { + $parentRelation = parent::load($linkName, $entityName); - $relation = array( - $entityName => array ( - 'fields' => array( - $linkName.'Types' => array( - 'type' => 'varchar', - 'notStorable' => true, - ), - ), - ), - ); + $relation = array( + $entityName => array ( + 'fields' => array( + $linkName.'Types' => array( + 'type' => 'varchar', + 'notStorable' => true, + ), + ), + ), + ); - $relation = \Espo\Core\Utils\Util::merge($parentRelation, $relation); + $relation = \Espo\Core\Utils\Util::merge($parentRelation, $relation); - return $relation; - } + return $relation; + } } diff --git a/application/Espo/Core/Utils/Database/Schema/BaseRebuildActions.php b/application/Espo/Core/Utils/Database/Schema/BaseRebuildActions.php index 786aabec4e..b7afcf6b45 100644 --- a/application/Espo/Core/Utils/Database/Schema/BaseRebuildActions.php +++ b/application/Espo/Core/Utils/Database/Schema/BaseRebuildActions.php @@ -24,69 +24,69 @@ namespace Espo\Core\Utils\Database\Schema; abstract class BaseRebuildActions { - private $metadata; + private $metadata; - private $config; + private $config; - private $entityManager; - - protected $currentSchema = null; + private $entityManager; + + protected $currentSchema = null; - protected $metadataSchema = null; + protected $metadataSchema = null; - public function __construct(\Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\Config $config, \Espo\Core\ORM\EntityManager $entityManager) - { - $this->metadata = $metadata; - $this->config = $config; - $this->entityManager = $entityManager; - } - - protected function getEntityManager() - { - return $this->entityManager; - } - - protected function getConfig() - { - return $this->config; - } - - protected function getMetadata() - { - return $this->metadata; - } + public function __construct(\Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\Config $config, \Espo\Core\ORM\EntityManager $entityManager) + { + $this->metadata = $metadata; + $this->config = $config; + $this->entityManager = $entityManager; + } + + protected function getEntityManager() + { + return $this->entityManager; + } + + protected function getConfig() + { + return $this->config; + } + + protected function getMetadata() + { + return $this->metadata; + } - public function setCurrentSchema(\Doctrine\DBAL\Schema\Schema $currentSchema) - { - $this->currentSchema = $currentSchema; - } + public function setCurrentSchema(\Doctrine\DBAL\Schema\Schema $currentSchema) + { + $this->currentSchema = $currentSchema; + } - public function setMetadataSchema(\Doctrine\DBAL\Schema\Schema $metadataSchema) - { - $this->metadataSchema = $metadataSchema; - } + public function setMetadataSchema(\Doctrine\DBAL\Schema\Schema $metadataSchema) + { + $this->metadataSchema = $metadataSchema; + } - protected function getCurrentSchema() - { - return $this->currentSchema; - } + protected function getCurrentSchema() + { + return $this->currentSchema; + } - protected function getMetadataSchema() - { - return $this->metadataSchema; - } + protected function getMetadataSchema() + { + return $this->metadataSchema; + } - /* - public function beforeRebuild() - { - } + /* + public function beforeRebuild() + { + } - public function afterRebuild() - { - } - */ - - + public function afterRebuild() + { + } + */ + + } diff --git a/application/Espo/Core/Utils/Database/Schema/Converter.php b/application/Espo/Core/Utils/Database/Schema/Converter.php index b337f50340..aa6c741764 100644 --- a/application/Espo/Core/Utils/Database/Schema/Converter.php +++ b/application/Espo/Core/Utils/Database/Schema/Converter.php @@ -23,343 +23,343 @@ namespace Espo\Core\Utils\Database\Schema; use Espo\Core\Utils\Util, - Espo\ORM\Entity, - Espo\Core\Exceptions\Error; + Espo\ORM\Entity, + Espo\Core\Exceptions\Error; class Converter { - private $dbalSchema; - private $fileManager; + private $dbalSchema; + private $fileManager; - private $ormMeta = null; + private $ormMeta = null; - private $customTablePath = 'application/Espo/Core/Utils/Database/Schema/tables'; + private $customTablePath = 'application/Espo/Core/Utils/Database/Schema/tables'; - protected $typeList; + protected $typeList; - //pair ORM => doctrine - protected $allowedDbFieldParams = array( - 'len' => 'length', - 'default' => 'default', - 'notNull' => 'notnull', - 'autoincrement' => 'autoincrement', - 'unique' => 'unique', - ); + //pair ORM => doctrine + protected $allowedDbFieldParams = array( + 'len' => 'length', + 'default' => 'default', + 'notNull' => 'notnull', + 'autoincrement' => 'autoincrement', + 'unique' => 'unique', + ); - //todo: same array in Converters\Orm - protected $idParams = array( - 'dbType' => 'varchar', - 'len' => '24', - ); + //todo: same array in Converters\Orm + protected $idParams = array( + 'dbType' => 'varchar', + 'len' => '24', + ); - //todo: same array in Converters\Orm - protected $defaultLength = array( - 'varchar' => 255, - 'int' => 11, - ); + //todo: same array in Converters\Orm + protected $defaultLength = array( + 'varchar' => 255, + 'int' => 11, + ); - protected $notStorableTypes = array( - 'foreign' - ); + protected $notStorableTypes = array( + 'foreign' + ); - public function __construct(\Espo\Core\Utils\File\Manager $fileManager) - { - $this->fileManager = $fileManager; - - $this->dbalSchema = new \Espo\Core\Utils\Database\DBAL\Schema\Schema(); - - $this->typeList = array_keys(\Doctrine\DBAL\Types\Type::getTypesMap()); - } - - protected function getFileManager() - { - return $this->fileManager; - } - - protected function getSchema() - { - return $this->dbalSchema; - } + public function __construct(\Espo\Core\Utils\File\Manager $fileManager) + { + $this->fileManager = $fileManager; + + $this->dbalSchema = new \Espo\Core\Utils\Database\DBAL\Schema\Schema(); + + $this->typeList = array_keys(\Doctrine\DBAL\Types\Type::getTypesMap()); + } + + protected function getFileManager() + { + return $this->fileManager; + } + + protected function getSchema() + { + return $this->dbalSchema; + } - public function process(array $ormMeta, $entityDefs, $entityList = null) - { - $GLOBALS['log']->debug('Schema\Converter - Start: building schema'); + public function process(array $ormMeta, $entityDefs, $entityList = null) + { + $GLOBALS['log']->debug('Schema\Converter - Start: building schema'); - //check if exist files in "Tables" directory and merge with ormMetadata - $ormMeta = Util::merge($ormMeta, $this->getCustomTables()); - - //unset some keys in orm - if (isset($ormMeta['unset'])) { - $ormMeta = Util::unsetInArray($ormMeta, $ormMeta['unset']); - unset($ormMeta['unset']); - } //END: unset some keys in orm - - if (isset($entityList)) { - $entityList = is_string($entityList) ? (array) $entityList : $entityList; - - $dependentEntities = $this->getDependentEntities($entityList, $ormMeta); - $GLOBALS['log']->debug('Rebuild Database for entities: ['.implode(', ', $entityList).'] with dependent entities: ['.implode(', ', $dependentEntities).']'); - - $ormMeta = array_intersect_key($ormMeta, array_flip($dependentEntities)); - } - - $schema = $this->getSchema(); - - $tables = array(); - foreach ($ormMeta as $entityName => $entityParams) { - - $tableName = Util::toUnderScore($entityName); - - if ($schema->hasTable($tableName)) { - if (!isset($tables[$entityName])) { - $tables[$entityName] = $schema->getTable($tableName); - } - $GLOBALS['log']->debug('DBAL: Table ['.$tableName.'] exists.'); - continue; - } - - $tables[$entityName] = $schema->createTable($tableName); - - $primaryColumns = array(); - $uniqueColumns = array(); - $indexList = array(); //list of indexes like array( array(comlumn1, column2), array(column3)) - foreach ($entityParams['fields'] as $fieldName => $fieldParams) { - - if ((isset($fieldParams['notStorable']) && $fieldParams['notStorable']) || in_array($fieldParams['type'], $this->notStorableTypes)) { - continue; - } - - switch ($fieldParams['type']) { - case 'id': - $primaryColumns[] = Util::toUnderScore($fieldName); - break; - } - - $fieldType = isset($fieldParams['dbType']) ? $fieldParams['dbType'] : $fieldParams['type']; - $fieldType = strtolower($fieldType); /** doctrine uses strtolower for all field types */ - if (!in_array($fieldType, $this->typeList)) { - $GLOBALS['log']->debug('Converters\Schema::process(): Field type ['.$fieldType.'] does not exist '.$entityName.':'.$fieldName); - continue; - } - - $columnName = Util::toUnderScore($fieldName); - if (!$tables[$entityName]->hasColumn($columnName)) { - $tables[$entityName]->addColumn($columnName, $fieldType, $this->getDbFieldParams($fieldParams)); - } - - //add unique - if ($fieldParams['type']!= 'id' && isset($fieldParams['unique'])) { - $uniqueColumns = $this->getKeyList($columnName, $fieldParams['unique'], $uniqueColumns); - } //END: add unique - - //add index. It can be defined in entityDefs as "index" - if (isset($fieldParams['index'])) { - $indexList = $this->getKeyList($columnName, $fieldParams['index'], $indexList); - } //END: add index - } - - $tables[$entityName]->setPrimaryKey($primaryColumns); - if (!empty($indexList)) { - foreach($indexList as $indexItem) { - $tables[$entityName]->addIndex($indexItem); - } - } - - if (!empty($uniqueColumns)) { - foreach($uniqueColumns as $uniqueItem) { - $tables[$entityName]->addUniqueIndex($uniqueItem); - } - } - } - - //check and create columns/tables for relations - foreach ($ormMeta as $entityName => $entityParams) { - - if (!isset($entityParams['relations'])) { - continue; - } - - foreach ($entityParams['relations'] as $relationName => $relationParams) { - - switch ($relationParams['type']) { - case 'manyMany': - $tableName = $relationParams['relationName']; - - //check for duplication tables - if (!isset($tables[$tableName])) { //no needs to create the table if it already exists - $tables[$tableName] = $this->prepareManyMany($entityName, $relationParams, $tables); - } - break; - - case 'belongsTo': - $columnName = Util::toUnderScore($relationParams['key']); - $tables[$entityName]->addIndex(array($columnName)); - break; - } - } - } - //END: check and create columns/tables for relations - - $GLOBALS['log']->debug('Schema\Converter - End: building schema'); - - return $schema; - } - - /** - * Prepare a relation table for the manyMany relation - * - * @param string $entityName - * @param array $relationParams - * @param array $tables - * - * @return \Doctrine\DBAL\Schema\Table - */ - protected function prepareManyMany($entityName, $relationParams, $tables) - { - $tableName = Util::toUnderScore($relationParams['relationName']); - - if ($this->getSchema()->hasTable($tableName)) { - $GLOBALS['log']->debug('DBAL: Table ['.$tableName.'] exists.'); - return $this->getSchema()->getTable($tableName); - } - - $table = $this->getSchema()->createTable($tableName); - $table->addColumn('id', 'int', array('length'=>$this->defaultLength['int'], 'autoincrement' => true, 'notnull' => true,)); //'unique' => true, - - //add midKeys to a schema - foreach($relationParams['midKeys'] as $index => $midKey) { - - $usMidKey = Util::toUnderScore($midKey); - $table->addColumn($usMidKey, $this->idParams['dbType'], array('length'=>$this->idParams['len'])); - $table->addIndex(array($usMidKey)); - - } //END: add midKeys to a schema - - //add additionalColumns - if (isset($relationParams['additionalColumns'])) { - foreach($relationParams['additionalColumns'] as $fieldName => $fieldParams) { - - if (!isset($fieldParams['type'])) { - $fieldParams = array_merge($fieldParams, array( - 'type' => 'varchar', - 'length' => $this->defaultLength['varchar'], - )); - } - - $table->addColumn(Util::toUnderScore($fieldName), $fieldParams['type'], $this->getDbFieldParams($fieldParams)); - } - } //END: add additionalColumns - - - $table->addColumn('deleted', 'bool', array('default' => 0)); - $table->setPrimaryKey(array("id")); - - return $table; - } - - - protected function getDbFieldParams($fieldParams) - { - $dbFieldParams = array(); - - foreach($this->allowedDbFieldParams as $espoName => $dbalName) { - - if (isset($fieldParams[$espoName])) { - $dbFieldParams[$dbalName] = $fieldParams[$espoName]; - } - } - - switch ($fieldParams['type']) { - case 'array': - case 'jsonArray': - case 'text': - case 'longtext': - unset($dbFieldParams['default']); //for db type TEXT can't be defined a default value - break; - - case 'bool': - $dbFieldParams['default'] = intval($dbFieldParams['default']); - break; - } - - - if ( isset($fieldParams['autoincrement']) && $fieldParams['autoincrement'] ) { - $dbFieldParams['unique'] = true; - $dbFieldParams['notnull'] = true; - } - - return $dbFieldParams; - } - - /** - * Get key list (index, unique). Ex. index => true OR index => 'somename' - * @param string $columnName Column name (underscore field name) - * @param bool | string $keyValue - * @return array - */ - protected function getKeyList($columnName, $keyValue, array $keyList) - { - if ($keyValue === true) { - $keyList[] = array($columnName); - } else if (is_string($keyValue)) { - $keyList[$keyValue][] = $columnName; - } - - return $keyList; - } - - - /* - * @return array - ormMeta - */ - protected function getCustomTables() - { - $customTables = array(); + //check if exist files in "Tables" directory and merge with ormMetadata + $ormMeta = Util::merge($ormMeta, $this->getCustomTables()); + + //unset some keys in orm + if (isset($ormMeta['unset'])) { + $ormMeta = Util::unsetInArray($ormMeta, $ormMeta['unset']); + unset($ormMeta['unset']); + } //END: unset some keys in orm + + if (isset($entityList)) { + $entityList = is_string($entityList) ? (array) $entityList : $entityList; + + $dependentEntities = $this->getDependentEntities($entityList, $ormMeta); + $GLOBALS['log']->debug('Rebuild Database for entities: ['.implode(', ', $entityList).'] with dependent entities: ['.implode(', ', $dependentEntities).']'); + + $ormMeta = array_intersect_key($ormMeta, array_flip($dependentEntities)); + } + + $schema = $this->getSchema(); + + $tables = array(); + foreach ($ormMeta as $entityName => $entityParams) { + + $tableName = Util::toUnderScore($entityName); + + if ($schema->hasTable($tableName)) { + if (!isset($tables[$entityName])) { + $tables[$entityName] = $schema->getTable($tableName); + } + $GLOBALS['log']->debug('DBAL: Table ['.$tableName.'] exists.'); + continue; + } + + $tables[$entityName] = $schema->createTable($tableName); + + $primaryColumns = array(); + $uniqueColumns = array(); + $indexList = array(); //list of indexes like array( array(comlumn1, column2), array(column3)) + foreach ($entityParams['fields'] as $fieldName => $fieldParams) { + + if ((isset($fieldParams['notStorable']) && $fieldParams['notStorable']) || in_array($fieldParams['type'], $this->notStorableTypes)) { + continue; + } + + switch ($fieldParams['type']) { + case 'id': + $primaryColumns[] = Util::toUnderScore($fieldName); + break; + } + + $fieldType = isset($fieldParams['dbType']) ? $fieldParams['dbType'] : $fieldParams['type']; + $fieldType = strtolower($fieldType); /** doctrine uses strtolower for all field types */ + if (!in_array($fieldType, $this->typeList)) { + $GLOBALS['log']->debug('Converters\Schema::process(): Field type ['.$fieldType.'] does not exist '.$entityName.':'.$fieldName); + continue; + } + + $columnName = Util::toUnderScore($fieldName); + if (!$tables[$entityName]->hasColumn($columnName)) { + $tables[$entityName]->addColumn($columnName, $fieldType, $this->getDbFieldParams($fieldParams)); + } + + //add unique + if ($fieldParams['type']!= 'id' && isset($fieldParams['unique'])) { + $uniqueColumns = $this->getKeyList($columnName, $fieldParams['unique'], $uniqueColumns); + } //END: add unique + + //add index. It can be defined in entityDefs as "index" + if (isset($fieldParams['index'])) { + $indexList = $this->getKeyList($columnName, $fieldParams['index'], $indexList); + } //END: add index + } + + $tables[$entityName]->setPrimaryKey($primaryColumns); + if (!empty($indexList)) { + foreach($indexList as $indexItem) { + $tables[$entityName]->addIndex($indexItem); + } + } + + if (!empty($uniqueColumns)) { + foreach($uniqueColumns as $uniqueItem) { + $tables[$entityName]->addUniqueIndex($uniqueItem); + } + } + } + + //check and create columns/tables for relations + foreach ($ormMeta as $entityName => $entityParams) { + + if (!isset($entityParams['relations'])) { + continue; + } + + foreach ($entityParams['relations'] as $relationName => $relationParams) { + + switch ($relationParams['type']) { + case 'manyMany': + $tableName = $relationParams['relationName']; + + //check for duplication tables + if (!isset($tables[$tableName])) { //no needs to create the table if it already exists + $tables[$tableName] = $this->prepareManyMany($entityName, $relationParams, $tables); + } + break; + + case 'belongsTo': + $columnName = Util::toUnderScore($relationParams['key']); + $tables[$entityName]->addIndex(array($columnName)); + break; + } + } + } + //END: check and create columns/tables for relations + + $GLOBALS['log']->debug('Schema\Converter - End: building schema'); + + return $schema; + } + + /** + * Prepare a relation table for the manyMany relation + * + * @param string $entityName + * @param array $relationParams + * @param array $tables + * + * @return \Doctrine\DBAL\Schema\Table + */ + protected function prepareManyMany($entityName, $relationParams, $tables) + { + $tableName = Util::toUnderScore($relationParams['relationName']); + + if ($this->getSchema()->hasTable($tableName)) { + $GLOBALS['log']->debug('DBAL: Table ['.$tableName.'] exists.'); + return $this->getSchema()->getTable($tableName); + } + + $table = $this->getSchema()->createTable($tableName); + $table->addColumn('id', 'int', array('length'=>$this->defaultLength['int'], 'autoincrement' => true, 'notnull' => true,)); //'unique' => true, + + //add midKeys to a schema + foreach($relationParams['midKeys'] as $index => $midKey) { + + $usMidKey = Util::toUnderScore($midKey); + $table->addColumn($usMidKey, $this->idParams['dbType'], array('length'=>$this->idParams['len'])); + $table->addIndex(array($usMidKey)); + + } //END: add midKeys to a schema + + //add additionalColumns + if (isset($relationParams['additionalColumns'])) { + foreach($relationParams['additionalColumns'] as $fieldName => $fieldParams) { + + if (!isset($fieldParams['type'])) { + $fieldParams = array_merge($fieldParams, array( + 'type' => 'varchar', + 'length' => $this->defaultLength['varchar'], + )); + } + + $table->addColumn(Util::toUnderScore($fieldName), $fieldParams['type'], $this->getDbFieldParams($fieldParams)); + } + } //END: add additionalColumns + + + $table->addColumn('deleted', 'bool', array('default' => 0)); + $table->setPrimaryKey(array("id")); + + return $table; + } + + + protected function getDbFieldParams($fieldParams) + { + $dbFieldParams = array(); + + foreach($this->allowedDbFieldParams as $espoName => $dbalName) { + + if (isset($fieldParams[$espoName])) { + $dbFieldParams[$dbalName] = $fieldParams[$espoName]; + } + } + + switch ($fieldParams['type']) { + case 'array': + case 'jsonArray': + case 'text': + case 'longtext': + unset($dbFieldParams['default']); //for db type TEXT can't be defined a default value + break; + + case 'bool': + $dbFieldParams['default'] = intval($dbFieldParams['default']); + break; + } + + + if ( isset($fieldParams['autoincrement']) && $fieldParams['autoincrement'] ) { + $dbFieldParams['unique'] = true; + $dbFieldParams['notnull'] = true; + } + + return $dbFieldParams; + } + + /** + * Get key list (index, unique). Ex. index => true OR index => 'somename' + * @param string $columnName Column name (underscore field name) + * @param bool | string $keyValue + * @return array + */ + protected function getKeyList($columnName, $keyValue, array $keyList) + { + if ($keyValue === true) { + $keyList[] = array($columnName); + } else if (is_string($keyValue)) { + $keyList[$keyValue][] = $columnName; + } + + return $keyList; + } + + + /* + * @return array - ormMeta + */ + protected function getCustomTables() + { + $customTables = array(); - $fileList = $this->getFileManager()->getFileList($this->customTablePath, false, '\.php$', 'file'); + $fileList = $this->getFileManager()->getFileList($this->customTablePath, false, '\.php$', 'file'); - foreach($fileList as $fileName) { - $fileData = $this->getFileManager()->getContents( array($this->customTablePath, $fileName) ); - if (is_array($fileData)) { - $customTables = Util::merge($customTables, $fileData); - } - } + foreach($fileList as $fileName) { + $fileData = $this->getFileManager()->getContents( array($this->customTablePath, $fileName) ); + if (is_array($fileData)) { + $customTables = Util::merge($customTables, $fileData); + } + } - return $customTables; - } + return $customTables; + } - protected function getDependentEntities($entityList, $ormMeta, $dependentEntities = array()) - { - if (is_string($entityList)) { - $entityList = (array) $entityList; - } + protected function getDependentEntities($entityList, $ormMeta, $dependentEntities = array()) + { + if (is_string($entityList)) { + $entityList = (array) $entityList; + } - foreach ($entityList as $entityName) { + foreach ($entityList as $entityName) { - if (in_array($entityName, $dependentEntities)) { - continue; - } + if (in_array($entityName, $dependentEntities)) { + continue; + } - $dependentEntities[] = $entityName; + $dependentEntities[] = $entityName; - foreach ($ormMeta[$entityName]['relations'] as $relationName => $relationParams) { + foreach ($ormMeta[$entityName]['relations'] as $relationName => $relationParams) { - if (isset($relationParams['entity'])) { - $relationEntity = $relationParams['entity']; + if (isset($relationParams['entity'])) { + $relationEntity = $relationParams['entity']; - if (!in_array($relationEntity, $dependentEntities)) { - $dependentEntities = $this->getDependentEntities($relationEntity, $ormMeta, $dependentEntities); - } - } - } + if (!in_array($relationEntity, $dependentEntities)) { + $dependentEntities = $this->getDependentEntities($relationEntity, $ormMeta, $dependentEntities); + } + } + } - } + } - return $dependentEntities; - } + return $dependentEntities; + } } diff --git a/application/Espo/Core/Utils/Database/Schema/Schema.php b/application/Espo/Core/Utils/Database/Schema/Schema.php index e0e51249ec..3a4eddebce 100644 --- a/application/Espo/Core/Utils/Database/Schema/Schema.php +++ b/application/Espo/Core/Utils/Database/Schema/Schema.php @@ -23,282 +23,282 @@ namespace Espo\Core\Utils\Database\Schema; use Doctrine\DBAL\Types\Type, - Espo\Core\Utils\Util; + Espo\Core\Utils\Util; class Schema { - private $config; + private $config; - private $metadata; + private $metadata; - private $fileManager; + private $fileManager; - private $entityManager; + private $entityManager; - private $classParser; + private $classParser; - private $comparator; + private $comparator; - private $converter; + private $converter; - private $connection; + private $connection; - protected $drivers = array( - 'mysqli' => '\Espo\Core\Utils\Database\DBAL\Driver\Mysqli\Driver', - 'pdo_mysql' => '\Espo\Core\Utils\Database\DBAL\Driver\PDOMySql\Driver', - ); + protected $drivers = array( + 'mysqli' => '\Espo\Core\Utils\Database\DBAL\Driver\Mysqli\Driver', + 'pdo_mysql' => '\Espo\Core\Utils\Database\DBAL\Driver\PDOMySql\Driver', + ); - protected $fieldTypePaths = array( - 'application/Espo/Core/Utils/Database/DBAL/FieldTypes', - 'custom/Espo/Custom/Core/Utils/Database/DBAL/FieldTypes', - ); + protected $fieldTypePaths = array( + 'application/Espo/Core/Utils/Database/DBAL/FieldTypes', + 'custom/Espo/Custom/Core/Utils/Database/DBAL/FieldTypes', + ); - /** - * Paths of rebuild action folders - * @var array - */ - protected $rebuildActionsPath = array( - 'corePath' => 'application/Espo/Core/Utils/Database/Schema/rebuildActions', - 'customPath' => 'custom/Espo/Custom/Core/Utils/Database/Schema/rebuildActions', - ); + /** + * Paths of rebuild action folders + * @var array + */ + protected $rebuildActionsPath = array( + 'corePath' => 'application/Espo/Core/Utils/Database/Schema/rebuildActions', + 'customPath' => 'custom/Espo/Custom/Core/Utils/Database/Schema/rebuildActions', + ); - /** - * Array of rebuildActions classes in format: - * array( - * 'beforeRebuild' => array(...), - * 'afterRebuild' => array(...), - * ) - * @var array - */ - protected $rebuildActionClasses = null; + /** + * Array of rebuildActions classes in format: + * array( + * 'beforeRebuild' => array(...), + * 'afterRebuild' => array(...), + * ) + * @var array + */ + protected $rebuildActionClasses = null; - public function __construct(\Espo\Core\Utils\Config $config, \Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\ORM\EntityManager $entityManager, \Espo\Core\Utils\File\ClassParser $classParser) - { - $this->config = $config; - $this->metadata = $metadata; - $this->fileManager = $fileManager; - $this->entityManager = $entityManager; - $this->classParser = $classParser; + public function __construct(\Espo\Core\Utils\Config $config, \Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\ORM\EntityManager $entityManager, \Espo\Core\Utils\File\ClassParser $classParser) + { + $this->config = $config; + $this->metadata = $metadata; + $this->fileManager = $fileManager; + $this->entityManager = $entityManager; + $this->classParser = $classParser; - $this->comparator = new \Espo\Core\Utils\Database\DBAL\Schema\Comparator(); - $this->initFieldTypes(); + $this->comparator = new \Espo\Core\Utils\Database\DBAL\Schema\Comparator(); + $this->initFieldTypes(); - $this->converter = new \Espo\Core\Utils\Database\Converter($this->metadata, $this->fileManager); - } + $this->converter = new \Espo\Core\Utils\Database\Converter($this->metadata, $this->fileManager); + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - protected function getEntityManager() - { - return $this->entityManager; - } + protected function getEntityManager() + { + return $this->entityManager; + } - protected function getComparator() - { - return $this->comparator; - } + protected function getComparator() + { + return $this->comparator; + } - protected function getConverter() - { - return $this->converter; - } + protected function getConverter() + { + return $this->converter; + } - protected function getClassParser() - { - return $this->classParser; - } + protected function getClassParser() + { + return $this->classParser; + } - public function getPlatform() - { - return $this->getConnection()->getDatabasePlatform(); - } + public function getPlatform() + { + return $this->getConnection()->getDatabasePlatform(); + } - public function getConnection() - { - if (isset($this->connection)) { - return $this->connection; - } + public function getConnection() + { + if (isset($this->connection)) { + return $this->connection; + } - $dbalConfig = new \Doctrine\DBAL\Configuration(); + $dbalConfig = new \Doctrine\DBAL\Configuration(); - $connectionParams = $this->getConfig()->get('database'); + $connectionParams = $this->getConfig()->get('database'); - $connectionParams['driverClass'] = $this->drivers[ $connectionParams['driver'] ]; - unset($connectionParams['driver']); + $connectionParams['driverClass'] = $this->drivers[ $connectionParams['driver'] ]; + unset($connectionParams['driver']); - $this->connection = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $dbalConfig); + $this->connection = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $dbalConfig); - return $this->connection; - } + return $this->connection; + } - protected function initFieldTypes() - { - foreach($this->fieldTypePaths as $path) { + protected function initFieldTypes() + { + foreach($this->fieldTypePaths as $path) { - $typeList = $this->getFileManager()->getFileList($path, false, '\.php$'); - if ($typeList !== false) { - foreach($typeList as $name) { - $typeName = preg_replace('/\.php$/i', '', $name); - $dbalTypeName = strtolower($typeName); + $typeList = $this->getFileManager()->getFileList($path, false, '\.php$'); + if ($typeList !== false) { + foreach($typeList as $name) { + $typeName = preg_replace('/\.php$/i', '', $name); + $dbalTypeName = strtolower($typeName); - $filePath = Util::concatPath($path, $typeName); - $class = Util::getClassName($filePath); + $filePath = Util::concatPath($path, $typeName); + $class = Util::getClassName($filePath); - if( ! Type::hasType($dbalTypeName) ) { - Type::addType($dbalTypeName, $class); - } else { - Type::overrideType($dbalTypeName, $class); - } + if( ! Type::hasType($dbalTypeName) ) { + Type::addType($dbalTypeName, $class); + } else { + Type::overrideType($dbalTypeName, $class); + } - $dbTypeName = method_exists($class, 'getDbTypeName') ? $class::getDbTypeName() : $dbalTypeName; + $dbTypeName = method_exists($class, 'getDbTypeName') ? $class::getDbTypeName() : $dbalTypeName; - $this->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping($dbTypeName, $dbalTypeName); - } - } - } - } + $this->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping($dbTypeName, $dbalTypeName); + } + } + } + } - /* - * Rebuild database schema - */ - public function rebuild($entityList = null) - { - if ($this->getConverter()->process() === false) { - return false; - } + /* + * Rebuild database schema + */ + public function rebuild($entityList = null) + { + if ($this->getConverter()->process() === false) { + return false; + } - $currentSchema = $this->getCurrentSchema(); - $metadataSchema = $this->getConverter()->getSchemaFromMetadata($entityList); + $currentSchema = $this->getCurrentSchema(); + $metadataSchema = $this->getConverter()->getSchemaFromMetadata($entityList); - $this->initRebuildActions($currentSchema, $metadataSchema); - $this->executeRebuildActions('beforeRebuild'); + $this->initRebuildActions($currentSchema, $metadataSchema); + $this->executeRebuildActions('beforeRebuild'); - $queries = $this->getDiffSql($currentSchema, $metadataSchema); + $queries = $this->getDiffSql($currentSchema, $metadataSchema); - $result = true; - $connection = $this->getConnection(); - foreach ($queries as $sql) { - $GLOBALS['log']->debug('SCHEMA, Execute Query: '.$sql); - try { - $result &= (bool) $connection->executeQuery($sql); - } catch (\Exception $e) { - $GLOBALS['log']->alert('Rebuild database fault: '.$e); - $result = false; - } - } + $result = true; + $connection = $this->getConnection(); + foreach ($queries as $sql) { + $GLOBALS['log']->debug('SCHEMA, Execute Query: '.$sql); + try { + $result &= (bool) $connection->executeQuery($sql); + } catch (\Exception $e) { + $GLOBALS['log']->alert('Rebuild database fault: '.$e); + $result = false; + } + } - $this->executeRebuildActions('afterRebuild'); + $this->executeRebuildActions('afterRebuild'); - return (bool) $result; - } + return (bool) $result; + } - /* - * Get current database schema - * - * @return \Doctrine\DBAL\Schema\Schema - */ - protected function getCurrentSchema() - { - return $this->getConnection()->getSchemaManager()->createSchema(); - } + /* + * Get current database schema + * + * @return \Doctrine\DBAL\Schema\Schema + */ + protected function getCurrentSchema() + { + return $this->getConnection()->getSchemaManager()->createSchema(); + } - /* - * Get SQL queries of database schema - * - * @params \Doctrine\DBAL\Schema\Schema $schema - * - * @return array - array of SQL queries - */ - public function toSql(\Doctrine\DBAL\Schema\SchemaDiff $schema) //Doctrine\DBAL\Schema\SchemaDiff | \Doctrine\DBAL\Schema\Schema - { - return $schema->toSaveSql($this->getPlatform()); - //return $schema->toSql($this->getPlatform()); //it can return with DROP TABLE - } + /* + * Get SQL queries of database schema + * + * @params \Doctrine\DBAL\Schema\Schema $schema + * + * @return array - array of SQL queries + */ + public function toSql(\Doctrine\DBAL\Schema\SchemaDiff $schema) //Doctrine\DBAL\Schema\SchemaDiff | \Doctrine\DBAL\Schema\Schema + { + return $schema->toSaveSql($this->getPlatform()); + //return $schema->toSql($this->getPlatform()); //it can return with DROP TABLE + } - /* - * Get SQL queries to get from one to another schema - * - * @return array - array of SQL queries - */ - public function getDiffSql(\Doctrine\DBAL\Schema\Schema $fromSchema, \Doctrine\DBAL\Schema\Schema $toSchema) - { - $schemaDiff = $this->getComparator()->compare($fromSchema, $toSchema); + /* + * Get SQL queries to get from one to another schema + * + * @return array - array of SQL queries + */ + public function getDiffSql(\Doctrine\DBAL\Schema\Schema $fromSchema, \Doctrine\DBAL\Schema\Schema $toSchema) + { + $schemaDiff = $this->getComparator()->compare($fromSchema, $toSchema); - return $this->toSql($schemaDiff); //$schemaDiff->toSql($this->getPlatform()); - } + return $this->toSql($schemaDiff); //$schemaDiff->toSql($this->getPlatform()); + } - /** - * Init Rebuild Actions, get all classes and create them - * @return void - */ - protected function initRebuildActions($currentSchema = null, $metadataSchema = null) - { - $methods = array('beforeRebuild', 'afterRebuild'); + /** + * Init Rebuild Actions, get all classes and create them + * @return void + */ + protected function initRebuildActions($currentSchema = null, $metadataSchema = null) + { + $methods = array('beforeRebuild', 'afterRebuild'); - $this->getClassParser()->setAllowedMethods($methods); - $rebuildActions = $this->getClassParser()->getData($this->rebuildActionsPath); + $this->getClassParser()->setAllowedMethods($methods); + $rebuildActions = $this->getClassParser()->getData($this->rebuildActionsPath); - $classes = array(); - foreach ($rebuildActions as $actionName => $actionClass) { - $rebuildActionClass = new $actionClass($this->metadata, $this->config, $this->entityManager); - if (isset($currentSchema)) { - $rebuildActionClass->setCurrentSchema($currentSchema); - } - if (isset($metadataSchema)) { - $rebuildActionClass->setMetadataSchema($metadataSchema); - } + $classes = array(); + foreach ($rebuildActions as $actionName => $actionClass) { + $rebuildActionClass = new $actionClass($this->metadata, $this->config, $this->entityManager); + if (isset($currentSchema)) { + $rebuildActionClass->setCurrentSchema($currentSchema); + } + if (isset($metadataSchema)) { + $rebuildActionClass->setMetadataSchema($metadataSchema); + } - foreach ($methods as $methodName) { - if (method_exists($rebuildActionClass, $methodName)) { - $classes[$methodName][] = $rebuildActionClass; - } - } - } + foreach ($methods as $methodName) { + if (method_exists($rebuildActionClass, $methodName)) { + $classes[$methodName][] = $rebuildActionClass; + } + } + } - $this->rebuildActionClasses = $classes; - } + $this->rebuildActionClasses = $classes; + } - /** - * Execute actions for RebuildAction classes - * @param string $action action name, possible values 'beforeRebuild' | 'afterRebuild' - * @return void - */ - protected function executeRebuildActions($action = 'beforeRebuild') - { - if (!isset($this->rebuildActionClasses)) { - $this->initRebuildActions(); - } + /** + * Execute actions for RebuildAction classes + * @param string $action action name, possible values 'beforeRebuild' | 'afterRebuild' + * @return void + */ + protected function executeRebuildActions($action = 'beforeRebuild') + { + if (!isset($this->rebuildActionClasses)) { + $this->initRebuildActions(); + } - if (isset($this->rebuildActionClasses[$action])) { - foreach ($this->rebuildActionClasses[$action] as $rebuildActionClass) { - $rebuildActionClass->$action(); - } - } - } + if (isset($this->rebuildActionClasses[$action])) { + foreach ($this->rebuildActionClasses[$action] as $rebuildActionClass) { + $rebuildActionClass->$action(); + } + } + } } diff --git a/application/Espo/Core/Utils/Database/Schema/rebuildActions/AddSystemUser.php b/application/Espo/Core/Utils/Database/Schema/rebuildActions/AddSystemUser.php index 5bfc2cba15..0c618fd520 100644 --- a/application/Espo/Core/Utils/Database/Schema/rebuildActions/AddSystemUser.php +++ b/application/Espo/Core/Utils/Database/Schema/rebuildActions/AddSystemUser.php @@ -24,23 +24,23 @@ namespace Espo\Core\Utils\Database\Schema\rebuildActions; class AddSystemUser extends \Espo\Core\Utils\Database\Schema\BaseRebuildActions { - - public function afterRebuild() - { - $userId = $this->getConfig()->get('systemUser.id'); + + public function afterRebuild() + { + $userId = $this->getConfig()->get('systemUser.id'); - $entity = $this->getEntityManager()->getEntity('User', $userId); + $entity = $this->getEntityManager()->getEntity('User', $userId); - if (!isset($entity)) { + if (!isset($entity)) { - $systemUser = $this->getConfig()->get('systemUser'); + $systemUser = $this->getConfig()->get('systemUser'); - $entity = $this->getEntityManager()->getEntity('User'); - $entity->set($systemUser); + $entity = $this->getEntityManager()->getEntity('User'); + $entity->set($systemUser); - return $this->getEntityManager()->saveEntity($entity); - } - } - + return $this->getEntityManager()->saveEntity($entity); + } + } + } diff --git a/application/Espo/Core/Utils/Database/Schema/rebuildActions/Currency.php b/application/Espo/Core/Utils/Database/Schema/rebuildActions/Currency.php index d6aed5179d..b5e030d360 100644 --- a/application/Espo/Core/Utils/Database/Schema/rebuildActions/Currency.php +++ b/application/Espo/Core/Utils/Database/Schema/rebuildActions/Currency.php @@ -25,60 +25,60 @@ namespace Espo\Core\Utils\Database\Schema\rebuildActions; class Currency extends \Espo\Core\Utils\Database\Schema\BaseRebuildActions { - public function afterRebuild() - { - $defaultCurrency = $this->getConfig()->get('defaultCurrency'); + public function afterRebuild() + { + $defaultCurrency = $this->getConfig()->get('defaultCurrency'); - $baseCurrency = $this->getConfig()->get('baseCurrency'); - $currencyRates = $this->getConfig()->get('currencyRates'); + $baseCurrency = $this->getConfig()->get('baseCurrency'); + $currencyRates = $this->getConfig()->get('currencyRates'); - if ($defaultCurrency != $baseCurrency) { - $currencyRates = $this->exchangeRates($baseCurrency, $defaultCurrency, $currencyRates); - } + if ($defaultCurrency != $baseCurrency) { + $currencyRates = $this->exchangeRates($baseCurrency, $defaultCurrency, $currencyRates); + } - $currencyRates[$defaultCurrency] = '1.00'; + $currencyRates[$defaultCurrency] = '1.00'; - $pdo = $this->getEntityManager()->getPDO(); + $pdo = $this->getEntityManager()->getPDO(); - $sql = "TRUNCATE `currency`"; - $pdo->prepare($sql)->execute(); + $sql = "TRUNCATE `currency`"; + $pdo->prepare($sql)->execute(); - foreach ($currencyRates as $currencyName => $rate) { + foreach ($currencyRates as $currencyName => $rate) { - $sql = " - INSERT INTO `currency` - (id, rate) - VALUES - (".$pdo->quote($currencyName) . ", " . $pdo->quote($rate) . ") - "; - $pdo->prepare($sql)->execute(); - } - } + $sql = " + INSERT INTO `currency` + (id, rate) + VALUES + (".$pdo->quote($currencyName) . ", " . $pdo->quote($rate) . ") + "; + $pdo->prepare($sql)->execute(); + } + } - /** - * Calculate exchange rates if defaultCurrency doesn't equals baseCurrency - * - * @param string $baseCurrency - * @param string $defaultCurrency - * @param array $currencyRates [description] - * @return array - List of new currency rates - */ - protected function exchangeRates($baseCurrency, $defaultCurrency, array $currencyRates) - { - $precision = 5; - $defaultCurrencyRate = round(1 / $currencyRates[$defaultCurrency], $precision); + /** + * Calculate exchange rates if defaultCurrency doesn't equals baseCurrency + * + * @param string $baseCurrency + * @param string $defaultCurrency + * @param array $currencyRates [description] + * @return array - List of new currency rates + */ + protected function exchangeRates($baseCurrency, $defaultCurrency, array $currencyRates) + { + $precision = 5; + $defaultCurrencyRate = round(1 / $currencyRates[$defaultCurrency], $precision); - $exchangedRates = array(); - $exchangedRates[$baseCurrency] = $defaultCurrencyRate; + $exchangedRates = array(); + $exchangedRates[$baseCurrency] = $defaultCurrencyRate; - unset($currencyRates[$baseCurrency], $currencyRates[$defaultCurrency]); + unset($currencyRates[$baseCurrency], $currencyRates[$defaultCurrency]); - foreach ($currencyRates as $currencyName => $rate) { - $exchangedRates[$currencyName] = round($rate * $defaultCurrencyRate, $precision); - } + foreach ($currencyRates as $currencyName => $rate) { + $exchangedRates[$currencyName] = round($rate * $defaultCurrencyRate, $precision); + } - return $exchangedRates; - } + return $exchangedRates; + } } diff --git a/application/Espo/Core/Utils/Database/Schema/tables/preferences.php b/application/Espo/Core/Utils/Database/Schema/tables/preferences.php index 50e4c0560d..ef661452e3 100644 --- a/application/Espo/Core/Utils/Database/Schema/tables/preferences.php +++ b/application/Espo/Core/Utils/Database/Schema/tables/preferences.php @@ -20,11 +20,11 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ -return array( +return array( - 'unset' => array( - 'Preferences', - ), + 'unset' => array( + 'Preferences', + ), ); diff --git a/application/Espo/Core/Utils/Database/Schema/tables/settings.php b/application/Espo/Core/Utils/Database/Schema/tables/settings.php index d5a0c366fd..be2b892cb9 100644 --- a/application/Espo/Core/Utils/Database/Schema/tables/settings.php +++ b/application/Espo/Core/Utils/Database/Schema/tables/settings.php @@ -20,11 +20,11 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ -return array( +return array( - 'unset' => array( - 'Settings', - ), + 'unset' => array( + 'Settings', + ), ); diff --git a/application/Espo/Core/Utils/Database/Schema/tables/subscription.php b/application/Espo/Core/Utils/Database/Schema/tables/subscription.php index 43cef1ae42..157530d161 100644 --- a/application/Espo/Core/Utils/Database/Schema/tables/subscription.php +++ b/application/Espo/Core/Utils/Database/Schema/tables/subscription.php @@ -22,32 +22,32 @@ return array( - 'Subscription' => array( - 'fields' => array( - 'id' => array( - 'type' => 'id', - 'dbType' => 'int', - 'len' => '11', - 'autoincrement' => true, - 'unique' => true, - ), - 'entityId' => array( - 'type' => 'varchar', - 'len' => '24', - 'index' => 'entity', - ), - 'entityType' => array( - 'type' => 'varchar', - 'len' => '100', - 'index' => 'entity', - ), - 'userId' => array( - 'type' => 'varchar', - 'len' => '24', - 'index' => true, - ), - ), - ), + 'Subscription' => array( + 'fields' => array( + 'id' => array( + 'type' => 'id', + 'dbType' => 'int', + 'len' => '11', + 'autoincrement' => true, + 'unique' => true, + ), + 'entityId' => array( + 'type' => 'varchar', + 'len' => '24', + 'index' => 'entity', + ), + 'entityType' => array( + 'type' => 'varchar', + 'len' => '100', + 'index' => 'entity', + ), + 'userId' => array( + 'type' => 'varchar', + 'len' => '24', + 'index' => true, + ), + ), + ), ); diff --git a/application/Espo/Core/Utils/DateTime.php b/application/Espo/Core/Utils/DateTime.php index b406c678e6..ee15ef8f99 100644 --- a/application/Espo/Core/Utils/DateTime.php +++ b/application/Espo/Core/Utils/DateTime.php @@ -24,60 +24,60 @@ namespace Espo\Core\Utils; class DateTime { - protected $dataFormat; - - protected $timeFormat; - - protected $timezone; - - protected $dateFormats = array( - 'MM/DD/YYYY' => 'm/d/Y', - 'YYYY-MM-DD' => 'Y-m-d', - 'DD.MM.YYYY' => 'd.m.Y', - ); - - protected $timeFormats = array( - 'HH:mm' => 'H:i', - 'hh:mm A' => 'h:i A', - 'hh:mm a' => 'h:ia', - 'hh:mmA' => 'h:iA', - ); - - public function __construct($dateFormat = 'YYYY-MM-DD', $timeFormat = 'HH:mm', $timeZone = 'UTC') - { - $this->dateFormat = $dateFormat; - $this->timeFormat = $timeFormat; - - $this->timezone = new \DateTimeZone($timeZone); - } - - protected function getPhpDateFormat() - { - return $this->dateFormats[$this->dateFormat]; - } - - protected function getPhpDateTimeFormat() - { - return $this->dateFormats[$this->dateFormat] . ' ' . $this->timeFormats[$this->timeFormat]; - } - - public function convertSystemDateToGlobal($string) - { - $dateTime = \DateTime::createFromFormat('Y-m-d', $string); - if ($dateTime) { - return $dateTime->format($this->getPhpDateFormat()); - } - return null; - } - - public function convertSystemDateTimeToGlobal($string) - { - $dateTime = \DateTime::createFromFormat('Y-m-d H:i:s', $string); - if ($dateTime) { - return $dateTime->setTimezone($this->timezone)->format($this->getPhpDateTimeFormat()); - } - return null; - } + protected $dataFormat; + + protected $timeFormat; + + protected $timezone; + + protected $dateFormats = array( + 'MM/DD/YYYY' => 'm/d/Y', + 'YYYY-MM-DD' => 'Y-m-d', + 'DD.MM.YYYY' => 'd.m.Y', + ); + + protected $timeFormats = array( + 'HH:mm' => 'H:i', + 'hh:mm A' => 'h:i A', + 'hh:mm a' => 'h:ia', + 'hh:mmA' => 'h:iA', + ); + + public function __construct($dateFormat = 'YYYY-MM-DD', $timeFormat = 'HH:mm', $timeZone = 'UTC') + { + $this->dateFormat = $dateFormat; + $this->timeFormat = $timeFormat; + + $this->timezone = new \DateTimeZone($timeZone); + } + + protected function getPhpDateFormat() + { + return $this->dateFormats[$this->dateFormat]; + } + + protected function getPhpDateTimeFormat() + { + return $this->dateFormats[$this->dateFormat] . ' ' . $this->timeFormats[$this->timeFormat]; + } + + public function convertSystemDateToGlobal($string) + { + $dateTime = \DateTime::createFromFormat('Y-m-d', $string); + if ($dateTime) { + return $dateTime->format($this->getPhpDateFormat()); + } + return null; + } + + public function convertSystemDateTimeToGlobal($string) + { + $dateTime = \DateTime::createFromFormat('Y-m-d H:i:s', $string); + if ($dateTime) { + return $dateTime->setTimezone($this->timezone)->format($this->getPhpDateTimeFormat()); + } + return null; + } } diff --git a/application/Espo/Core/Utils/FieldManager.php b/application/Espo/Core/Utils/FieldManager.php index 8ccae1fcdb..27cc6e1730 100644 --- a/application/Espo/Core/Utils/FieldManager.php +++ b/application/Espo/Core/Utils/FieldManager.php @@ -23,243 +23,243 @@ namespace Espo\Core\Utils; use \Espo\Core\Exceptions\Error, - \Espo\Core\Exceptions\Conflict; + \Espo\Core\Exceptions\Conflict; class FieldManager { - private $metadata; + private $metadata; - private $language; + private $language; - private $metadataUtils; + private $metadataUtils; - protected $isChanged = null; + protected $isChanged = null; - protected $metadataType = 'entityDefs'; + protected $metadataType = 'entityDefs'; - protected $customOptionName = 'isCustom'; + protected $customOptionName = 'isCustom'; - public function __construct(Metadata $metadata, Language $language) - { - $this->metadata = $metadata; - $this->language = $language; + public function __construct(Metadata $metadata, Language $language) + { + $this->metadata = $metadata; + $this->language = $language; - $this->metadataUtils = new \Espo\Core\Utils\Metadata\Utils($this->metadata); - } + $this->metadataUtils = new \Espo\Core\Utils\Metadata\Utils($this->metadata); + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - protected function getLanguage() - { - return $this->language; - } + protected function getLanguage() + { + return $this->language; + } - protected function getMetadataUtils() - { - return $this->metadataUtils; - } + protected function getMetadataUtils() + { + return $this->metadataUtils; + } - public function read($name, $scope) - { - $fieldDef = $this->getFieldDef($name, $scope); + public function read($name, $scope) + { + $fieldDef = $this->getFieldDef($name, $scope); - $fieldDef['label'] = $this->getLanguage()->translate($name, 'fields', $scope); + $fieldDef['label'] = $this->getLanguage()->translate($name, 'fields', $scope); - return $fieldDef; - } + return $fieldDef; + } - public function create($name, $fieldDef, $scope) - { - $existingField = $this->getFieldDef($name, $scope); - if (isset($existingField)) { - throw new Conflict('Field ['.$name.'] exists in '.$scope); - } + public function create($name, $fieldDef, $scope) + { + $existingField = $this->getFieldDef($name, $scope); + if (isset($existingField)) { + throw new Conflict('Field ['.$name.'] exists in '.$scope); + } - return $this->update($name, $fieldDef, $scope); - } + return $this->update($name, $fieldDef, $scope); + } - public function update($name, $fieldDef, $scope) - { - /*Add option to metadata to identify the custom field*/ - if (!$this->isCore($name, $scope)) { - $fieldDef[$this->customOptionName] = true; - } + public function update($name, $fieldDef, $scope) + { + /*Add option to metadata to identify the custom field*/ + if (!$this->isCore($name, $scope)) { + $fieldDef[$this->customOptionName] = true; + } - $res = true; - if (isset($fieldDef['label'])) { - $res &= $this->setLabel($name, $fieldDef['label'], $scope); - } + $res = true; + if (isset($fieldDef['label'])) { + $res &= $this->setLabel($name, $fieldDef['label'], $scope); + } - if ($this->isDefsChanged($name, $fieldDef, $scope)) { - $res &= $this->setEntityDefs($name, $fieldDef, $scope); - } + if ($this->isDefsChanged($name, $fieldDef, $scope)) { + $res &= $this->setEntityDefs($name, $fieldDef, $scope); + } - return (bool) $res; - } + return (bool) $res; + } - public function delete($name, $scope) - { - if ($this->isCore($name, $scope)) { - throw new Error('Cannot delete core field ['.$name.'] in '.$scope); - } + public function delete($name, $scope) + { + if ($this->isCore($name, $scope)) { + throw new Error('Cannot delete core field ['.$name.'] in '.$scope); + } - $unsets = array( - 'fields.'.$name, - 'links.'.$name, - ); + $unsets = array( + 'fields.'.$name, + 'links.'.$name, + ); - $res = $this->getMetadata()->delete($unsets, $this->metadataType, $scope); + $res = $this->getMetadata()->delete($unsets, $this->metadataType, $scope); - $this->deleteLabel($name, $scope); + $this->deleteLabel($name, $scope); - return $res; - } + return $res; + } - protected function setEntityDefs($name, $fieldDef, $scope) - { - $fieldDef = $this->normalizeDefs($name, $fieldDef, $scope); + protected function setEntityDefs($name, $fieldDef, $scope) + { + $fieldDef = $this->normalizeDefs($name, $fieldDef, $scope); - $data = Json::encode($fieldDef); - $res = $this->getMetadata()->set($data, $this->metadataType, $scope); + $data = Json::encode($fieldDef); + $res = $this->getMetadata()->set($data, $this->metadataType, $scope); - return $res; - } + return $res; + } - protected function setLabel($name, $value, $scope) - { - return $this->getLanguage()->set($name, $value, 'fields', $scope); - } + protected function setLabel($name, $value, $scope) + { + return $this->getLanguage()->set($name, $value, 'fields', $scope); + } - protected function deleteLabel($name, $scope) - { - return $this->getLanguage()->delete($name, 'fields', $scope); - } + protected function deleteLabel($name, $scope) + { + return $this->getLanguage()->delete($name, 'fields', $scope); + } - protected function getFieldDef($name, $scope) - { - return $this->getMetadata()->get($this->metadataType.'.'.$scope.'.fields.'.$name); - } + protected function getFieldDef($name, $scope) + { + return $this->getMetadata()->get($this->metadataType.'.'.$scope.'.fields.'.$name); + } - protected function getLinkDef($name, $scope) - { - return $this->getMetadata()->get($this->metadataType.'.'.$scope.'.links.'.$name); - } + protected function getLinkDef($name, $scope) + { + return $this->getMetadata()->get($this->metadataType.'.'.$scope.'.links.'.$name); + } - /** - * Prepare input fieldDefs, remove unnecessary fields - * - * @param string $fieldName - * @param array $fieldDef - * @param string $scope - * @return array - */ - protected function prepareFieldDef($name, $fieldDef, $scope) - { - $unnecessaryFields = array( - 'name', - 'label', - ); + /** + * Prepare input fieldDefs, remove unnecessary fields + * + * @param string $fieldName + * @param array $fieldDef + * @param string $scope + * @return array + */ + protected function prepareFieldDef($name, $fieldDef, $scope) + { + $unnecessaryFields = array( + 'name', + 'label', + ); - foreach ($unnecessaryFields as $fieldName) { - if (isset($fieldDef[$fieldName])) { - unset($fieldDef[$fieldName]); - } - } + foreach ($unnecessaryFields as $fieldName) { + if (isset($fieldDef[$fieldName])) { + unset($fieldDef[$fieldName]); + } + } - if (isset($fieldDef['linkDefs'])) { - $linkDefs = $fieldDef['linkDefs']; - unset($fieldDef['linkDefs']); - } + if (isset($fieldDef['linkDefs'])) { + $linkDefs = $fieldDef['linkDefs']; + unset($fieldDef['linkDefs']); + } - $currentOptionList = array_keys((array) $this->getFieldDef($name, $scope)); - foreach ($fieldDef as $defName => $defValue) { - if ( (!isset($defValue) || $defValue === '') && !in_array($defName, $currentOptionList) ) { - unset($fieldDef[$defName]); - } - } + $currentOptionList = array_keys((array) $this->getFieldDef($name, $scope)); + foreach ($fieldDef as $defName => $defValue) { + if ( (!isset($defValue) || $defValue === '') && !in_array($defName, $currentOptionList) ) { + unset($fieldDef[$defName]); + } + } - return $fieldDef; - } + return $fieldDef; + } - /** - * Add all needed block for a field defenition - * - * @param string $fieldName - * @param array $fieldDef - * @param string $scope - * @return array - */ - protected function normalizeDefs($fieldName, array $fieldDef, $scope) - { - $fieldDef = $this->prepareFieldDef($fieldName, $fieldDef, $scope); + /** + * Add all needed block for a field defenition + * + * @param string $fieldName + * @param array $fieldDef + * @param string $scope + * @return array + */ + protected function normalizeDefs($fieldName, array $fieldDef, $scope) + { + $fieldDef = $this->prepareFieldDef($fieldName, $fieldDef, $scope); - $metaFieldDef = $this->getMetadataUtils()->getFieldDefsInFieldMeta($fieldDef); - if (isset($metaFieldDef)) { - $fieldDef = Util::merge($metaFieldDef, $fieldDef); - } + $metaFieldDef = $this->getMetadataUtils()->getFieldDefsInFieldMeta($fieldDef); + if (isset($metaFieldDef)) { + $fieldDef = Util::merge($metaFieldDef, $fieldDef); + } - $defs = array( - 'fields' => array( - $fieldName => $fieldDef, - ), - ); + $defs = array( + 'fields' => array( + $fieldName => $fieldDef, + ), + ); - /** Save links for a field. */ - $metaLinkDef = $this->getMetadataUtils()->getLinkDefsInFieldMeta($scope, $fieldDef); - if (isset($linkDefs) || isset($metaLinkDef)) { - $linkDefs = Util::merge((array) $metaLinkDef, (array) $linkDefs); - $defs['links'] = array( - $fieldName => $linkDefs, - ); - } + /** Save links for a field. */ + $metaLinkDef = $this->getMetadataUtils()->getLinkDefsInFieldMeta($scope, $fieldDef); + if (isset($linkDefs) || isset($metaLinkDef)) { + $linkDefs = Util::merge((array) $metaLinkDef, (array) $linkDefs); + $defs['links'] = array( + $fieldName => $linkDefs, + ); + } - return $defs; - } + return $defs; + } - /** - * Check if changed metadata defenition for a field except 'label' - * - * @return boolean - */ - protected function isDefsChanged($name, $fieldDef, $scope) - { - $fieldDef = $this->prepareFieldDef($name, $fieldDef, $scope); - $currentFieldDef = $this->getFieldDef($name, $scope); + /** + * Check if changed metadata defenition for a field except 'label' + * + * @return boolean + */ + protected function isDefsChanged($name, $fieldDef, $scope) + { + $fieldDef = $this->prepareFieldDef($name, $fieldDef, $scope); + $currentFieldDef = $this->getFieldDef($name, $scope); - $this->isChanged = Util::isEquals($fieldDef, $currentFieldDef) ? false : true; + $this->isChanged = Util::isEquals($fieldDef, $currentFieldDef) ? false : true; - return $this->isChanged; - } + return $this->isChanged; + } - /** - * Only for update method - * - * @return boolean - */ - public function isChanged() - { - return $this->isChanged; - } + /** + * Only for update method + * + * @return boolean + */ + public function isChanged() + { + return $this->isChanged; + } - /** - * Check if a field is core field - * - * @param string $name - * @param string $scope - * @return boolean - */ - protected function isCore($name, $scope) - { - $existingField = $this->getFieldDef($name, $scope); - if (isset($existingField) && (!isset($existingField[$this->customOptionName]) || !$existingField[$this->customOptionName])) { - return true; - } + /** + * Check if a field is core field + * + * @param string $name + * @param string $scope + * @return boolean + */ + protected function isCore($name, $scope) + { + $existingField = $this->getFieldDef($name, $scope); + if (isset($existingField) && (!isset($existingField[$this->customOptionName]) || !$existingField[$this->customOptionName])) { + return true; + } - return false; - } + return false; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/File/ClassParser.php b/application/Espo/Core/Utils/File/ClassParser.php index a404c54736..81fa76b8d6 100644 --- a/application/Espo/Core/Utils/File/ClassParser.php +++ b/application/Espo/Core/Utils/File/ClassParser.php @@ -26,124 +26,124 @@ use \Espo\Core\Utils\Util; class ClassParser { - private $fileManager; + private $fileManager; - private $config; + private $config; - private $metadata; + private $metadata; - protected $cacheFile = null; + protected $cacheFile = null; - protected $allowedMethods = array( - 'run', - ); + protected $allowedMethods = array( + 'run', + ); - public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Config $config, \Espo\Core\Utils\Metadata $metadata) - { - $this->fileManager = $fileManager; - $this->config = $config; - $this->metadata = $metadata; - } + public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Config $config, \Espo\Core\Utils\Metadata $metadata) + { + $this->fileManager = $fileManager; + $this->config = $config; + $this->metadata = $metadata; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - public function setAllowedMethods(array $methods) - { - $this->allowedMethods = $methods; - } + public function setAllowedMethods(array $methods) + { + $this->allowedMethods = $methods; + } - /** - * Return path data of classes - * @param string $cacheFile full path for a cache file, ex. data/cache/application/entryPoints.php - * @param string | array $paths in format array( - * 'corePath' => '', - * 'modulePath' => '', - * 'customPath' => '', - * ); - * @return array - */ - public function getData($paths, $cacheFile = false) - { - $data = null; + /** + * Return path data of classes + * @param string $cacheFile full path for a cache file, ex. data/cache/application/entryPoints.php + * @param string | array $paths in format array( + * 'corePath' => '', + * 'modulePath' => '', + * 'customPath' => '', + * ); + * @return array + */ + public function getData($paths, $cacheFile = false) + { + $data = null; - if (is_string($paths)) { - $paths = array( - 'corePath' => $paths, - ); - } + if (is_string($paths)) { + $paths = array( + 'corePath' => $paths, + ); + } - if ($cacheFile && file_exists($cacheFile) && $this->getConfig()->get('useCache')) { - $data = $this->getFileManager()->getContents($cacheFile); - } else { - $data = $this->getClassNameHash($paths['corePath']); + if ($cacheFile && file_exists($cacheFile) && $this->getConfig()->get('useCache')) { + $data = $this->getFileManager()->getContents($cacheFile); + } else { + $data = $this->getClassNameHash($paths['corePath']); - if (isset($paths['modulePath'])) { - foreach ($this->getMetadata()->getModuleList() as $moduleName) { - $path = str_replace('{*}', $moduleName, $paths['modulePath']); + if (isset($paths['modulePath'])) { + foreach ($this->getMetadata()->getModuleList() as $moduleName) { + $path = str_replace('{*}', $moduleName, $paths['modulePath']); - $data = array_merge($data, $this->getClassNameHash($path)); - } - } + $data = array_merge($data, $this->getClassNameHash($path)); + } + } - if (isset($paths['customPath'])) { - $data = array_merge($data, $this->getClassNameHash($paths['customPath'])); - } - - if ($cacheFile && $this->getConfig()->get('useCache')) { - $result = $this->getFileManager()->putContentsPHP($cacheFile, $data); - if ($result == false) { - throw new \Espo\Core\Exceptions\Error(); - } - } - } + if (isset($paths['customPath'])) { + $data = array_merge($data, $this->getClassNameHash($paths['customPath'])); + } + + if ($cacheFile && $this->getConfig()->get('useCache')) { + $result = $this->getFileManager()->putContentsPHP($cacheFile, $data); + if ($result == false) { + throw new \Espo\Core\Exceptions\Error(); + } + } + } - return $data; - } - + return $data; + } + - protected function getClassNameHash($dirs) - { - if (is_string($dirs)) { - $dirs = (array) $dirs; - } + protected function getClassNameHash($dirs) + { + if (is_string($dirs)) { + $dirs = (array) $dirs; + } - $data = array(); - foreach ($dirs as $dir) { - if (file_exists($dir)) { - $fileList = $this->getFileManager()->getFileList($dir, false, '\.php$', 'file'); + $data = array(); + foreach ($dirs as $dir) { + if (file_exists($dir)) { + $fileList = $this->getFileManager()->getFileList($dir, false, '\.php$', 'file'); - foreach ($fileList as $file) { - $filePath = Util::concatPath($dir, $file); - $className = Util::getClassName($filePath); - $fileName = $this->getFileManager()->getFileName($filePath); - $fileName = ucfirst($fileName); + foreach ($fileList as $file) { + $filePath = Util::concatPath($dir, $file); + $className = Util::getClassName($filePath); + $fileName = $this->getFileManager()->getFileName($filePath); + $fileName = ucfirst($fileName); - foreach ($this->allowedMethods as $methodName) { - if (method_exists($className, $methodName)) { - $data[$fileName] = $className; - } - } - - } - } - } + foreach ($this->allowedMethods as $methodName) { + if (method_exists($className, $methodName)) { + $data[$fileName] = $className; + } + } + + } + } + } - return $data; - } - + return $data; + } + } \ No newline at end of file diff --git a/application/Espo/Core/Utils/File/Manager.php b/application/Espo/Core/Utils/File/Manager.php index 7865cc2f22..5197a5ee28 100644 --- a/application/Espo/Core/Utils/File/Manager.php +++ b/application/Espo/Core/Utils/File/Manager.php @@ -23,613 +23,613 @@ namespace Espo\Core\Utils\File; use Espo\Core\Utils, - Espo\Core\Exceptions\Error; + Espo\Core\Exceptions\Error; class Manager { - private $permission; - - public function __construct(\Espo\Core\Utils\Config $config = null) - { - $params = null; - if (isset($config)) { - $params = array( - 'defaultPermissions' => $config->get('defaultPermissions'), - 'permissionMap' => $config->get('permissionMap'), - ); - } - - $this->permission = new Permission($this, $params); - } - - public function getPermissionUtils() - { - return $this->permission; - } - - /** - * Get a list of files in specified directory - * - * @param string $path string - Folder path, Ex. myfolder - * @param bool | int $recursively - Find files in subfolders - * @param string $filter - Filter for files. Use regular expression, Ex. \.json$ - * @param string $fileType [all, file, dir] - Filter for type of files/directories. - * @param bool $isReturnSingleArray - if need to return a single array of file list - * - * @return array - */ - public function getFileList($path, $recursively=false, $filter='', $fileType='all', $isReturnSingleArray = false) - { - if (!file_exists($path)) { - return false; - } - - $result = array(); - - $cdir = scandir($path); - foreach ($cdir as $key => $value) - { - if (!in_array($value,array(".",".."))) - { - $add= false; - if (is_dir($path . Utils\Util::getSeparator() . $value)) { - if ($recursively || (is_int($recursively) && $recursively!=0) ) { - $nextRecursively = is_int($recursively) ? ($recursively-1) : $recursively; - $result[$value] = $this->getFileList($path.Utils\Util::getSeparator().$value, $nextRecursively, $filter, $fileType); - } - else if (in_array($fileType, array('all', 'dir'))){ - $add= true; - } - } - else if (in_array($fileType, array('all', 'file'))) { - $add= true; - } - - if ($add) { - if (!empty($filter)) { - if (preg_match('/'.$filter.'/i', $value)) { - $result[] = $value; - } - } - else { - $result[] = $value; - } - } - - } - } - - if ($isReturnSingleArray) { - return $this->getSingeFileList($result); - } - - return $result; - } - - /** - * Convert file list to a single array - * - * @param aray $fileList - * @param string $parentDirName - * - * @return aray - */ - protected function getSingeFileList(array $fileList, $parentDirName = '') - { - $singleFileList = array(); - foreach($fileList as $dirName => $fileName) { - - if (is_array($fileName)) { - $currentDir = Utils\Util::concatPath($parentDirName, $dirName); - $singleFileList = array_merge($singleFileList, $this->getSingeFileList($fileName, $currentDir)); - } else { - $singleFileList[] = Utils\Util::concatPath($parentDirName, $fileName); - } - } - - return $singleFileList; - } - - /** - * Reads entire file into a string - * - * @param string | array $path Ex. 'path.php' OR array('dir', 'path.php') - * @param boolean $useIncludePath - * @param resource $context - * @param integer $offset - * @param integer $maxlen - * @return mixed - */ - public function getContents($path, $useIncludePath = false, $context = null, $offset = -1, $maxlen = null) - { - $fullPath = $this->concatPaths($path); - - if (file_exists($fullPath)) { - - if (strtolower(substr($fullPath, -4))=='.php') { - return include($fullPath); - } else { - if (isset($maxlen)) { - return file_get_contents($fullPath, $useIncludePath, $context, $offset, $maxlen); - } else { - return file_get_contents($fullPath, $useIncludePath, $context, $offset); - } - } - - } - - return false; - } - - /** - * Write data to a file - * - * @param string | array $path - * @param mixed $data - * @param integer $flags - * @param resource $context - * - * @return bool - */ - public function putContents($path, $data, $flags = 0, $context = null) - { - $fullPath = $this->concatPaths($path); //todo remove after changing the params - - if ($this->checkCreateFile($fullPath) === false) { - throw new Error('Permission denied in '. $fullPath); - } - - $res = (file_put_contents($fullPath, $data, $flags, $context) !== FALSE); - if ($res && function_exists('opcache_invalidate')) { - opcache_invalidate($fullPath); - } - - return $res; - } - - /** - * Save PHP content to file - * - * @param string | array $path - * @param string $data - * - * @return bool - */ - public function putContentsPHP($path, $data) - { - return $this->putContents($path, $this->getPHPFormat($data)); - } - - /** - * Save JSON content to file - * - * @param string | array $path - * @param string $data - * @param integer $flags - * @param resource $context - * - * @return bool - */ - public function putContentsJson($path, $data) - { - if (!Utils\Json::isJSON($data)) { - $data = Utils\Json::encode($data, JSON_PRETTY_PRINT); - } - - return $this->putContents($path, $data); - } - - /** - * Merge file content and save it to a file - * - * @param string | array $path - * @param string $content JSON string - * @param bool $isJSON - * @param string | array $removeOptions - List of unset keys from content - * @param bool $isReturn - Is result to be returned or stored - * - * @return bool | array - */ - public function mergeContents($path, $content, $isJSON = false, $removeOptions = null, $isReturn = false) - { - $fileContent = $this->getContents($path); - - $savedDataArray = Utils\Json::getArrayData($fileContent); - $newDataArray = Utils\Json::getArrayData($content); - - if (isset($removeOptions)) { - $savedDataArray = Utils\Util::unsetInArray($savedDataArray, $removeOptions); - $newDataArray = Utils\Util::unsetInArray($newDataArray, $removeOptions); - } - - $data = Utils\Util::merge($savedDataArray, $newDataArray); - if ($isJSON) { - $data = Utils\Json::encode($data, JSON_PRETTY_PRINT); - } - - if ($isReturn) { - return $data; - } - - return $this->putContents($path, $data); - } - - /** - * Merge PHP content and save it to a file - * - * @param string | array $path - * @param string $content JSON string - * @param string | array $removeOptions - List of unset keys from content - * @return bool - */ - public function mergeContentsPHP($path, $content, $removeOptions = null) - { - $data = $this->mergeContents($path, $content, false, $removeOptions, true); - - return $this->putContentsPHP($path, $data); - } - - /** - * Append the content to the end of the file - * - * @param string | array $path - * @param mixed $data - * - * @return bool - */ - public function appendContents($path, $data) - { - return $this->putContents($path, $data, FILE_APPEND | LOCK_EX); - } - - /** - * Unset some element of content data - * - * @param string | array $path - * @param array | string $unsets [description] - * @return bool - */ - public function unsetContents($path, $unsets, $isJSON = true) - { - $currentData = $this->getContents($path); - if ($currentData == false) { - $GLOBALS['log']->notice('FileManager::unsetContents: File ['.$this->concatPaths($path).'] does not exist.'); - return false; - } - - $currentDataArray = Utils\Json::getArrayData($currentData); - - $unsettedData = Utils\Util::unsetInArray($currentDataArray, $unsets); - - if ($isJSON) { - return $this->putContentsJson($path, $unsettedData); - } - - return $this->putContents($path, $unsettedData); - } - - - /** - * Concat paths - * @param string | array $paths Ex. array('pathPart1', 'pathPart2', 'pathPart3') - * @return string - */ - protected function concatPaths($paths) - { - if (is_string($paths)) { - return $paths; - } - - $fullPath = ''; - foreach ($paths as $path) { - $fullPath = Utils\Util::concatPath($fullPath, $path); - } - - return $fullPath; - } - - /** - * Create a new dir - * - * @param string | array $path - * @param int $permission - ex. 0755 - * @return bool - */ - public function mkdir($path, $permission = null) - { - $fullPath = $this->concatPaths($path); - - if (file_exists($fullPath) && is_dir($path)) { - return true; - } - - if (!isset($permission)) { - $defaultPermissions = $this->getPermissionUtils()->getDefaultPermissions(); - $permission = (string) $defaultPermissions['dir']; - $permission = base_convert($permission, 8, 10); - } - - try { - $result = mkdir($fullPath, $permission, true); - } catch (\Exception $e) { - $GLOBALS['log']->critical('Permission denied: unable to create the folder on the server - '.$fullPath); - } - - return isset($result) ? $result : false; - } - - /** - * Copy files from one direcoty to another - * Ex. $sourcePath = 'data/uploads/extensions/file.json', $destPath = 'data/uploads/backup', result will be data/uploads/backup/data/uploads/backup/file.json. - * - * @param string $sourcePath - * @param string $destPath - * @param boolean $recursively - * @param array $fileList - list of files that should be copied - * @param boolean $copyOnlyFiles - copy only files, instead of full path with directories, Ex. $sourcePath = 'data/uploads/extensions/file.json', $destPath = 'data/uploads/backup', result will be 'data/uploads/backup/file.json' - * @return boolen - */ - public function copy($sourcePath, $destPath, $recursively = false, array $fileList = null, $copyOnlyFiles = false) - { - $sourcePath = $this->concatPaths($sourcePath); - $destPath = $this->concatPaths($destPath); - - if (isset($fileList)) { - if (!empty($sourcePath)) { - foreach ($fileList as &$fileName) { - $fileName = $this->concatPaths(array($sourcePath, $fileName)); - } - } - } else { - $fileList = is_file($sourcePath) ? (array) $sourcePath : $this->getFileList($sourcePath, $recursively, '', 'file', true); - } - - /** Check permission before copying */ - $permissionDeniedList = array(); - foreach ($fileList as $file) { - - if ($copyOnlyFiles) { - $file = pathinfo($file, PATHINFO_BASENAME); - } - - $destFile = $this->concatPaths(array($destPath, $file)); - - $isFileExists = file_exists($destFile); - - if ($this->checkCreateFile($destFile) === false) { - $permissionDeniedList[] = $destFile; - } else if (!$isFileExists) { - $this->removeFile($destFile); - } - } - /** END */ - - if (!empty($permissionDeniedList)) { - $betterPermissionList = $this->getPermissionUtils()->arrangePermissionList($permissionDeniedList); - throw new Error("Permission denied in
". implode(",
", $betterPermissionList)); - } - - $res = true; - foreach ($fileList as $file) { - - if ($copyOnlyFiles) { - $file = pathinfo($file, PATHINFO_BASENAME); - } - - $sourceFile = is_file($sourcePath) ? $sourcePath : $this->concatPaths(array($sourcePath, $file)); - $destFile = $this->concatPaths(array($destPath, $file)); - - $res &= copy($sourceFile, $destFile); - } - - return $res; - } - - /** - * Create a new file if not exists with all folders in the path. - * - * @param string $filePath - * @return string - */ - protected function checkCreateFile($filePath) - { - $defaultPermissions = $this->getPermissionUtils()->getDefaultPermissions(); - - if (file_exists($filePath)) { - - if (!in_array($this->getPermissionUtils()->getCurrentPermission($filePath), array($defaultPermissions['file'], $defaultPermissions['dir']))) { - return $this->getPermissionUtils()->setDefaultPermissions($filePath, true); - } - return true; - } - - $pathParts = pathinfo($filePath); - if (!file_exists($pathParts['dirname'])) { - $dirPermission = $defaultPermissions['dir']; - $dirPermission = is_string($dirPermission) ? base_convert($dirPermission,8,10) : $dirPermission; - - if (!mkdir($pathParts['dirname'], $dirPermission, true)) { - throw new Error('Permission denied: unable to create a folder on the server - '.$pathParts['dirname']); - } - } - - if (touch($filePath)) { - return $this->getPermissionUtils()->setDefaultPermissions($filePath, true); - } - - return false; - } - - /** - * Remove file/files by given path - * - * @param array $filePaths - File paths list - * @return bool - */ - public function unlink($filePaths) - { - return $this->removeFile($filePaths); - } - - /** - * Remove file/files by given path - * - * @param array $filePaths - File paths list - * @param string $dirPath - directory path - * @return bool - */ - public function removeFile($filePaths, $dirPath = null) - { - if (!is_array($filePaths)) { - $filePaths = (array) $filePaths; - } - - $result = true; - foreach ($filePaths as $filePath) { - if (isset($dirPath)) { - $filePath = Utils\Util::concatPath($dirPath, $filePath); - } - - if (file_exists($filePath) && is_file($filePath)) { - $result &= unlink($filePath); - } - } - - return $result; - } - - /** - * Remove all files inside given path - * - * @param string $dirPath - directory path - * @param bool $removeWithDir - if remove with directory - * - * @return bool - */ - public function removeInDir($dirPath, $removeWithDir = false) - { - $fileList = $this->getFileList($dirPath, false); - - $result = true; - if (is_array($fileList)) { - foreach ($fileList as $file) { - $fullPath = Utils\Util::concatPath($dirPath, $file); - if (is_dir($fullPath)) { - $result &= $this->removeInDir($fullPath, true); - } else if (file_exists($fullPath)) { - $result &= unlink($fullPath); - } - } - } - - if ($removeWithDir) { - if (file_exists($dirPath)) { - rmdir($dirPath); - } - } - - return $result; - } - - /** - * Remove items (files or directories) - * - * @param string | array $items - * @param string $dirPath - * @return boolean - */ - public function remove($items, $dirPath = null) - { - if (!is_array($items)) { - $items = (array) $items; - } - - $result = true; - foreach ($items as $item) { - if (isset($dirPath)) { - $item = Utils\Util::concatPath($dirPath, $item); - } - - if (is_dir($item)) { - $result = $this->removeInDir($item, true); - } else { - $result = $this->removeFile($item); - } - } - - return $result; - } - - /** - * Get a filename without the file extension - * - * @param string $filename - * @param string $ext - extension, ex. '.json' - * - * @return array - */ - public function getFileName($fileName, $ext='') - { - if (empty($ext)) { - $fileName= substr($fileName, 0, strrpos($fileName, '.', -1)); - } - else { - if (substr($ext, 0, 1)!='.') { - $ext= '.'.$ext; - } - - if (substr($fileName, -(strlen($ext)))==$ext) { - $fileName= substr($fileName, 0, -(strlen($ext))); - } - } - - $exFileName = explode('/', Utils\Util::toFormat($fileName, '/')); - - return end($exFileName); - } - - - /** - * Get a directory name from the path - * - * @param string $path - * @param bool $isFullPath - * - * @return array - */ - public function getDirName($path, $isFullPath = true) - { - $pathInfo = pathinfo($path); - - if (!$isFullPath) { - $pieces = explode('/', $pathInfo['dirname']); - - return $pieces[count($pieces)-1]; - } - - return $pathInfo['dirname']; - } - - /** - * Return content of PHP file - * - * @param string $varName - name of variable which contains the content - * @param array $content - * - * @return string | false - */ - public function getPHPFormat($content) - { - if (empty($content)) { - return false; - } - - return ' $config->get('defaultPermissions'), + 'permissionMap' => $config->get('permissionMap'), + ); + } + + $this->permission = new Permission($this, $params); + } + + public function getPermissionUtils() + { + return $this->permission; + } + + /** + * Get a list of files in specified directory + * + * @param string $path string - Folder path, Ex. myfolder + * @param bool | int $recursively - Find files in subfolders + * @param string $filter - Filter for files. Use regular expression, Ex. \.json$ + * @param string $fileType [all, file, dir] - Filter for type of files/directories. + * @param bool $isReturnSingleArray - if need to return a single array of file list + * + * @return array + */ + public function getFileList($path, $recursively=false, $filter='', $fileType='all', $isReturnSingleArray = false) + { + if (!file_exists($path)) { + return false; + } + + $result = array(); + + $cdir = scandir($path); + foreach ($cdir as $key => $value) + { + if (!in_array($value,array(".",".."))) + { + $add= false; + if (is_dir($path . Utils\Util::getSeparator() . $value)) { + if ($recursively || (is_int($recursively) && $recursively!=0) ) { + $nextRecursively = is_int($recursively) ? ($recursively-1) : $recursively; + $result[$value] = $this->getFileList($path.Utils\Util::getSeparator().$value, $nextRecursively, $filter, $fileType); + } + else if (in_array($fileType, array('all', 'dir'))){ + $add= true; + } + } + else if (in_array($fileType, array('all', 'file'))) { + $add= true; + } + + if ($add) { + if (!empty($filter)) { + if (preg_match('/'.$filter.'/i', $value)) { + $result[] = $value; + } + } + else { + $result[] = $value; + } + } + + } + } + + if ($isReturnSingleArray) { + return $this->getSingeFileList($result); + } + + return $result; + } + + /** + * Convert file list to a single array + * + * @param aray $fileList + * @param string $parentDirName + * + * @return aray + */ + protected function getSingeFileList(array $fileList, $parentDirName = '') + { + $singleFileList = array(); + foreach($fileList as $dirName => $fileName) { + + if (is_array($fileName)) { + $currentDir = Utils\Util::concatPath($parentDirName, $dirName); + $singleFileList = array_merge($singleFileList, $this->getSingeFileList($fileName, $currentDir)); + } else { + $singleFileList[] = Utils\Util::concatPath($parentDirName, $fileName); + } + } + + return $singleFileList; + } + + /** + * Reads entire file into a string + * + * @param string | array $path Ex. 'path.php' OR array('dir', 'path.php') + * @param boolean $useIncludePath + * @param resource $context + * @param integer $offset + * @param integer $maxlen + * @return mixed + */ + public function getContents($path, $useIncludePath = false, $context = null, $offset = -1, $maxlen = null) + { + $fullPath = $this->concatPaths($path); + + if (file_exists($fullPath)) { + + if (strtolower(substr($fullPath, -4))=='.php') { + return include($fullPath); + } else { + if (isset($maxlen)) { + return file_get_contents($fullPath, $useIncludePath, $context, $offset, $maxlen); + } else { + return file_get_contents($fullPath, $useIncludePath, $context, $offset); + } + } + + } + + return false; + } + + /** + * Write data to a file + * + * @param string | array $path + * @param mixed $data + * @param integer $flags + * @param resource $context + * + * @return bool + */ + public function putContents($path, $data, $flags = 0, $context = null) + { + $fullPath = $this->concatPaths($path); //todo remove after changing the params + + if ($this->checkCreateFile($fullPath) === false) { + throw new Error('Permission denied in '. $fullPath); + } + + $res = (file_put_contents($fullPath, $data, $flags, $context) !== FALSE); + if ($res && function_exists('opcache_invalidate')) { + opcache_invalidate($fullPath); + } + + return $res; + } + + /** + * Save PHP content to file + * + * @param string | array $path + * @param string $data + * + * @return bool + */ + public function putContentsPHP($path, $data) + { + return $this->putContents($path, $this->getPHPFormat($data)); + } + + /** + * Save JSON content to file + * + * @param string | array $path + * @param string $data + * @param integer $flags + * @param resource $context + * + * @return bool + */ + public function putContentsJson($path, $data) + { + if (!Utils\Json::isJSON($data)) { + $data = Utils\Json::encode($data, JSON_PRETTY_PRINT); + } + + return $this->putContents($path, $data); + } + + /** + * Merge file content and save it to a file + * + * @param string | array $path + * @param string $content JSON string + * @param bool $isJSON + * @param string | array $removeOptions - List of unset keys from content + * @param bool $isReturn - Is result to be returned or stored + * + * @return bool | array + */ + public function mergeContents($path, $content, $isJSON = false, $removeOptions = null, $isReturn = false) + { + $fileContent = $this->getContents($path); + + $savedDataArray = Utils\Json::getArrayData($fileContent); + $newDataArray = Utils\Json::getArrayData($content); + + if (isset($removeOptions)) { + $savedDataArray = Utils\Util::unsetInArray($savedDataArray, $removeOptions); + $newDataArray = Utils\Util::unsetInArray($newDataArray, $removeOptions); + } + + $data = Utils\Util::merge($savedDataArray, $newDataArray); + if ($isJSON) { + $data = Utils\Json::encode($data, JSON_PRETTY_PRINT); + } + + if ($isReturn) { + return $data; + } + + return $this->putContents($path, $data); + } + + /** + * Merge PHP content and save it to a file + * + * @param string | array $path + * @param string $content JSON string + * @param string | array $removeOptions - List of unset keys from content + * @return bool + */ + public function mergeContentsPHP($path, $content, $removeOptions = null) + { + $data = $this->mergeContents($path, $content, false, $removeOptions, true); + + return $this->putContentsPHP($path, $data); + } + + /** + * Append the content to the end of the file + * + * @param string | array $path + * @param mixed $data + * + * @return bool + */ + public function appendContents($path, $data) + { + return $this->putContents($path, $data, FILE_APPEND | LOCK_EX); + } + + /** + * Unset some element of content data + * + * @param string | array $path + * @param array | string $unsets [description] + * @return bool + */ + public function unsetContents($path, $unsets, $isJSON = true) + { + $currentData = $this->getContents($path); + if ($currentData == false) { + $GLOBALS['log']->notice('FileManager::unsetContents: File ['.$this->concatPaths($path).'] does not exist.'); + return false; + } + + $currentDataArray = Utils\Json::getArrayData($currentData); + + $unsettedData = Utils\Util::unsetInArray($currentDataArray, $unsets); + + if ($isJSON) { + return $this->putContentsJson($path, $unsettedData); + } + + return $this->putContents($path, $unsettedData); + } + + + /** + * Concat paths + * @param string | array $paths Ex. array('pathPart1', 'pathPart2', 'pathPart3') + * @return string + */ + protected function concatPaths($paths) + { + if (is_string($paths)) { + return $paths; + } + + $fullPath = ''; + foreach ($paths as $path) { + $fullPath = Utils\Util::concatPath($fullPath, $path); + } + + return $fullPath; + } + + /** + * Create a new dir + * + * @param string | array $path + * @param int $permission - ex. 0755 + * @return bool + */ + public function mkdir($path, $permission = null) + { + $fullPath = $this->concatPaths($path); + + if (file_exists($fullPath) && is_dir($path)) { + return true; + } + + if (!isset($permission)) { + $defaultPermissions = $this->getPermissionUtils()->getDefaultPermissions(); + $permission = (string) $defaultPermissions['dir']; + $permission = base_convert($permission, 8, 10); + } + + try { + $result = mkdir($fullPath, $permission, true); + } catch (\Exception $e) { + $GLOBALS['log']->critical('Permission denied: unable to create the folder on the server - '.$fullPath); + } + + return isset($result) ? $result : false; + } + + /** + * Copy files from one direcoty to another + * Ex. $sourcePath = 'data/uploads/extensions/file.json', $destPath = 'data/uploads/backup', result will be data/uploads/backup/data/uploads/backup/file.json. + * + * @param string $sourcePath + * @param string $destPath + * @param boolean $recursively + * @param array $fileList - list of files that should be copied + * @param boolean $copyOnlyFiles - copy only files, instead of full path with directories, Ex. $sourcePath = 'data/uploads/extensions/file.json', $destPath = 'data/uploads/backup', result will be 'data/uploads/backup/file.json' + * @return boolen + */ + public function copy($sourcePath, $destPath, $recursively = false, array $fileList = null, $copyOnlyFiles = false) + { + $sourcePath = $this->concatPaths($sourcePath); + $destPath = $this->concatPaths($destPath); + + if (isset($fileList)) { + if (!empty($sourcePath)) { + foreach ($fileList as &$fileName) { + $fileName = $this->concatPaths(array($sourcePath, $fileName)); + } + } + } else { + $fileList = is_file($sourcePath) ? (array) $sourcePath : $this->getFileList($sourcePath, $recursively, '', 'file', true); + } + + /** Check permission before copying */ + $permissionDeniedList = array(); + foreach ($fileList as $file) { + + if ($copyOnlyFiles) { + $file = pathinfo($file, PATHINFO_BASENAME); + } + + $destFile = $this->concatPaths(array($destPath, $file)); + + $isFileExists = file_exists($destFile); + + if ($this->checkCreateFile($destFile) === false) { + $permissionDeniedList[] = $destFile; + } else if (!$isFileExists) { + $this->removeFile($destFile); + } + } + /** END */ + + if (!empty($permissionDeniedList)) { + $betterPermissionList = $this->getPermissionUtils()->arrangePermissionList($permissionDeniedList); + throw new Error("Permission denied in
". implode(",
", $betterPermissionList)); + } + + $res = true; + foreach ($fileList as $file) { + + if ($copyOnlyFiles) { + $file = pathinfo($file, PATHINFO_BASENAME); + } + + $sourceFile = is_file($sourcePath) ? $sourcePath : $this->concatPaths(array($sourcePath, $file)); + $destFile = $this->concatPaths(array($destPath, $file)); + + $res &= copy($sourceFile, $destFile); + } + + return $res; + } + + /** + * Create a new file if not exists with all folders in the path. + * + * @param string $filePath + * @return string + */ + protected function checkCreateFile($filePath) + { + $defaultPermissions = $this->getPermissionUtils()->getDefaultPermissions(); + + if (file_exists($filePath)) { + + if (!in_array($this->getPermissionUtils()->getCurrentPermission($filePath), array($defaultPermissions['file'], $defaultPermissions['dir']))) { + return $this->getPermissionUtils()->setDefaultPermissions($filePath, true); + } + return true; + } + + $pathParts = pathinfo($filePath); + if (!file_exists($pathParts['dirname'])) { + $dirPermission = $defaultPermissions['dir']; + $dirPermission = is_string($dirPermission) ? base_convert($dirPermission,8,10) : $dirPermission; + + if (!mkdir($pathParts['dirname'], $dirPermission, true)) { + throw new Error('Permission denied: unable to create a folder on the server - '.$pathParts['dirname']); + } + } + + if (touch($filePath)) { + return $this->getPermissionUtils()->setDefaultPermissions($filePath, true); + } + + return false; + } + + /** + * Remove file/files by given path + * + * @param array $filePaths - File paths list + * @return bool + */ + public function unlink($filePaths) + { + return $this->removeFile($filePaths); + } + + /** + * Remove file/files by given path + * + * @param array $filePaths - File paths list + * @param string $dirPath - directory path + * @return bool + */ + public function removeFile($filePaths, $dirPath = null) + { + if (!is_array($filePaths)) { + $filePaths = (array) $filePaths; + } + + $result = true; + foreach ($filePaths as $filePath) { + if (isset($dirPath)) { + $filePath = Utils\Util::concatPath($dirPath, $filePath); + } + + if (file_exists($filePath) && is_file($filePath)) { + $result &= unlink($filePath); + } + } + + return $result; + } + + /** + * Remove all files inside given path + * + * @param string $dirPath - directory path + * @param bool $removeWithDir - if remove with directory + * + * @return bool + */ + public function removeInDir($dirPath, $removeWithDir = false) + { + $fileList = $this->getFileList($dirPath, false); + + $result = true; + if (is_array($fileList)) { + foreach ($fileList as $file) { + $fullPath = Utils\Util::concatPath($dirPath, $file); + if (is_dir($fullPath)) { + $result &= $this->removeInDir($fullPath, true); + } else if (file_exists($fullPath)) { + $result &= unlink($fullPath); + } + } + } + + if ($removeWithDir) { + if (file_exists($dirPath)) { + rmdir($dirPath); + } + } + + return $result; + } + + /** + * Remove items (files or directories) + * + * @param string | array $items + * @param string $dirPath + * @return boolean + */ + public function remove($items, $dirPath = null) + { + if (!is_array($items)) { + $items = (array) $items; + } + + $result = true; + foreach ($items as $item) { + if (isset($dirPath)) { + $item = Utils\Util::concatPath($dirPath, $item); + } + + if (is_dir($item)) { + $result = $this->removeInDir($item, true); + } else { + $result = $this->removeFile($item); + } + } + + return $result; + } + + /** + * Get a filename without the file extension + * + * @param string $filename + * @param string $ext - extension, ex. '.json' + * + * @return array + */ + public function getFileName($fileName, $ext='') + { + if (empty($ext)) { + $fileName= substr($fileName, 0, strrpos($fileName, '.', -1)); + } + else { + if (substr($ext, 0, 1)!='.') { + $ext= '.'.$ext; + } + + if (substr($fileName, -(strlen($ext)))==$ext) { + $fileName= substr($fileName, 0, -(strlen($ext))); + } + } + + $exFileName = explode('/', Utils\Util::toFormat($fileName, '/')); + + return end($exFileName); + } + + + /** + * Get a directory name from the path + * + * @param string $path + * @param bool $isFullPath + * + * @return array + */ + public function getDirName($path, $isFullPath = true) + { + $pathInfo = pathinfo($path); + + if (!$isFullPath) { + $pieces = explode('/', $pathInfo['dirname']); + + return $pieces[count($pieces)-1]; + } + + return $pathInfo['dirname']; + } + + /** + * Return content of PHP file + * + * @param string $varName - name of variable which contains the content + * @param array $content + * + * @return string | false + */ + public function getPHPFormat($content) + { + if (empty($content)) { + return false; + } + + return ''; - } + } } diff --git a/application/Espo/Core/Utils/File/Permission.php b/application/Espo/Core/Utils/File/Permission.php index efcc763d91..54339d828e 100644 --- a/application/Espo/Core/Utils/File/Permission.php +++ b/application/Espo/Core/Utils/File/Permission.php @@ -23,583 +23,583 @@ namespace Espo\Core\Utils\File; use Espo\Core\Utils, - Espo\Core\Exceptions\Error; + Espo\Core\Exceptions\Error; class Permission { - private $fileManager; - - /** - * Last permission error - * - * @var array | string - */ - protected $permissionError = null; - - protected $permissionErrorRules = null; - - protected $params = array( - 'defaultPermissions' => array ( - 'dir' => '0775', - 'file' => '0664', - 'user' => '', - 'group' => '', - ), - 'permissionMap' => array( - - /** array('0664', '0775') */ - 'writable' => array( - 'data', - 'custom', - ), - - /** array('0644', '0755') */ - 'readable' => array( - 'api', - 'application', - 'client', - 'vendor', - 'index.php', - 'cron.php', - 'rebuild.php', - 'main.html', - 'reset.html', - ), - ), - ); - - protected $permissionRules = array( - 'writable' => array('0664', '0775'), - 'readable' => array('0644', '0755'), - ); - - - public function __construct(Manager $fileManager, array $params = null) - { - $this->fileManager = $fileManager; - if (isset($params)) { - $this->params = $params; - } - } - - protected function getFileManager() - { - return $this->fileManager; - } - - protected function getParams() - { - return $this->params; - } - - - /** - * Get default settings - * - * @return object - */ - public function getDefaultPermissions() - { - $params = $this->getParams(); - return $params['defaultPermissions']; - } - - - public function getPermissionRules() - { - return $this->permissionRules; - } - - /** - * Set default permission - * - * @param string $path - * @param bool $recurse - * - * @return bool - */ - public function setDefaultPermissions($path, $recurse = false) - { - if (!file_exists($path)) { - return false; - } - - $permission = $this->getDefaultPermissions(); - - $result = $this->chmod($path, array($permission['file'], $permission['dir']), $recurse); - if (!empty($permission['user'])) { - $result &= $this->chown($path, $permission['user'], $recurse); - } - if (!empty($permission['group'])) { - $result &= $this->chgrp($path, $permission['group'], $recurse); - } - - return $result; - } - - - /** - * Get current permissions - * - * @param string $filename - * @return string | bool - */ - public function getCurrentPermission($filePath) - { - if (!file_exists($filePath)) { - return false; - } - - $fileInfo= stat($filePath); - - return substr(base_convert($fileInfo['mode'],10,8), -4); - } - - /** - * Change permissions - * - * @param string $filename - * @param int | array $octal - ex. 0755, array(0644, 0755), array('file'=>0644, 'dir'=>0755) - * @param bool $recurse - * - * @return bool - */ - public function chmod($path, $octal, $recurse = false) - { - if (!file_exists($path)) { - return false; - } - - //check the input format - $permission= array(); - if (is_array($octal)) { - $count= 0; - $rule= array('file', 'dir'); - foreach ($octal as $key => $val) { - $pKey= strval($key); - if (!in_array($pKey, $rule)) { - $pKey= $rule[$count]; - } - - if (!empty($pKey)) { - $permission[$pKey]= $val; - } - $count++; - } - } - elseif (is_int((int)$octal)) { - $permission= array( - 'file' => $octal, - 'dir' => $octal, - ); - } - else { - return false; - } - - //conver to octal value - foreach($permission as $key => $val) { - if (is_string($val)) { - $permission[$key]= base_convert($val,8,10); - } - } - - //Set permission for non-recursive request - if (!$recurse) { - if (is_dir($path)) { - return $this->chmodReal($path, $permission['dir']); - } - return $this->chmodReal($path, $permission['file']); - } - - //Recursive permission - return $this->chmodRecurse($path, $permission['file'], $permission['dir']); - } - - - /** - * Change permissions recursive - * - * @param string $filename - * @param int $fileOctal - ex. 0644 - * @param int $dirOctal - ex. 0755 - * - * @return bool - */ - protected function chmodRecurse($path, $fileOctal = 0644, $dirOctal = 0755) - { - if (!file_exists($path)) { - return false; - } - - if (is_file($path)) { - return $this->chmodReal($path, $fileOctal); - } - - if (is_dir($path)) { - $allFiles = $this->getFileManager()->getFileList($path); - - foreach ($items as $item) { - $this->chmodRecurse($path. Utils\Util::getSeparator() .$item, $fileOctal, $dirOctal); - } - - return $this->chmodReal($path, $dirOctal); - } - - return false; - } - - - - - - /** - * Change owner permission - * - * @param string $path - * @param int | string $user - * @param bool $recurse - * - * @return bool - */ - public function chown($path, $user='', $recurse=false) - { - if (!file_exists($path)) { - return false; - } - - if (empty($user)) { - $user = $this->getDefaultOwner(); - } - - //Set chown for non-recursive request - if (!$recurse) { - return $this->chownReal($path, $user); - } - - //Recursive chown - return $this->chownRecurse($path, $user); - } - - /** - * Change owner permission recursive - * - * @param string $path - * @param string $user - * - * @return bool - */ - protected function chownRecurse($path, $user) - { - if (!file_exists($path)) { - return false; - } - - $allFiles = $this->getFileManager()->getFileList($path); - - foreach ($items as $item) { - $this->chownRecurse($path. Utils\Util::getSeparator() .$item, $user); - } - - return $this->chownReal($path, $user); - } - - /** - * Change group permission - * - * @param string $path - * @param int | string $group - * @param bool $recurse - * - * @return bool - */ - public function chgrp($path, $group = null, $recurse = false) - { - if (!file_exists($path)) { - return false; - } - - if (!isset($group)) { - $group = $this->getDefaultGroup(); - } - - //Set chgrp for non-recursive request - if (!$recurse) { - return $this->chgrpReal($path, $group); - } - - //Recursive chown - return $this->chgrpRecurse($path, $group); - } - - /** - * Change group permission recursive - * - * @param string $filename - * @param int $fileOctal - ex. 0644 - * @param int $dirOctal - ex. 0755 - * - * @return bool - */ - protected function chgrpRecurse($path, $group) { - - if (!file_exists($path)) { - return false; - } - - $allFiles = $this->getFileManager()->getFileList($path); - - foreach ($items as $item) { - $this->chgrpRecurse($path. Utils\Util::getSeparator() .$item, $group); - } - - return $this->chgrpReal($path, $group); - } - - - /** - * Change permissions recursive - * - * @param string $filename - * @param int $mode - ex. 0644 - * - * @return bool - */ - protected function chmodReal($filename, $mode) - { - try { - $result = chmod($filename, $mode); - } catch (\Exception $e) { - $result = false; - } - - if (!$result) { - $this->chown($filename, $this->getDefaultOwner(true)); - $this->chgrp($filename, $this->getDefaultGroup(true)); - - try { - $result = chmod($filename, $mode); - } catch (\Exception $e) { - throw new Error($e->getMessage()); - } - } - - return $result; - } - - protected function chownReal($path, $user) - { - try { - $result = chown($path, $user); - } catch (\Exception $e) { - throw new Error($e->getMessage()); - } - - return $result; - } - - protected function chgrpReal($path, $group) - { - try { - $result = chgrp($path, $group); - } catch (\Exception $e) { - throw new Error($e->getMessage()); - } - - return $result; - } - - /** - * Get default owner user - * - * @return int - owner id - */ - public function getDefaultOwner($usePosix = false) - { - $defaultPermissions = $this->getDefaultPermissions(); - - $owner = $defaultPermissions['user']; - if (empty($owner) && $usePosix) { - $owner = function_exists('posix_getuid') ? posix_getuid() : null; - } - - if (empty($owner)) { - return false; - } - - return $owner; - } - - /** - * Get default group user - * - * @return int - group id - */ - public function getDefaultGroup($usePosix = false) - { - $defaultPermissions = $this->getDefaultPermissions(); - - $group = $defaultPermissions['group']; - if (empty($group) && $usePosix) { - $group = function_exists('posix_getegid') ? posix_getegid() : null; - } - - if (empty($group)) { - return false; - } - - return $group; - } - - /** - * Set permission regarding defined in permissionMap - * - * @return bool - */ - public function setMapPermission($mode = null) - { - $this->permissionError = array(); - $this->permissionErrorRules = array(); - - $params = $this->getParams(); - - $permissionRules = $this->permissionRules; - if (isset($mode)) { - foreach ($permissionRules as &$value) { - $value = $mode; - } - } - - $result = true; - foreach ($params['permissionMap'] as $type => $items) { - - $permission = $permissionRules[$type]; - - foreach ($items as $item) { - - if (file_exists($item)) { - - try { - $this->chmod($item, $permission, true); - } catch (\Exception $e) { - } - - $res = is_readable($item); - - /** check is wtitable */ - if ($type == 'writable') { - - $res &= is_writable($item); - - if (is_dir($item)) { - $name = uniqid(); - - try { - $res &= $this->getFileManager()->putContents(array($item, $name), 'test'); - $res &= $this->getFileManager()->removeFile($name, $item); - } catch (\Exception $e) { - $res = false; - } - } - } - - if (!$res) { - $result = false; - $this->permissionError[] = $item; - $this->permissionErrorRules[$item] = $permission; - } - } - } - } - - return $result; - } - - /** - * Get last permission error - * - * @return array | string - */ - public function getLastError() - { - return $this->permissionError; - } - - /** - * Get last permission error rules - * - * @return array | string - */ - public function getLastErrorRules() - { - return $this->permissionErrorRules; - } - - /** - * Arrange permission file list - * e.g. array('application/Espo/Controllers/Email.php', 'application/Espo/Controllers/Import.php'), result is array('application/Espo/Controllers') - * - * @param array $fileList - * @return array - */ - public function arrangePermissionList($fileList) - { - $betterList = array(); - foreach ($fileList as $fileName) { - - $pathInfo = pathinfo($fileName); - $dirname = $pathInfo['dirname']; - - $currentPath = $fileName; - if ($this->getSearchCount($dirname, $fileList) > 1) { - $currentPath = $dirname; - } - - if (!$this->isItemIncludes($currentPath, $betterList)) { - $betterList[] = $currentPath; - } - } - - return $betterList; - } - - /** - * Get count of a search string in a array - * - * @param string $search - * @param array $array - * @return bool - */ - protected function getSearchCount($search, array $array) - { - $search = $this->getPregQuote($search); - - $number = 0; - foreach ($array as $value) { - if (preg_match('/^'.$search.'/', $value)) { - $number++; - } - } - - return $number; - } - - protected function isItemIncludes($item, $array) - { - foreach ($array as $value) { - $value = $this->getPregQuote($value); - if (preg_match('/^'.$value.'/', $item)) { - return true; - } - } - - return false; - } - - protected function getPregQuote($string) - { - return preg_quote($string, '/-+=.'); - } + private $fileManager; + + /** + * Last permission error + * + * @var array | string + */ + protected $permissionError = null; + + protected $permissionErrorRules = null; + + protected $params = array( + 'defaultPermissions' => array ( + 'dir' => '0775', + 'file' => '0664', + 'user' => '', + 'group' => '', + ), + 'permissionMap' => array( + + /** array('0664', '0775') */ + 'writable' => array( + 'data', + 'custom', + ), + + /** array('0644', '0755') */ + 'readable' => array( + 'api', + 'application', + 'client', + 'vendor', + 'index.php', + 'cron.php', + 'rebuild.php', + 'main.html', + 'reset.html', + ), + ), + ); + + protected $permissionRules = array( + 'writable' => array('0664', '0775'), + 'readable' => array('0644', '0755'), + ); + + + public function __construct(Manager $fileManager, array $params = null) + { + $this->fileManager = $fileManager; + if (isset($params)) { + $this->params = $params; + } + } + + protected function getFileManager() + { + return $this->fileManager; + } + + protected function getParams() + { + return $this->params; + } + + + /** + * Get default settings + * + * @return object + */ + public function getDefaultPermissions() + { + $params = $this->getParams(); + return $params['defaultPermissions']; + } + + + public function getPermissionRules() + { + return $this->permissionRules; + } + + /** + * Set default permission + * + * @param string $path + * @param bool $recurse + * + * @return bool + */ + public function setDefaultPermissions($path, $recurse = false) + { + if (!file_exists($path)) { + return false; + } + + $permission = $this->getDefaultPermissions(); + + $result = $this->chmod($path, array($permission['file'], $permission['dir']), $recurse); + if (!empty($permission['user'])) { + $result &= $this->chown($path, $permission['user'], $recurse); + } + if (!empty($permission['group'])) { + $result &= $this->chgrp($path, $permission['group'], $recurse); + } + + return $result; + } + + + /** + * Get current permissions + * + * @param string $filename + * @return string | bool + */ + public function getCurrentPermission($filePath) + { + if (!file_exists($filePath)) { + return false; + } + + $fileInfo= stat($filePath); + + return substr(base_convert($fileInfo['mode'],10,8), -4); + } + + /** + * Change permissions + * + * @param string $filename + * @param int | array $octal - ex. 0755, array(0644, 0755), array('file'=>0644, 'dir'=>0755) + * @param bool $recurse + * + * @return bool + */ + public function chmod($path, $octal, $recurse = false) + { + if (!file_exists($path)) { + return false; + } + + //check the input format + $permission= array(); + if (is_array($octal)) { + $count= 0; + $rule= array('file', 'dir'); + foreach ($octal as $key => $val) { + $pKey= strval($key); + if (!in_array($pKey, $rule)) { + $pKey= $rule[$count]; + } + + if (!empty($pKey)) { + $permission[$pKey]= $val; + } + $count++; + } + } + elseif (is_int((int)$octal)) { + $permission= array( + 'file' => $octal, + 'dir' => $octal, + ); + } + else { + return false; + } + + //conver to octal value + foreach($permission as $key => $val) { + if (is_string($val)) { + $permission[$key]= base_convert($val,8,10); + } + } + + //Set permission for non-recursive request + if (!$recurse) { + if (is_dir($path)) { + return $this->chmodReal($path, $permission['dir']); + } + return $this->chmodReal($path, $permission['file']); + } + + //Recursive permission + return $this->chmodRecurse($path, $permission['file'], $permission['dir']); + } + + + /** + * Change permissions recursive + * + * @param string $filename + * @param int $fileOctal - ex. 0644 + * @param int $dirOctal - ex. 0755 + * + * @return bool + */ + protected function chmodRecurse($path, $fileOctal = 0644, $dirOctal = 0755) + { + if (!file_exists($path)) { + return false; + } + + if (is_file($path)) { + return $this->chmodReal($path, $fileOctal); + } + + if (is_dir($path)) { + $allFiles = $this->getFileManager()->getFileList($path); + + foreach ($items as $item) { + $this->chmodRecurse($path. Utils\Util::getSeparator() .$item, $fileOctal, $dirOctal); + } + + return $this->chmodReal($path, $dirOctal); + } + + return false; + } + + + + + + /** + * Change owner permission + * + * @param string $path + * @param int | string $user + * @param bool $recurse + * + * @return bool + */ + public function chown($path, $user='', $recurse=false) + { + if (!file_exists($path)) { + return false; + } + + if (empty($user)) { + $user = $this->getDefaultOwner(); + } + + //Set chown for non-recursive request + if (!$recurse) { + return $this->chownReal($path, $user); + } + + //Recursive chown + return $this->chownRecurse($path, $user); + } + + /** + * Change owner permission recursive + * + * @param string $path + * @param string $user + * + * @return bool + */ + protected function chownRecurse($path, $user) + { + if (!file_exists($path)) { + return false; + } + + $allFiles = $this->getFileManager()->getFileList($path); + + foreach ($items as $item) { + $this->chownRecurse($path. Utils\Util::getSeparator() .$item, $user); + } + + return $this->chownReal($path, $user); + } + + /** + * Change group permission + * + * @param string $path + * @param int | string $group + * @param bool $recurse + * + * @return bool + */ + public function chgrp($path, $group = null, $recurse = false) + { + if (!file_exists($path)) { + return false; + } + + if (!isset($group)) { + $group = $this->getDefaultGroup(); + } + + //Set chgrp for non-recursive request + if (!$recurse) { + return $this->chgrpReal($path, $group); + } + + //Recursive chown + return $this->chgrpRecurse($path, $group); + } + + /** + * Change group permission recursive + * + * @param string $filename + * @param int $fileOctal - ex. 0644 + * @param int $dirOctal - ex. 0755 + * + * @return bool + */ + protected function chgrpRecurse($path, $group) { + + if (!file_exists($path)) { + return false; + } + + $allFiles = $this->getFileManager()->getFileList($path); + + foreach ($items as $item) { + $this->chgrpRecurse($path. Utils\Util::getSeparator() .$item, $group); + } + + return $this->chgrpReal($path, $group); + } + + + /** + * Change permissions recursive + * + * @param string $filename + * @param int $mode - ex. 0644 + * + * @return bool + */ + protected function chmodReal($filename, $mode) + { + try { + $result = chmod($filename, $mode); + } catch (\Exception $e) { + $result = false; + } + + if (!$result) { + $this->chown($filename, $this->getDefaultOwner(true)); + $this->chgrp($filename, $this->getDefaultGroup(true)); + + try { + $result = chmod($filename, $mode); + } catch (\Exception $e) { + throw new Error($e->getMessage()); + } + } + + return $result; + } + + protected function chownReal($path, $user) + { + try { + $result = chown($path, $user); + } catch (\Exception $e) { + throw new Error($e->getMessage()); + } + + return $result; + } + + protected function chgrpReal($path, $group) + { + try { + $result = chgrp($path, $group); + } catch (\Exception $e) { + throw new Error($e->getMessage()); + } + + return $result; + } + + /** + * Get default owner user + * + * @return int - owner id + */ + public function getDefaultOwner($usePosix = false) + { + $defaultPermissions = $this->getDefaultPermissions(); + + $owner = $defaultPermissions['user']; + if (empty($owner) && $usePosix) { + $owner = function_exists('posix_getuid') ? posix_getuid() : null; + } + + if (empty($owner)) { + return false; + } + + return $owner; + } + + /** + * Get default group user + * + * @return int - group id + */ + public function getDefaultGroup($usePosix = false) + { + $defaultPermissions = $this->getDefaultPermissions(); + + $group = $defaultPermissions['group']; + if (empty($group) && $usePosix) { + $group = function_exists('posix_getegid') ? posix_getegid() : null; + } + + if (empty($group)) { + return false; + } + + return $group; + } + + /** + * Set permission regarding defined in permissionMap + * + * @return bool + */ + public function setMapPermission($mode = null) + { + $this->permissionError = array(); + $this->permissionErrorRules = array(); + + $params = $this->getParams(); + + $permissionRules = $this->permissionRules; + if (isset($mode)) { + foreach ($permissionRules as &$value) { + $value = $mode; + } + } + + $result = true; + foreach ($params['permissionMap'] as $type => $items) { + + $permission = $permissionRules[$type]; + + foreach ($items as $item) { + + if (file_exists($item)) { + + try { + $this->chmod($item, $permission, true); + } catch (\Exception $e) { + } + + $res = is_readable($item); + + /** check is wtitable */ + if ($type == 'writable') { + + $res &= is_writable($item); + + if (is_dir($item)) { + $name = uniqid(); + + try { + $res &= $this->getFileManager()->putContents(array($item, $name), 'test'); + $res &= $this->getFileManager()->removeFile($name, $item); + } catch (\Exception $e) { + $res = false; + } + } + } + + if (!$res) { + $result = false; + $this->permissionError[] = $item; + $this->permissionErrorRules[$item] = $permission; + } + } + } + } + + return $result; + } + + /** + * Get last permission error + * + * @return array | string + */ + public function getLastError() + { + return $this->permissionError; + } + + /** + * Get last permission error rules + * + * @return array | string + */ + public function getLastErrorRules() + { + return $this->permissionErrorRules; + } + + /** + * Arrange permission file list + * e.g. array('application/Espo/Controllers/Email.php', 'application/Espo/Controllers/Import.php'), result is array('application/Espo/Controllers') + * + * @param array $fileList + * @return array + */ + public function arrangePermissionList($fileList) + { + $betterList = array(); + foreach ($fileList as $fileName) { + + $pathInfo = pathinfo($fileName); + $dirname = $pathInfo['dirname']; + + $currentPath = $fileName; + if ($this->getSearchCount($dirname, $fileList) > 1) { + $currentPath = $dirname; + } + + if (!$this->isItemIncludes($currentPath, $betterList)) { + $betterList[] = $currentPath; + } + } + + return $betterList; + } + + /** + * Get count of a search string in a array + * + * @param string $search + * @param array $array + * @return bool + */ + protected function getSearchCount($search, array $array) + { + $search = $this->getPregQuote($search); + + $number = 0; + foreach ($array as $value) { + if (preg_match('/^'.$search.'/', $value)) { + $number++; + } + } + + return $number; + } + + protected function isItemIncludes($item, $array) + { + foreach ($array as $value) { + $value = $this->getPregQuote($value); + if (preg_match('/^'.$value.'/', $item)) { + return true; + } + } + + return false; + } + + protected function getPregQuote($string) + { + return preg_quote($string, '/-+=.'); + } } diff --git a/application/Espo/Core/Utils/File/Unifier.php b/application/Espo/Core/Utils/File/Unifier.php index 355a3c215f..19264fc8af 100644 --- a/application/Espo/Core/Utils/File/Unifier.php +++ b/application/Espo/Core/Utils/File/Unifier.php @@ -26,148 +26,148 @@ use Espo\Core\Utils; class Unifier { - private $fileManager; + private $fileManager; - protected $params = array( - 'unsetFileName' => 'unset.json', - 'defaultsPath' => 'application/Espo/Core/defaults', - ); + protected $params = array( + 'unsetFileName' => 'unset.json', + 'defaultsPath' => 'application/Espo/Core/defaults', + ); - public function __construct(\Espo\Core\Utils\File\Manager $fileManager) - { - $this->fileManager = $fileManager; - } + public function __construct(\Espo\Core\Utils\File\Manager $fileManager) + { + $this->fileManager = $fileManager; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - /** - * Unite file content to the file - * - * @param string $name - * @param array $paths - * @param boolean $recursively Note: only for first level of sub directory, other levels of sub directories will be ignored - * - * @return array - */ - public function unify($name, $paths, $recursively = false) - { - $content = $this->unifySingle($paths['corePath'], $name, $recursively); + /** + * Unite file content to the file + * + * @param string $name + * @param array $paths + * @param boolean $recursively Note: only for first level of sub directory, other levels of sub directories will be ignored + * + * @return array + */ + public function unify($name, $paths, $recursively = false) + { + $content = $this->unifySingle($paths['corePath'], $name, $recursively); - if (!empty($paths['modulePath'])) { - $customDir = strstr($paths['modulePath'], '{*}', true); - $dirList = $this->getFileManager()->getFileList($customDir, false, '', 'dir'); + if (!empty($paths['modulePath'])) { + $customDir = strstr($paths['modulePath'], '{*}', true); + $dirList = $this->getFileManager()->getFileList($customDir, false, '', 'dir'); - foreach ($dirList as $dirName) { - $curPath = str_replace('{*}', $dirName, $paths['modulePath']); - $content = Utils\Util::merge($content, $this->unifySingle($curPath, $name, $recursively, $dirName)); - } - } + foreach ($dirList as $dirName) { + $curPath = str_replace('{*}', $dirName, $paths['modulePath']); + $content = Utils\Util::merge($content, $this->unifySingle($curPath, $name, $recursively, $dirName)); + } + } - if (!empty($paths['customPath'])) { - $content = Utils\Util::merge($content, $this->unifySingle($paths['customPath'], $name, $recursively)); - } + if (!empty($paths['customPath'])) { + $content = Utils\Util::merge($content, $this->unifySingle($paths['customPath'], $name, $recursively)); + } - return $content; - } + return $content; + } - /** - * Unite file content to the file for one directory [NOW ONLY FOR METADATA, NEED TO CHECK FOR LAYOUTS AND OTHERS] - * - * @param string $dirPath - * @param string $type - name of type array("metadata", "layouts"), ex. $this->name - * @param bool $recursively - Note: only for first level of sub directory, other levels of sub directories will be ignored - * @param string $moduleName - name of module if exists - * - * @return string - content of the files - */ - protected function unifySingle($dirPath, $type, $recursively = false, $moduleName = '') - { - if (empty($dirPath) || !file_exists($dirPath)) { - return false; - } - $unsetFileName = $this->params['unsetFileName']; + /** + * Unite file content to the file for one directory [NOW ONLY FOR METADATA, NEED TO CHECK FOR LAYOUTS AND OTHERS] + * + * @param string $dirPath + * @param string $type - name of type array("metadata", "layouts"), ex. $this->name + * @param bool $recursively - Note: only for first level of sub directory, other levels of sub directories will be ignored + * @param string $moduleName - name of module if exists + * + * @return string - content of the files + */ + protected function unifySingle($dirPath, $type, $recursively = false, $moduleName = '') + { + if (empty($dirPath) || !file_exists($dirPath)) { + return false; + } + $unsetFileName = $this->params['unsetFileName']; - //get matadata files - $fileList = $this->getFileManager()->getFileList($dirPath, $recursively, '\.json$'); + //get matadata files + $fileList = $this->getFileManager()->getFileList($dirPath, $recursively, '\.json$'); - $dirName = $this->getFileManager()->getDirName($dirPath, false); - $defaultValues = $this->loadDefaultValues($dirName, $type); + $dirName = $this->getFileManager()->getDirName($dirPath, false); + $defaultValues = $this->loadDefaultValues($dirName, $type); - $content = array(); - $unsets = array(); - foreach($fileList as $dirName => $fileName) { + $content = array(); + $unsets = array(); + foreach($fileList as $dirName => $fileName) { - if (is_array($fileName)) { /*get content from files in a sub directory*/ - $content[$dirName]= $this->unifySingle(Utils\Util::concatPath($dirPath,$dirName), $type, false, $moduleName); //only first level of a sub directory + if (is_array($fileName)) { /*get content from files in a sub directory*/ + $content[$dirName]= $this->unifySingle(Utils\Util::concatPath($dirPath,$dirName), $type, false, $moduleName); //only first level of a sub directory - } else { /*get content from a single file*/ - if ($fileName == $unsetFileName) { - $fileContent = $this->getFileManager()->getContents(array($dirPath, $fileName)); - $unsets = Utils\Json::getArrayData($fileContent); - continue; - } /*END: Save data from unset.json*/ + } else { /*get content from a single file*/ + if ($fileName == $unsetFileName) { + $fileContent = $this->getFileManager()->getContents(array($dirPath, $fileName)); + $unsets = Utils\Json::getArrayData($fileContent); + continue; + } /*END: Save data from unset.json*/ - $mergedValues = $this->unifyGetContents(array($dirPath, $fileName), $defaultValues); + $mergedValues = $this->unifyGetContents(array($dirPath, $fileName), $defaultValues); - if (!empty($mergedValues)) { - $name = $this->getFileManager()->getFileName($fileName, '.json'); - $content[$name] = $mergedValues; - } - } - } + if (!empty($mergedValues)) { + $name = $this->getFileManager()->getFileName($fileName, '.json'); + $content[$name] = $mergedValues; + } + } + } - //unset content - $content = Utils\Util::unsetInArray($content, $unsets); - //END: unset content + //unset content + $content = Utils\Util::unsetInArray($content, $unsets); + //END: unset content - return $content; - } + return $content; + } - /** - * Helpful method for get content from files for unite Files - * - * @param string | array $paths - * @param string | array() $defaults - It can be a string like ["metadata","layouts"] OR an array with default values - * - * @return array - */ - protected function unifyGetContents($paths, $defaults) - { - $fileContent = $this->getFileManager()->getContents($paths); + /** + * Helpful method for get content from files for unite Files + * + * @param string | array $paths + * @param string | array() $defaults - It can be a string like ["metadata","layouts"] OR an array with default values + * + * @return array + */ + protected function unifyGetContents($paths, $defaults) + { + $fileContent = $this->getFileManager()->getContents($paths); - $decoded = Utils\Json::getArrayData($fileContent, null); + $decoded = Utils\Json::getArrayData($fileContent, null); - if (!isset($decoded)) { - $GLOBALS['log']->emergency('Syntax error in '.Utils\Util::concatPath($paths)); - return array(); - } + if (!isset($decoded)) { + $GLOBALS['log']->emergency('Syntax error in '.Utils\Util::concatPath($paths)); + return array(); + } - return $decoded; - } + return $decoded; + } - /** - * Load default values for selected type [metadata, layouts] - * - * @param string $name - * @param string $type - [metadata, layouts] - * - * @return array - */ - protected function loadDefaultValues($name, $type = 'metadata') - { - $defaultPath = $this->params['defaultsPath']; + /** + * Load default values for selected type [metadata, layouts] + * + * @param string $name + * @param string $type - [metadata, layouts] + * + * @return array + */ + protected function loadDefaultValues($name, $type = 'metadata') + { + $defaultPath = $this->params['defaultsPath']; - $defaultValue = $this->getFileManager()->getContents( array($defaultPath, $type, $name.'.json') ); - if ($defaultValue !== false) { - //return default array - return Utils\Json::decode($defaultValue, true); - } + $defaultValue = $this->getFileManager()->getContents( array($defaultPath, $type, $name.'.json') ); + if ($defaultValue !== false) { + //return default array + return Utils\Json::decode($defaultValue, true); + } - return array(); - } + return array(); + } } diff --git a/application/Espo/Core/Utils/File/ZipArchive.php b/application/Espo/Core/Utils/File/ZipArchive.php index 0c55578db0..46bb414d6c 100644 --- a/application/Espo/Core/Utils/File/ZipArchive.php +++ b/application/Espo/Core/Utils/File/ZipArchive.php @@ -26,56 +26,56 @@ use Espo\Core\Exceptions\Error; class ZipArchive { - private $fileManager; + private $fileManager; - public function __construct(Manager $fileManager = null) - { - if (!isset($fileManager)) { - $fileManager = new Manager(); - } + public function __construct(Manager $fileManager = null) + { + if (!isset($fileManager)) { + $fileManager = new Manager(); + } - $this->fileManager = $fileManager; - } + $this->fileManager = $fileManager; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - public function zip($sourcePath, $file) - { + public function zip($sourcePath, $file) + { - } + } - /** - * Unzip archive - * - * @param string $file Path to .zip file - * @param [type] $destinationPath - * @return bool - */ - public function unzip($file, $destinationPath) - { - if (!class_exists('\ZipArchive')) { - throw new Error("Class ZipArchive does not installed. Cannot unzip the file."); - } + /** + * Unzip archive + * + * @param string $file Path to .zip file + * @param [type] $destinationPath + * @return bool + */ + public function unzip($file, $destinationPath) + { + if (!class_exists('\ZipArchive')) { + throw new Error("Class ZipArchive does not installed. Cannot unzip the file."); + } - $zip = new \ZipArchive; - $res = $zip->open($file); + $zip = new \ZipArchive; + $res = $zip->open($file); - if ($res === TRUE) { + if ($res === TRUE) { - $this->getFileManager()->mkdir($destinationPath); + $this->getFileManager()->mkdir($destinationPath); - $zip->extractTo($destinationPath); - $zip->close(); + $zip->extractTo($destinationPath); + $zip->close(); - return true; - } + return true; + } - return false; - } + return false; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Json.php b/application/Espo/Core/Utils/Json.php index 340cb58d01..af4d1565e4 100644 --- a/application/Espo/Core/Utils/Json.php +++ b/application/Espo/Core/Utils/Json.php @@ -24,161 +24,161 @@ namespace Espo\Core\Utils; class Json { - /** - * JSON encode a string - * - * @param string $value - * @param int $options Default 0 - * @param int $depth Default 512 - * @return string - */ - public static function encode($value, $options = 0, $depth = 512) - { - if (version_compare(phpversion(), '5.5.0', '>=')) { - $json = json_encode($value, $options, $depth); - } - elseif (version_compare(phpversion(), '5.3.0', '>=')) { - /*Check if options are supported for this version of PHP*/ - if (is_int($options)) { - $json = json_encode($value, $options); - } - else { - $json = json_encode($value); - } - } - else { - $json = json_encode($value); - } + /** + * JSON encode a string + * + * @param string $value + * @param int $options Default 0 + * @param int $depth Default 512 + * @return string + */ + public static function encode($value, $options = 0, $depth = 512) + { + if (version_compare(phpversion(), '5.5.0', '>=')) { + $json = json_encode($value, $options, $depth); + } + elseif (version_compare(phpversion(), '5.3.0', '>=')) { + /*Check if options are supported for this version of PHP*/ + if (is_int($options)) { + $json = json_encode($value, $options); + } + else { + $json = json_encode($value); + } + } + else { + $json = json_encode($value); + } - $error = self::getLastError(); - if ($json === null || $error) { - $GLOBALS['log']->error('Json::encode():' . $error . ' - ' . print_r($value, true)); - } + $error = self::getLastError(); + if ($json === null || $error) { + $GLOBALS['log']->error('Json::encode():' . $error . ' - ' . print_r($value, true)); + } - return $json; - } + return $json; + } - /** - * JSON decode a string (Fixed problem with "\") - * - * @param string $json - * @param bool $assoc Default false - * @param int $depth Default 512 - * @param int $options Default 0 - * @return object - */ - public static function decode($json, $assoc = false, $depth = 512, $options = 0) - { - if (is_array($json)) { - $GLOBALS['log']->warning('Json::decode() - JSON cannot be decoded - '.$json); - return false; - } + /** + * JSON decode a string (Fixed problem with "\") + * + * @param string $json + * @param bool $assoc Default false + * @param int $depth Default 512 + * @param int $options Default 0 + * @return object + */ + public static function decode($json, $assoc = false, $depth = 512, $options = 0) + { + if (is_array($json)) { + $GLOBALS['log']->warning('Json::decode() - JSON cannot be decoded - '.$json); + return false; + } - if(version_compare(phpversion(), '5.4.0', '>=')) { - $json = json_decode($json, $assoc, $depth, $options); - } - elseif(version_compare(phpversion(), '5.3.0', '>=')) { - $json = json_decode($json, $assoc, $depth); - } - else { - $json = json_decode($json, $assoc); - } + if(version_compare(phpversion(), '5.4.0', '>=')) { + $json = json_decode($json, $assoc, $depth, $options); + } + elseif(version_compare(phpversion(), '5.3.0', '>=')) { + $json = json_decode($json, $assoc, $depth); + } + else { + $json = json_decode($json, $assoc); + } - $error = self::getLastError(); - if ($json === null || $error) { - $GLOBALS['log']->error('Json::decode():' . $error); - } + $error = self::getLastError(); + if ($json === null || $error) { + $GLOBALS['log']->error('Json::decode():' . $error); + } - return $json; - } + return $json; + } - /** - * Check if the string is JSON - * - * @param string $json - * @return bool - */ - public static function isJSON($json) - { - if ($json === '[]' || $json === '{}') { - return true; - } else if (is_array($json)) { - return false; - } + /** + * Check if the string is JSON + * + * @param string $json + * @return bool + */ + public static function isJSON($json) + { + if ($json === '[]' || $json === '{}') { + return true; + } else if (is_array($json)) { + return false; + } - return static::decode($json) != null; - } + return static::decode($json) != null; + } - /** - * Get an array data (if JSON convert to array) - * - * @param mixed $data - can be JSON, array - * - * @return array - */ - public static function getArrayData($data, $returns = array()) - { - if (is_array($data)) { - return $data; - } - else if (static::isJSON($data)) { - return static::decode($data, true); - } + /** + * Get an array data (if JSON convert to array) + * + * @param mixed $data - can be JSON, array + * + * @return array + */ + public static function getArrayData($data, $returns = array()) + { + if (is_array($data)) { + return $data; + } + else if (static::isJSON($data)) { + return static::decode($data, true); + } - return $returns; - } + return $returns; + } - protected static function getLastError($error = null) - { - if (!isset($error)) { - $error = json_last_error(); - } + protected static function getLastError($error = null) + { + if (!isset($error)) { + $error = json_last_error(); + } - switch ($error) { - case JSON_ERROR_NONE: - return false; - break; + switch ($error) { + case JSON_ERROR_NONE: + return false; + break; - case JSON_ERROR_DEPTH: - return 'The maximum stack depth has been exceeded'; - break; + case JSON_ERROR_DEPTH: + return 'The maximum stack depth has been exceeded'; + break; - case JSON_ERROR_STATE_MISMATCH: - return 'Invalid or malformed JSON'; - break; + case JSON_ERROR_STATE_MISMATCH: + return 'Invalid or malformed JSON'; + break; - case JSON_ERROR_CTRL_CHAR: - return 'Control character error, possibly incorrectly encoded'; - break; + case JSON_ERROR_CTRL_CHAR: + return 'Control character error, possibly incorrectly encoded'; + break; - case JSON_ERROR_SYNTAX: - return 'Syntax error, malformed JSON'; - break; + case JSON_ERROR_SYNTAX: + return 'Syntax error, malformed JSON'; + break; - case JSON_ERROR_UTF8: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - break; + case JSON_ERROR_UTF8: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + break; - /* Only for PHP 5.5.0 - case JSON_ERROR_RECURSION: - return 'One or more recursive references in the value to be encoded'; - break; - case JSON_ERROR_INF_OR_NAN: - return 'One or more NAN or INF values in the value to be encoded'; - break; - case JSON_ERROR_UNSUPPORTED_TYPE: - return 'A value of a type that cannot be encoded was given'; - break; - */ + /* Only for PHP 5.5.0 + case JSON_ERROR_RECURSION: + return 'One or more recursive references in the value to be encoded'; + break; + case JSON_ERROR_INF_OR_NAN: + return 'One or more NAN or INF values in the value to be encoded'; + break; + case JSON_ERROR_UNSUPPORTED_TYPE: + return 'A value of a type that cannot be encoded was given'; + break; + */ - default: - return 'Unknown error'; - break; - } - } + default: + return 'Unknown error'; + break; + } + } } diff --git a/application/Espo/Core/Utils/Language.php b/application/Espo/Core/Utils/Language.php index abe599192b..e89a29c163 100644 --- a/application/Espo/Core/Utils/Language.php +++ b/application/Espo/Core/Utils/Language.php @@ -23,251 +23,251 @@ namespace Espo\Core\Utils; use \Espo\Core\Utils\Util, - \Espo\Core\Exceptions\NotFound, - \Espo\Core\Exceptions\Error; + \Espo\Core\Exceptions\NotFound, + \Espo\Core\Exceptions\Error; class Language { - private $fileManager; - private $config; - private $preferences; - private $unifier; + private $fileManager; + private $config; + private $preferences; + private $unifier; - private $data = null; + private $data = null; - private $name = 'i18n'; + private $name = 'i18n'; - private $currentLanguage = null; + private $currentLanguage = null; - protected $cacheFile = 'data/cache/application/languages/{*}.php'; + protected $cacheFile = 'data/cache/application/languages/{*}.php'; - protected $defaultLanguage = 'en_US'; + protected $defaultLanguage = 'en_US'; - /** + /** * @var array */ - private $paths = array( - 'corePath' => 'application/Espo/Resources/i18n', - 'modulePath' => 'application/Espo/Modules/{*}/Resources/i18n', - 'customPath' => 'custom/Espo/Custom/Resources/i18n', - ); + private $paths = array( + 'corePath' => 'application/Espo/Resources/i18n', + 'modulePath' => 'application/Espo/Modules/{*}/Resources/i18n', + 'customPath' => 'custom/Espo/Custom/Resources/i18n', + ); - public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Config $config, \Espo\Entities\Preferences $preferences = null) - { - $this->fileManager = $fileManager; - $this->config = $config; - $this->preferences = $preferences; + public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Config $config, \Espo\Entities\Preferences $preferences = null) + { + $this->fileManager = $fileManager; + $this->config = $config; + $this->preferences = $preferences; - $this->unifier = new \Espo\Core\Utils\File\Unifier($this->fileManager); - } + $this->unifier = new \Espo\Core\Utils\File\Unifier($this->fileManager); + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - protected function getPreferences() - { - return $this->preferences; - } + protected function getPreferences() + { + return $this->preferences; + } - protected function getUnifier() - { - return $this->unifier; - } + protected function getUnifier() + { + return $this->unifier; + } - public function getLanguage() - { - if (!isset($this->currentLanguage) && isset($this->preferences)) { - $this->currentLanguage = $this->getPreferences()->get('language'); - } + public function getLanguage() + { + if (!isset($this->currentLanguage) && isset($this->preferences)) { + $this->currentLanguage = $this->getPreferences()->get('language'); + } - if (empty($this->currentLanguage)) { - $this->currentLanguage = $this->getConfig()->get('language'); - } + if (empty($this->currentLanguage)) { + $this->currentLanguage = $this->getConfig()->get('language'); + } - return $this->currentLanguage; - } + return $this->currentLanguage; + } - public function setLanguage($language) - { - $this->currentLanguage = $language; - } + public function setLanguage($language) + { + $this->currentLanguage = $language; + } - protected function getLangCacheFile() - { - $langCacheFile = str_replace('{*}', $this->getLanguage(), $this->cacheFile); + protected function getLangCacheFile() + { + $langCacheFile = str_replace('{*}', $this->getLanguage(), $this->cacheFile); - return $langCacheFile; - } + return $langCacheFile; + } - /** - * Translate label/labels - * - * @param string $label name of label - * @param string $category - * @param string $scope - * @param array $requiredOptions List of required options. - * Ex., $requiredOptions = array('en_US', 'de_DE') - * "language" option has only array('en_US' => 'English (United States)',) - * Result will be array('en_US' => 'English (United States)', 'de_DE' => 'de_DE',) - * @return string | array - */ - public function translate($label, $category = 'labels', $scope = 'Global', $requiredOptions = null) - { - if (is_array($label)) { - $translated = array(); + /** + * Translate label/labels + * + * @param string $label name of label + * @param string $category + * @param string $scope + * @param array $requiredOptions List of required options. + * Ex., $requiredOptions = array('en_US', 'de_DE') + * "language" option has only array('en_US' => 'English (United States)',) + * Result will be array('en_US' => 'English (United States)', 'de_DE' => 'de_DE',) + * @return string | array + */ + public function translate($label, $category = 'labels', $scope = 'Global', $requiredOptions = null) + { + if (is_array($label)) { + $translated = array(); - foreach ($label as $subLabel) { - $translated[$subLabel] = $this->translate($subLabel, $category, $scope, $requiredOptions); - } + foreach ($label as $subLabel) { + $translated[$subLabel] = $this->translate($subLabel, $category, $scope, $requiredOptions); + } - return $translated; - } + return $translated; + } - $key = $scope.'.'.$category.'.'.$label; - $translated = $this->get($key); + $key = $scope.'.'.$category.'.'.$label; + $translated = $this->get($key); - if (!isset($translated)) { - $key = 'Global.'.$category.'.'.$label; - $translated = $this->get($key, $label); - } + if (!isset($translated)) { + $key = 'Global.'.$category.'.'.$label; + $translated = $this->get($key, $label); + } - if (is_array($translated) && isset($requiredOptions)) { + if (is_array($translated) && isset($requiredOptions)) { - $translated = array_intersect_key($translated, array_flip($requiredOptions)); + $translated = array_intersect_key($translated, array_flip($requiredOptions)); - $optionKeys = array_keys($translated); - foreach ($requiredOptions as $option) { - if (!in_array($option, $optionKeys)) { - $translated[$option] = $option; - } - } - } + $optionKeys = array_keys($translated); + foreach ($requiredOptions as $option) { + if (!in_array($option, $optionKeys)) { + $translated[$option] = $option; + } + } + } - return $translated; - } + return $translated; + } - public function translateOption($value, $field, $scope) - { - $options = $this->get($scope. '.options.' . $field); - if (array_key_exists($value, $options)) { - return $options[$value]; - } - return $value; - } + public function translateOption($value, $field, $scope) + { + $options = $this->get($scope. '.options.' . $field); + if (array_key_exists($value, $options)) { + return $options[$value]; + } + return $value; + } - public function get($key = null, $returns = null) - { - $data = $this->getData(); + public function get($key = null, $returns = null) + { + $data = $this->getData(); - if (!isset($data) || $data === false) { - throw new Error('Language: current language ['.$this->getLanguage().'] does not found'); - } + if (!isset($data) || $data === false) { + throw new Error('Language: current language ['.$this->getLanguage().'] does not found'); + } - return Util::getValueByKey($data, $key, $returns); - } + return Util::getValueByKey($data, $key, $returns); + } - public function getAll() - { - return $this->get(); - } + public function getAll() + { + return $this->get(); + } - /** - * Get data of Unifier language files - * - * @return array - */ - protected function getData() - { - if (!isset($this->data)) { - $this->init(); - } + /** + * Get data of Unifier language files + * + * @return array + */ + protected function getData() + { + if (!isset($this->data)) { + $this->init(); + } - return $this->data; - } + return $this->data; + } - public function set($label, $value, $category = 'labels', $scope = 'Global') - { - $path = $this->paths['customPath']; - $currentLanguage = $this->getLanguage(); + public function set($label, $value, $category = 'labels', $scope = 'Global') + { + $path = $this->paths['customPath']; + $currentLanguage = $this->getLanguage(); - $data = $this->normalizeDefs($label, $value, $category); + $data = $this->normalizeDefs($label, $value, $category); - $result = $this->getFileManager()->mergeContents(array($path, $currentLanguage, $scope.'.json'), $data, true); - if ($result === false) { - throw new Error("Error saving languages. See log file for details."); - } + $result = $this->getFileManager()->mergeContents(array($path, $currentLanguage, $scope.'.json'), $data, true); + if ($result === false) { + throw new Error("Error saving languages. See log file for details."); + } - $this->init(true); + $this->init(true); return $result; - } + } - public function delete($label, $category = 'labels', $scope = 'Global') - { - $path = $this->paths['customPath']; - $currentLanguage = $this->getLanguage(); + public function delete($label, $category = 'labels', $scope = 'Global') + { + $path = $this->paths['customPath']; + $currentLanguage = $this->getLanguage(); - $unsets = array( - $category => $label, - ); + $unsets = array( + $category => $label, + ); - $result = $this->getFileManager()->unsetContents(array($path, $currentLanguage, $scope.'.json'), $unsets, true); + $result = $this->getFileManager()->unsetContents(array($path, $currentLanguage, $scope.'.json'), $unsets, true); - $this->init(true); + $this->init(true); - return $result; - } + return $result; + } - protected function init($reload = false) - { - if ($reload || !file_exists($this->getLangCacheFile()) || !$this->getConfig()->get('useCache')) { - $this->fullData = $this->getUnifier()->unify($this->name, $this->paths, true); + protected function init($reload = false) + { + if ($reload || !file_exists($this->getLangCacheFile()) || !$this->getConfig()->get('useCache')) { + $this->fullData = $this->getUnifier()->unify($this->name, $this->paths, true); - $result = true; - foreach ($this->fullData as $i18nName => $i18nData) { - $i18nCacheFile = str_replace('{*}', $i18nName, $this->cacheFile); + $result = true; + foreach ($this->fullData as $i18nName => $i18nData) { + $i18nCacheFile = str_replace('{*}', $i18nName, $this->cacheFile); - if ($i18nName != $this->defaultLanguage) { - $i18nData = Util::merge($this->fullData[$this->defaultLanguage], $i18nData); - } - $result &= $this->getFileManager()->putContentsPHP($i18nCacheFile, $i18nData); - } + if ($i18nName != $this->defaultLanguage) { + $i18nData = Util::merge($this->fullData[$this->defaultLanguage], $i18nData); + } + $result &= $this->getFileManager()->putContentsPHP($i18nCacheFile, $i18nData); + } - if ($result == false) { - throw new Error('Language::init() - Cannot save data to a cache'); - } - } + if ($result == false) { + throw new Error('Language::init() - Cannot save data to a cache'); + } + } - $this->data = $this->getFileManager()->getContents($this->getLangCacheFile()); - } + $this->data = $this->getFileManager()->getContents($this->getLangCacheFile()); + } - protected function normalizeDefs($label, $value, $category) - { - if (!is_array($label)) { - $label = array( - $label => $value, - ); - } + protected function normalizeDefs($label, $value, $category) + { + if (!is_array($label)) { + $label = array( + $label => $value, + ); + } - $data = array( - $category => $label, - ); + $data = array( + $category => $label, + ); - return $data; - } + return $data; + } diff --git a/application/Espo/Core/Utils/Layout.php b/application/Espo/Core/Utils/Layout.php index 07c78e323e..b839990244 100644 --- a/application/Espo/Core/Utils/Layout.php +++ b/application/Espo/Core/Utils/Layout.php @@ -24,150 +24,150 @@ namespace Espo\Core\Utils; class Layout { - private $fileManager; - private $metadata; - - /** + private $fileManager; + private $metadata; + + /** * @var string - uses for loading default values */ - private $name = 'layout'; + private $name = 'layout'; - protected $params = array( - 'defaultsPath' => 'application/Espo/Core/defaults', - ); + protected $params = array( + 'defaultsPath' => 'application/Espo/Core/defaults', + ); - /** + /** * @var array - path to layout files */ - private $paths = array( - 'corePath' => 'application/Espo/Resources/layouts', - 'modulePath' => 'application/Espo/Modules/{*}/Resources/layouts', - 'customPath' => 'custom/Espo/Custom/Resources/layouts', - ); - + private $paths = array( + 'corePath' => 'application/Espo/Resources/layouts', + 'modulePath' => 'application/Espo/Modules/{*}/Resources/layouts', + 'customPath' => 'custom/Espo/Custom/Resources/layouts', + ); + - public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Metadata $metadata) - { - $this->fileManager = $fileManager; - $this->metadata = $metadata; - } + public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Metadata $metadata) + { + $this->fileManager = $fileManager; + $this->metadata = $metadata; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - /** + /** * Get Layout context - * - * @param $controller - * @param $name - * - * @return json - */ - public function get($controller, $name) - { - $fileFullPath = Util::concatPath($this->getLayoutPath($controller, true), $name.'.json'); - if (!file_exists($fileFullPath)) { - $fileFullPath = Util::concatPath($this->getLayoutPath($controller), $name.'.json'); - } - - if (!file_exists($fileFullPath)) { - //load defaults - $defaultPath = $this->params['defaultsPath']; - $fileFullPath = Util::concatPath( Util::concatPath($defaultPath, $this->name), $name.'.json' ); - //END: load defaults - - if (!file_exists($fileFullPath)) { - return false; - } - } - - return $this->getFileManager()->getContents($fileFullPath); - } - - - /** - * Set Layout data - * Ex. $controller= Account, $name= detail then will be created a file layoutFolder/Account/detail.json * - * @param JSON string $data - * @param string $controller - ex. Account - * @param string $name - detail - * - * @return bool - */ - public function set($data, $controller, $name) - { - if (empty($controller) || empty($name)) { - return false; - } - - $layoutPath = $this->getLayoutPath($controller, true); - - if (!Json::isJSON($data)) { - $data = Json::encode($data); - } + * @param $controller + * @param $name + * + * @return json + */ + public function get($controller, $name) + { + $fileFullPath = Util::concatPath($this->getLayoutPath($controller, true), $name.'.json'); + if (!file_exists($fileFullPath)) { + $fileFullPath = Util::concatPath($this->getLayoutPath($controller), $name.'.json'); + } + + if (!file_exists($fileFullPath)) { + //load defaults + $defaultPath = $this->params['defaultsPath']; + $fileFullPath = Util::concatPath( Util::concatPath($defaultPath, $this->name), $name.'.json' ); + //END: load defaults + + if (!file_exists($fileFullPath)) { + return false; + } + } + + return $this->getFileManager()->getContents($fileFullPath); + } + + + /** + * Set Layout data + * Ex. $controller= Account, $name= detail then will be created a file layoutFolder/Account/detail.json + * + * @param JSON string $data + * @param string $controller - ex. Account + * @param string $name - detail + * + * @return bool + */ + public function set($data, $controller, $name) + { + if (empty($controller) || empty($name)) { + return false; + } + + $layoutPath = $this->getLayoutPath($controller, true); + + if (!Json::isJSON($data)) { + $data = Json::encode($data); + } return $this->getFileManager()->putContents(array($layoutPath, $name.'.json'), $data); - } + } - /** - * Merge layout data - * Ex. $controller= Account, $name= detail then will be created a file layoutFolder/Account/detail.json + /** + * Merge layout data + * Ex. $controller= Account, $name= detail then will be created a file layoutFolder/Account/detail.json * - * @param JSON string $data - * @param string $controller - ex. Account - * @param string $name - detail - * - * @return bool - */ - public function merge($data, $controller, $name) - { - $prevData = $this->get($controller, $name); - - $prevDataArray= Json::getArrayData($prevData); - $dataArray= Json::getArrayData($data); + * @param JSON string $data + * @param string $controller - ex. Account + * @param string $name - detail + * + * @return bool + */ + public function merge($data, $controller, $name) + { + $prevData = $this->get($controller, $name); + + $prevDataArray= Json::getArrayData($prevData); + $dataArray= Json::getArrayData($data); - $data= Util::merge($prevDataArray, $dataArray); - $data= Json::encode($data); + $data= Util::merge($prevDataArray, $dataArray); + $data= Json::encode($data); return $this->set($data, $controller, $name); - } + } /** * Get Layout path, ex. application/Modules/Crm/Layouts/Account * - * @param string $entityName - * @param bool $isCustom - if need to check custom folder - * - * @return string - */ - protected function getLayoutPath($entityName, $isCustom = false) - { - $path = $this->paths['customPath']; + * @param string $entityName + * @param bool $isCustom - if need to check custom folder + * + * @return string + */ + protected function getLayoutPath($entityName, $isCustom = false) + { + $path = $this->paths['customPath']; - if (!$isCustom) { - $moduleName = $this->getMetadata()->getScopeModuleName($entityName); - - $path = $this->paths['corePath']; - if ($moduleName !== false) { - $path = str_replace('{*}', $moduleName, $this->paths['modulePath']); - } - } - + if (!$isCustom) { + $moduleName = $this->getMetadata()->getScopeModuleName($entityName); + + $path = $this->paths['corePath']; + if ($moduleName !== false) { + $path = str_replace('{*}', $moduleName, $this->paths['modulePath']); + } + } + $path = Util::concatPath($path, $entityName); - return $path; - } + return $path; + } } diff --git a/application/Espo/Core/Utils/Log/Monolog/Handler/RotatingFileHandler.php b/application/Espo/Core/Utils/Log/Monolog/Handler/RotatingFileHandler.php index c9a48a507e..8fe6e9e220 100644 --- a/application/Espo/Core/Utils/Log/Monolog/Handler/RotatingFileHandler.php +++ b/application/Espo/Core/Utils/Log/Monolog/Handler/RotatingFileHandler.php @@ -26,92 +26,92 @@ use Monolog\Logger; class RotatingFileHandler extends StreamHandler { - /** - * Date format as a part of filename - * @var string - */ - protected $dateFormat = 'Y-m-d'; + /** + * Date format as a part of filename + * @var string + */ + protected $dateFormat = 'Y-m-d'; - /** - * Filename format - * @var string - */ - protected $filenameFormat = '{filename}-{date}'; + /** + * Filename format + * @var string + */ + protected $filenameFormat = '{filename}-{date}'; - protected $filename; + protected $filename; - protected $maxFiles; + protected $maxFiles; - public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true) - { - $this->filename = $filename; - $this->maxFiles = (int) $maxFiles; + public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true) + { + $this->filename = $filename; + $this->maxFiles = (int) $maxFiles; - parent::__construct($this->getTimedFilename(), $level, $bubble); + parent::__construct($this->getTimedFilename(), $level, $bubble); - $this->rotate(); - } + $this->rotate(); + } - public function setFilenameFormat($filenameFormat, $dateFormat) - { - $this->filenameFormat = $filenameFormat; - $this->dateFormat = $dateFormat; - } + public function setFilenameFormat($filenameFormat, $dateFormat) + { + $this->filenameFormat = $filenameFormat; + $this->dateFormat = $dateFormat; + } - protected function rotate() - { - if (0 === $this->maxFiles) { - return; //unlimited number of files for 0 - } + protected function rotate() + { + if (0 === $this->maxFiles) { + return; //unlimited number of files for 0 + } - $filePattern = $this->getFilePattern(); - $dirPath = $this->getFileManager()->getDirName($this->filename); - $logFiles = $this->getFileManager()->getFileList($dirPath, false, $filePattern, 'file'); + $filePattern = $this->getFilePattern(); + $dirPath = $this->getFileManager()->getDirName($this->filename); + $logFiles = $this->getFileManager()->getFileList($dirPath, false, $filePattern, 'file'); - if (!empty($logFiles) && count($logFiles) > $this->maxFiles) { + if (!empty($logFiles) && count($logFiles) > $this->maxFiles) { - usort($logFiles, function($a, $b) { - return strcmp($b, $a); - }); + usort($logFiles, function($a, $b) { + return strcmp($b, $a); + }); - $logFilesToBeRemoved = array_slice($logFiles, $this->maxFiles); + $logFilesToBeRemoved = array_slice($logFiles, $this->maxFiles); - $this->getFileManager()->removeFile($logFilesToBeRemoved, $dirPath); - } - } + $this->getFileManager()->removeFile($logFilesToBeRemoved, $dirPath); + } + } - protected function getTimedFilename() - { - $fileInfo = pathinfo($this->filename); - $timedFilename = str_replace( - array('{filename}', '{date}'), - array($fileInfo['filename'], date($this->dateFormat)), - $fileInfo['dirname'] . '/' . $this->filenameFormat - ); + protected function getTimedFilename() + { + $fileInfo = pathinfo($this->filename); + $timedFilename = str_replace( + array('{filename}', '{date}'), + array($fileInfo['filename'], date($this->dateFormat)), + $fileInfo['dirname'] . '/' . $this->filenameFormat + ); - if (!empty($fileInfo['extension'])) { - $timedFilename .= '.'.$fileInfo['extension']; - } + if (!empty($fileInfo['extension'])) { + $timedFilename .= '.'.$fileInfo['extension']; + } - return $timedFilename; - } + return $timedFilename; + } - protected function getFilePattern() - { - $fileInfo = pathinfo($this->filename); - $glob = str_replace( - array('{filename}', '{date}'), - array($fileInfo['filename'], '.*'), - $this->filenameFormat - ); + protected function getFilePattern() + { + $fileInfo = pathinfo($this->filename); + $glob = str_replace( + array('{filename}', '{date}'), + array($fileInfo['filename'], '.*'), + $this->filenameFormat + ); - if (!empty($fileInfo['extension'])) { - $glob .= '\.'.$fileInfo['extension']; - } + if (!empty($fileInfo['extension'])) { + $glob .= '\.'.$fileInfo['extension']; + } - $glob = '^'.$glob.'$'; + $glob = '^'.$glob.'$'; - return $glob; - } + return $glob; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Log/Monolog/Handler/StreamHandler.php b/application/Espo/Core/Utils/Log/Monolog/Handler/StreamHandler.php index e611a7be49..6052c7af99 100644 --- a/application/Espo/Core/Utils/Log/Monolog/Handler/StreamHandler.php +++ b/application/Espo/Core/Utils/Log/Monolog/Handler/StreamHandler.php @@ -26,61 +26,61 @@ use Monolog\Logger; class StreamHandler extends \Monolog\Handler\StreamHandler { - protected $fileManager; + protected $fileManager; - protected $maxErrorMessageLength = 5000; + protected $maxErrorMessageLength = 5000; - public function __construct($url, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($url, $level, $bubble); + public function __construct($url, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($url, $level, $bubble); - $this->fileManager = new \Espo\Core\Utils\File\Manager(); - } + $this->fileManager = new \Espo\Core\Utils\File\Manager(); + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - protected function write(array $record) - { - if (!$this->url) { - throw new \LogicException('Missing logger path, the stream can not be opened. Please check logger options in the data/config.php.'); - } + protected function write(array $record) + { + if (!$this->url) { + throw new \LogicException('Missing logger path, the stream can not be opened. Please check logger options in the data/config.php.'); + } - $this->errorMessage = null; + $this->errorMessage = null; - set_error_handler(array($this, 'customErrorHandler')); - $this->getFileManager()->appendContents($this->url, $this->pruneMessage($record)); - restore_error_handler(); + set_error_handler(array($this, 'customErrorHandler')); + $this->getFileManager()->appendContents($this->url, $this->pruneMessage($record)); + restore_error_handler(); - if (isset($this->errorMessage)) { - throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url)); - } - } + if (isset($this->errorMessage)) { + throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url)); + } + } - private function customErrorHandler($code, $msg) - { - $this->errorMessage = $msg; - } + private function customErrorHandler($code, $msg) + { + $this->errorMessage = $msg; + } - /** - * Cut the error message depends on maxErrorMessageLength - * - * @param array $record - * @return string - */ - protected function pruneMessage(array $record) - { - $message = (string) $record['message']; + /** + * Cut the error message depends on maxErrorMessageLength + * + * @param array $record + * @return string + */ + protected function pruneMessage(array $record) + { + $message = (string) $record['message']; - if (strlen($message) > $this->maxErrorMessageLength) { - $record['message'] = substr($message, 0, $this->maxErrorMessageLength) . '...'; - $record['formatted'] = $this->getFormatter()->format($record); - } + if (strlen($message) > $this->maxErrorMessageLength) { + $record['message'] = substr($message, 0, $this->maxErrorMessageLength) . '...'; + $record['formatted'] = $this->getFormatter()->format($record); + } - return (string) $record['formatted']; - } + return (string) $record['formatted']; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Log/Monolog/Logger.php b/application/Espo/Core/Utils/Log/Monolog/Logger.php index d11badc768..a382f7634b 100644 --- a/application/Espo/Core/Utils/Log/Monolog/Logger.php +++ b/application/Espo/Core/Utils/Log/Monolog/Logger.php @@ -24,25 +24,25 @@ namespace Espo\Core\Utils\Log\Monolog; class Logger extends \Monolog\Logger { - protected $defaultLevelName = 'DEBUG'; + protected $defaultLevelName = 'DEBUG'; - /** - * Get Level Code - * @param string $level Ex. DEBUG, ... - * @return int - */ - public function getLevelCode($levelName) + /** + * Get Level Code + * @param string $level Ex. DEBUG, ... + * @return int + */ + public function getLevelCode($levelName) { - $levelName = strtoupper($levelName); + $levelName = strtoupper($levelName); - $levels = $this->getLevels(); + $levels = $this->getLevels(); - if (isset($levels[$levelName])) { - return $levels[$levelName]; - } + if (isset($levels[$levelName])) { + return $levels[$levelName]; + } - return $levels[$this->defaultLevelName]; + return $levels[$this->defaultLevelName]; } diff --git a/application/Espo/Core/Utils/Metadata.php b/application/Espo/Core/Utils/Metadata.php index 06acc37400..12b73e1c0b 100644 --- a/application/Espo/Core/Utils/Metadata.php +++ b/application/Espo/Core/Utils/Metadata.php @@ -26,408 +26,408 @@ use Espo\Core\Exceptions\Error; class Metadata { - protected $meta = null; + protected $meta = null; - protected $scopes = array(); + protected $scopes = array(); - private $config; - private $unifier; - private $fileManager; - private $converter; + private $config; + private $unifier; + private $fileManager; + private $converter; - /** - * @var string - uses for loading default values - */ - private $name = 'metadata'; + /** + * @var string - uses for loading default values + */ + private $name = 'metadata'; - private $cacheFile = 'data/cache/application/metadata.php'; + private $cacheFile = 'data/cache/application/metadata.php'; - private $paths = array( - 'corePath' => 'application/Espo/Resources/metadata', - 'modulePath' => 'application/Espo/Modules/{*}/Resources/metadata', - 'customPath' => 'custom/Espo/Custom/Resources/metadata', - ); + private $paths = array( + 'corePath' => 'application/Espo/Resources/metadata', + 'modulePath' => 'application/Espo/Modules/{*}/Resources/metadata', + 'customPath' => 'custom/Espo/Custom/Resources/metadata', + ); - protected $ormMeta = null; + protected $ormMeta = null; - private $ormCacheFile = 'data/cache/application/ormMetadata.php'; + private $ormCacheFile = 'data/cache/application/ormMetadata.php'; - private $moduleList = null; + private $moduleList = null; - public function __construct(\Espo\Core\Utils\Config $config, \Espo\Core\Utils\File\Manager $fileManager) - { - $this->config = $config; - $this->fileManager = $fileManager; + public function __construct(\Espo\Core\Utils\Config $config, \Espo\Core\Utils\File\Manager $fileManager) + { + $this->config = $config; + $this->fileManager = $fileManager; - $this->unifier = new \Espo\Core\Utils\File\Unifier($this->fileManager); + $this->unifier = new \Espo\Core\Utils\File\Unifier($this->fileManager); - $this->converter = new \Espo\Core\Utils\Database\Converter($this, $this->fileManager); + $this->converter = new \Espo\Core\Utils\Database\Converter($this, $this->fileManager); - $this->init(!$this->isCached()); - } + $this->init(!$this->isCached()); + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - protected function getUnifier() - { - return $this->unifier; - } + protected function getUnifier() + { + return $this->unifier; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - protected function getConverter() - { - return $this->converter; - } + protected function getConverter() + { + return $this->converter; + } - public function isCached() - { - if (!$this->getConfig()->get('useCache')) { - return false; - } + public function isCached() + { + if (!$this->getConfig()->get('useCache')) { + return false; + } - if (file_exists($this->cacheFile)) { - return true; - } + if (file_exists($this->cacheFile)) { + return true; + } - return false; - } + return false; + } - public function init($reload = false) - { - $data = $this->getMetadataOnly(false, $reload); - if ($data === false) { - $GLOBALS['log']->emergency('Metadata:init() - metadata has not been created'); - } + public function init($reload = false) + { + $data = $this->getMetadataOnly(false, $reload); + if ($data === false) { + $GLOBALS['log']->emergency('Metadata:init() - metadata has not been created'); + } - $this->meta = $data; + $this->meta = $data; - if ($reload) { - //save medatada to a cache file - $isSaved = $this->getFileManager()->putContentsPHP($this->cacheFile, $data); - if ($isSaved === false) { - $GLOBALS['log']->emergency('Metadata:init() - metadata has not been saved to a cache file'); - } - } - } + if ($reload) { + //save medatada to a cache file + $isSaved = $this->getFileManager()->putContentsPHP($this->cacheFile, $data); + if ($isSaved === false) { + $GLOBALS['log']->emergency('Metadata:init() - metadata has not been saved to a cache file'); + } + } + } - /** - * Get unified metadata - * - * @return array - */ - protected function getData() - { - if (!isset($this->meta)) { - $this->init(); - } + /** + * Get unified metadata + * + * @return array + */ + protected function getData() + { + if (!isset($this->meta)) { + $this->init(); + } - return $this->meta; - } + return $this->meta; + } - /** - * Get Metadata - * - * @param string $key - * @param mixed $default - * - * @return array - */ - public function get($key = null, $default = null) - { - return Util::getValueByKey($this->getData(), $key, $default); - } + /** + * Get Metadata + * + * @param string $key + * @param mixed $default + * + * @return array + */ + public function get($key = null, $default = null) + { + return Util::getValueByKey($this->getData(), $key, $default); + } - /** - * Get All Metadata context - * - * @param $isJSON - * @param bool $reload - * - * @return json | array - */ - public function getAll($isJSON = false, $reload = false) - { - if ($reload) { - $this->init(); - } + /** + * Get All Metadata context + * + * @param $isJSON + * @param bool $reload + * + * @return json | array + */ + public function getAll($isJSON = false, $reload = false) + { + if ($reload) { + $this->init(); + } - if ($isJSON) { - return Json::encode($this->meta); - } - return $this->meta; - } + if ($isJSON) { + return Json::encode($this->meta); + } + return $this->meta; + } - /** - * Get Metadata only without saving it to the a file and database sync - * - * @param $isJSON - * @param bool $reload - * - * @return json | array - */ - public function getMetadataOnly($isJSON = true, $reload = false) - { - $data = false; - if (!file_exists($this->cacheFile) || $reload) { - $data = $this->getUnifier()->unify($this->name, $this->paths, true); + /** + * Get Metadata only without saving it to the a file and database sync + * + * @param $isJSON + * @param bool $reload + * + * @return json | array + */ + public function getMetadataOnly($isJSON = true, $reload = false) + { + $data = false; + if (!file_exists($this->cacheFile) || $reload) { + $data = $this->getUnifier()->unify($this->name, $this->paths, true); - if ($data === false) { - $GLOBALS['log']->emergency('Metadata:getMetadata() - metadata unite file cannot be created'); - } + if ($data === false) { + $GLOBALS['log']->emergency('Metadata:getMetadata() - metadata unite file cannot be created'); + } - $data = $this->setLanguageFromConfig($data); - } - else if (file_exists($this->cacheFile)) { - $data = $this->getFileManager()->getContents($this->cacheFile); - } + $data = $this->setLanguageFromConfig($data); + } + else if (file_exists($this->cacheFile)) { + $data = $this->getFileManager()->getContents($this->cacheFile); + } - if ($isJSON) { - $data = Json::encode($data); - } + if ($isJSON) { + $data = Json::encode($data); + } - return $data; - } + return $data; + } - /** - * Set language list and default for Settings, Preferences metadata - * - * @param array $data Meta - * @return array $data - */ - protected function setLanguageFromConfig($data) - { - $entityList = array( - 'Settings', - 'Preferences', - ); + /** + * Set language list and default for Settings, Preferences metadata + * + * @param array $data Meta + * @return array $data + */ + protected function setLanguageFromConfig($data) + { + $entityList = array( + 'Settings', + 'Preferences', + ); - $languageList = $this->getConfig()->get('languageList'); - $language = $this->getConfig()->get('language'); + $languageList = $this->getConfig()->get('languageList'); + $language = $this->getConfig()->get('language'); - foreach ($entityList as $entityName) { - if (isset($data['entityDefs'][$entityName]['fields']['language'])) { - $data['entityDefs'][$entityName]['fields']['language']['options'] = $languageList; - $data['entityDefs'][$entityName]['fields']['language']['default'] = $language; - } - } + foreach ($entityList as $entityName) { + if (isset($data['entityDefs'][$entityName]['fields']['language'])) { + $data['entityDefs'][$entityName]['fields']['language']['options'] = $languageList; + $data['entityDefs'][$entityName]['fields']['language']['default'] = $language; + } + } - return $data; - } + return $data; + } - /** - * Set Metadata data - * Ex. $type= menu, $scope= Account then will be created a file metadataFolder/menu/Account.json - * - * @param JSON string $data - * @param string $type - ex. menu - * @param string $scope - Account - * - * @return bool - */ - public function set($data, $type, $scope) - { - $path = $this->paths['customPath']; + /** + * Set Metadata data + * Ex. $type= menu, $scope= Account then will be created a file metadataFolder/menu/Account.json + * + * @param JSON string $data + * @param string $type - ex. menu + * @param string $scope - Account + * + * @return bool + */ + public function set($data, $type, $scope) + { + $path = $this->paths['customPath']; - $result = $this->getFileManager()->mergeContents(array($path, $type, $scope.'.json'), $data, true); - if ($result === false) { - throw new Error("Error saving metadata. See log file for details."); - } + $result = $this->getFileManager()->mergeContents(array($path, $type, $scope.'.json'), $data, true); + if ($result === false) { + throw new Error("Error saving metadata. See log file for details."); + } - $this->init(true); + $this->init(true); return $result; - } + } - /** - * Unset some fields and other stuff in metadat - * - * @param array | string $unsets Ex. 'fields.name' - * @param string $type Ex. 'entityDefs' - * @param string $scope - * @return bool - */ - public function delete($unsets, $type, $scope) - { - $path = $this->paths['customPath']; + /** + * Unset some fields and other stuff in metadat + * + * @param array | string $unsets Ex. 'fields.name' + * @param string $type Ex. 'entityDefs' + * @param string $scope + * @return bool + */ + public function delete($unsets, $type, $scope) + { + $path = $this->paths['customPath']; - $result = $this->getFileManager()->unsetContents(array($path, $type, $scope.'.json'), $unsets, true); + $result = $this->getFileManager()->unsetContents(array($path, $type, $scope.'.json'), $unsets, true); - if ($result == false) { - $GLOBALS['log']->warning('Delete metadata items available only for custom code.'); - } + if ($result == false) { + $GLOBALS['log']->warning('Delete metadata items available only for custom code.'); + } - $this->init(true); + $this->init(true); - return $result; - } + return $result; + } - public function getOrmMetadata($reload = false) - { - if (!empty($this->ormMeta) && !$reload) { - return $this->ormMeta; - } + public function getOrmMetadata($reload = false) + { + if (!empty($this->ormMeta) && !$reload) { + return $this->ormMeta; + } - if (!file_exists($this->ormCacheFile) || !$this->getConfig()->get('useCache') || $reload) { - $this->getConverter()->process(); - } + if (!file_exists($this->ormCacheFile) || !$this->getConfig()->get('useCache') || $reload) { + $this->getConverter()->process(); + } - $this->ormMeta = $this->getFileManager()->getContents($this->ormCacheFile); + $this->ormMeta = $this->getFileManager()->getContents($this->ormCacheFile); - return $this->ormMeta; - } + return $this->ormMeta; + } - public function setOrmMetadata(array $ormMeta) - { - $result = $this->getFileManager()->putContentsPHP($this->ormCacheFile, $ormMeta); - if ($result == false) { - throw new \Espo\Core\Exceptions\Error('Metadata::setOrmMetadata() - Cannot save ormMetadata to a file'); - } + public function setOrmMetadata(array $ormMeta) + { + $result = $this->getFileManager()->putContentsPHP($this->ormCacheFile, $ormMeta); + if ($result == false) { + throw new \Espo\Core\Exceptions\Error('Metadata::setOrmMetadata() - Cannot save ormMetadata to a file'); + } - $this->ormMeta = $ormMeta; + $this->ormMeta = $ormMeta; - return $result; - } + return $result; + } - /** - * Get Entity path, ex. Espo.Entities.Account or Modules\Crm\Entities\MyModule - * - * @param string $entityName - * @param bool $delim - delimiter - * - * @return string - */ - public function getEntityPath($entityName, $delim = '\\') - { - $path = $this->getScopePath($entityName, $delim); + /** + * Get Entity path, ex. Espo.Entities.Account or Modules\Crm\Entities\MyModule + * + * @param string $entityName + * @param bool $delim - delimiter + * + * @return string + */ + public function getEntityPath($entityName, $delim = '\\') + { + $path = $this->getScopePath($entityName, $delim); - return implode($delim, array($path, 'Entities', Util::normilizeClassName(ucfirst($entityName)))); - } + return implode($delim, array($path, 'Entities', Util::normilizeClassName(ucfirst($entityName)))); + } - public function getRepositoryPath($entityName, $delim = '\\') - { - $path = $this->getScopePath($entityName, $delim); + public function getRepositoryPath($entityName, $delim = '\\') + { + $path = $this->getScopePath($entityName, $delim); - return implode($delim, array($path, 'Repositories', Util::normilizeClassName(ucfirst($entityName)))); - } + return implode($delim, array($path, 'Repositories', Util::normilizeClassName(ucfirst($entityName)))); + } - /** - * Get Scopes - * - * @return array - */ - public function getScopes() - { - if (!empty($this->scopes)) { - return $this->scopes; - } + /** + * Get Scopes + * + * @return array + */ + public function getScopes() + { + if (!empty($this->scopes)) { + return $this->scopes; + } - $metadata = $this->getMetadataOnly(false); + $metadata = $this->getMetadataOnly(false); - $scopes = array(); - foreach ($metadata['scopes'] as $name => $details) { - $scopes[$name] = isset($details['module']) ? $details['module'] : false; - } + $scopes = array(); + foreach ($metadata['scopes'] as $name => $details) { + $scopes[$name] = isset($details['module']) ? $details['module'] : false; + } - return $this->scopes = $scopes; - } + return $this->scopes = $scopes; + } - /** - * Get Module List - * - * @return array - */ - public function getModuleList() - { - if (is_null($this->moduleList)) { - $this->moduleList = array(); - $scopes = $this->getScopes(); + /** + * Get Module List + * + * @return array + */ + public function getModuleList() + { + if (is_null($this->moduleList)) { + $this->moduleList = array(); + $scopes = $this->getScopes(); - // TODO order - foreach ($scopes as $moduleName) { - if (!empty($moduleName)) { - if (!in_array($moduleName, $this->moduleList)) { - $this->moduleList[] = $moduleName; - } - } - } - } - return $this->moduleList; - } + // TODO order + foreach ($scopes as $moduleName) { + if (!empty($moduleName)) { + if (!in_array($moduleName, $this->moduleList)) { + $this->moduleList[] = $moduleName; + } + } + } + } + return $this->moduleList; + } - /** - * Get module name if it's a custom module or empty string for core entity - * - * @param string $scopeName - * - * @return string - */ - public function getScopeModuleName($scopeName) - { - return $this->get('scopes.' . $scopeName . '.module', false); - } + /** + * Get module name if it's a custom module or empty string for core entity + * + * @param string $scopeName + * + * @return string + */ + public function getScopeModuleName($scopeName) + { + return $this->get('scopes.' . $scopeName . '.module', false); + } - /** - * Get Scope path, ex. "Modules/Crm" for Account - * - * @param string $scopeName - * @param string $delim - delimiter - * - * @return string - */ - public function getScopePath($scopeName, $delim = '/') - { - $moduleName = $this->getScopeModuleName($scopeName); + /** + * Get Scope path, ex. "Modules/Crm" for Account + * + * @param string $scopeName + * @param string $delim - delimiter + * + * @return string + */ + public function getScopePath($scopeName, $delim = '/') + { + $moduleName = $this->getScopeModuleName($scopeName); - $path = ($moduleName !== false) ? 'Espo/Modules/'.$moduleName : 'Espo'; + $path = ($moduleName !== false) ? 'Espo/Modules/'.$moduleName : 'Espo'; - if ($delim != '/') { - $path = str_replace('/', $delim, $path); - } + if ($delim != '/') { + $path = str_replace('/', $delim, $path); + } - return $path; - } + return $path; + } - /** - * Check if scope exists - * - * @param string $scopeName - * - * @return bool - */ - public function isScopeExists($scopeName) - { - $scopeModuleMap= $this->getScopes(); + /** + * Check if scope exists + * + * @param string $scopeName + * + * @return bool + */ + public function isScopeExists($scopeName) + { + $scopeModuleMap= $this->getScopes(); - $lowerEntityName= strtolower($scopeName); - foreach($scopeModuleMap as $rowEntityName => $rowModuleName) { - if ($lowerEntityName == strtolower($rowEntityName)) { - return true; - } - } + $lowerEntityName= strtolower($scopeName); + foreach($scopeModuleMap as $rowEntityName => $rowModuleName) { + if ($lowerEntityName == strtolower($rowEntityName)) { + return true; + } + } - return false; - } + return false; + } } diff --git a/application/Espo/Core/Utils/Metadata/Utils.php b/application/Espo/Core/Utils/Metadata/Utils.php index 7c30046aa8..3d65781c40 100644 --- a/application/Espo/Core/Utils/Metadata/Utils.php +++ b/application/Espo/Core/Utils/Metadata/Utils.php @@ -24,83 +24,83 @@ namespace Espo\Core\Utils\Metadata; class Utils { - private $metadata; + private $metadata; - public function __construct(\Espo\Core\Utils\Metadata $metadata) - { - $this->metadata = $metadata; - } + public function __construct(\Espo\Core\Utils\Metadata $metadata) + { + $this->metadata = $metadata; + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - /** - * Get field defenition by type in metadata, "fields" key - * - * @param array | string $fieldDef - It can be a string or field defenition from entityDefs - * @return array | null - */ - public function getFieldDefsByType($fieldDef) - { - if (is_string($fieldDef)) { - $fieldDef = array('type' => $fieldDef); - } + /** + * Get field defenition by type in metadata, "fields" key + * + * @param array | string $fieldDef - It can be a string or field defenition from entityDefs + * @return array | null + */ + public function getFieldDefsByType($fieldDef) + { + if (is_string($fieldDef)) { + $fieldDef = array('type' => $fieldDef); + } - if (isset($fieldDef['dbType'])) { - return $this->getMetadata()->get('fields.'.$fieldDef['dbType']); - } else if (isset($fieldDef['type'])) { - return $this->getMetadata()->get('fields.'.$fieldDef['type']); - } + if (isset($fieldDef['dbType'])) { + return $this->getMetadata()->get('fields.'.$fieldDef['dbType']); + } else if (isset($fieldDef['type'])) { + return $this->getMetadata()->get('fields.'.$fieldDef['type']); + } - return null; - } + return null; + } - public function getFieldDefsInFieldMeta($fieldDef) - { - $fieldDefsByType = $this->getFieldDefsByType($fieldDef); - if (isset($fieldDefsByType['fieldDefs'])) { - return $fieldDefsByType['fieldDefs']; - } + public function getFieldDefsInFieldMeta($fieldDef) + { + $fieldDefsByType = $this->getFieldDefsByType($fieldDef); + if (isset($fieldDefsByType['fieldDefs'])) { + return $fieldDefsByType['fieldDefs']; + } - return null; - } + return null; + } - /** - * Get link definition defined in 'fields' metadata. In linkDefs can be used as value (e.g. "type": "hasChildren") and/or variables (e.g. "entityName":"{entity}"). Variables should be defined into fieldDefs (in 'entityDefs' metadata). - * - * @param string $entityName - * @param array $fieldDef - * @param array $linkFieldDefsByType - * @return array | null - */ - public function getLinkDefsInFieldMeta($entityName, $fieldDef, array $linkFieldDefsByType = null) - { - if (!isset($fieldDefsByType)) { - $fieldDefsByType = $this->getFieldDefsByType($fieldDef); - if (!isset($fieldDefsByType['linkDefs'])) { - return null; - } - $linkFieldDefsByType = $fieldDefsByType['linkDefs']; - } + /** + * Get link definition defined in 'fields' metadata. In linkDefs can be used as value (e.g. "type": "hasChildren") and/or variables (e.g. "entityName":"{entity}"). Variables should be defined into fieldDefs (in 'entityDefs' metadata). + * + * @param string $entityName + * @param array $fieldDef + * @param array $linkFieldDefsByType + * @return array | null + */ + public function getLinkDefsInFieldMeta($entityName, $fieldDef, array $linkFieldDefsByType = null) + { + if (!isset($fieldDefsByType)) { + $fieldDefsByType = $this->getFieldDefsByType($fieldDef); + if (!isset($fieldDefsByType['linkDefs'])) { + return null; + } + $linkFieldDefsByType = $fieldDefsByType['linkDefs']; + } - foreach ($linkFieldDefsByType as $paramName => &$paramValue) { - if (preg_match('/{(.*?)}/', $paramValue, $matches)) { - if (in_array($matches[1], array_keys($fieldDef))) { - $value = $fieldDef[$matches[1]]; - } else if (strtolower($matches[1]) == 'entity') { - $value = $entityName; - } + foreach ($linkFieldDefsByType as $paramName => &$paramValue) { + if (preg_match('/{(.*?)}/', $paramValue, $matches)) { + if (in_array($matches[1], array_keys($fieldDef))) { + $value = $fieldDef[$matches[1]]; + } else if (strtolower($matches[1]) == 'entity') { + $value = $entityName; + } - if (isset($value)) { - $paramValue = str_replace('{'.$matches[1].'}', $value, $paramValue); - } - } - } + if (isset($value)) { + $paramValue = str_replace('{'.$matches[1].'}', $value, $paramValue); + } + } + } - return $linkFieldDefsByType; - } + return $linkFieldDefsByType; + } } diff --git a/application/Espo/Core/Utils/PasswordHash.php b/application/Espo/Core/Utils/PasswordHash.php index 4317ed71d3..237d0763b8 100644 --- a/application/Espo/Core/Utils/PasswordHash.php +++ b/application/Espo/Core/Utils/PasswordHash.php @@ -26,80 +26,80 @@ use Espo\Core\Exceptions\Error; class PasswordHash { - private $config; + private $config; - /** - * Salt format of SHA-512 - * - * @var string - */ - private $saltFormat = '$6${0}$'; + /** + * Salt format of SHA-512 + * + * @var string + */ + private $saltFormat = '$6${0}$'; - public function __construct(Config $config) - { - $this->config = $config; - } + public function __construct(Config $config) + { + $this->config = $config; + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - /** - * Get hash of a pawword - * - * @param string $password - * @return string - */ - public function hash($password, $useMd5 = true) - { - $salt = $this->getSalt(); + /** + * Get hash of a pawword + * + * @param string $password + * @return string + */ + public function hash($password, $useMd5 = true) + { + $salt = $this->getSalt(); - if ($useMd5) { - $password = md5($password); - } + if ($useMd5) { + $password = md5($password); + } - $hash = crypt($password, $salt); - $hash = str_replace($salt, '', $hash); + $hash = crypt($password, $salt); + $hash = str_replace($salt, '', $hash); - return $hash; - } + return $hash; + } - /** - * Get a salt from config and normalize it - * - * @return string - */ - protected function getSalt() - { - $salt = $this->getConfig()->get('passwordSalt'); - if (!isset($salt)) { - throw new Error('Option "passwordSalt" does not exist in config.php'); - } + /** + * Get a salt from config and normalize it + * + * @return string + */ + protected function getSalt() + { + $salt = $this->getConfig()->get('passwordSalt'); + if (!isset($salt)) { + throw new Error('Option "passwordSalt" does not exist in config.php'); + } - $salt = $this->normalizeSalt($salt); + $salt = $this->normalizeSalt($salt); - return $salt; - } + return $salt; + } - /** - * Convert salt in format in accordance to $saltFormat - * - * @param string $salt - * @return string - */ - protected function normalizeSalt($salt) - { - return str_replace("{0}", $salt, $this->saltFormat); - } + /** + * Convert salt in format in accordance to $saltFormat + * + * @param string $salt + * @return string + */ + protected function normalizeSalt($salt) + { + return str_replace("{0}", $salt, $this->saltFormat); + } - /** - * Generate a new salt - * - * @return string - */ - public function generateSalt() - { - return substr(md5(uniqid()), 0, 16); - } + /** + * Generate a new salt + * + * @return string + */ + public function generateSalt() + { + return substr(md5(uniqid()), 0, 16); + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Route.php b/application/Espo/Core/Utils/Route.php index a6e736edee..b1b4a8d8e9 100644 --- a/application/Espo/Core/Utils/Route.php +++ b/application/Espo/Core/Utils/Route.php @@ -24,153 +24,153 @@ namespace Espo\Core\Utils; class Route { - protected $data = null; + protected $data = null; - private $fileManager; - private $config; - private $metadata; + private $fileManager; + private $config; + private $metadata; - protected $cacheFile = 'data/cache/application/routes.php'; + protected $cacheFile = 'data/cache/application/routes.php'; - protected $paths = array( - 'corePath' => 'application/Espo/Resources/routes.json', - 'modulePath' => 'application/Espo/Modules/{*}/Resources/routes.json', - 'customPath' => 'custom/Espo/Custom/Resources/routes.json', - ); + protected $paths = array( + 'corePath' => 'application/Espo/Resources/routes.json', + 'modulePath' => 'application/Espo/Modules/{*}/Resources/routes.json', + 'customPath' => 'custom/Espo/Custom/Resources/routes.json', + ); - public function __construct(Config $config, Metadata $metadata, File\Manager $fileManager) - { - $this->config = $config; - $this->metadata = $metadata; - $this->fileManager = $fileManager; - } + public function __construct(Config $config, Metadata $metadata, File\Manager $fileManager) + { + $this->config = $config; + $this->metadata = $metadata; + $this->fileManager = $fileManager; + } - protected function getConfig() - { - return $this->config; - } + protected function getConfig() + { + return $this->config; + } - protected function getFileManager() - { - return $this->fileManager; - } + protected function getFileManager() + { + return $this->fileManager; + } - protected function getMetadata() - { - return $this->metadata; - } + protected function getMetadata() + { + return $this->metadata; + } - public function get($key = '', $returns = null) - { - if (!isset($this->data)) { - $this->init(); - } - - if (empty($key)) { - return $this->data; + public function get($key = '', $returns = null) + { + if (!isset($this->data)) { + $this->init(); } - $keys = explode('.', $key); + if (empty($key)) { + return $this->data; + } - $lastRoute = $this->data; - foreach($keys as $keyName) { - if (isset($lastRoute[$keyName]) && is_array($lastRoute)) { - $lastRoute = $lastRoute[$keyName]; - } else { - return $returns; - } - } + $keys = explode('.', $key); - return $lastRoute; - } + $lastRoute = $this->data; + foreach($keys as $keyName) { + if (isset($lastRoute[$keyName]) && is_array($lastRoute)) { + $lastRoute = $lastRoute[$keyName]; + } else { + return $returns; + } + } + + return $lastRoute; + } - public function getAll() - { - return $this->get(); - } + public function getAll() + { + return $this->get(); + } - protected function init() - { - if (file_exists($this->cacheFile) && $this->getConfig()->get('useCache')) { - $this->data = $this->getFileManager()->getContents($this->cacheFile); - } else { - $this->data = $this->unify(); + protected function init() + { + if (file_exists($this->cacheFile) && $this->getConfig()->get('useCache')) { + $this->data = $this->getFileManager()->getContents($this->cacheFile); + } else { + $this->data = $this->unify(); - $result = $this->getFileManager()->putContentsPHP($this->cacheFile, $this->data); - if ($result == false) { - throw new \Espo\Core\Exceptions\Error('Route - Cannot save unified routes'); - } - } - } + $result = $this->getFileManager()->putContentsPHP($this->cacheFile, $this->data); + if ($result == false) { + throw new \Espo\Core\Exceptions\Error('Route - Cannot save unified routes'); + } + } + } - protected function unify() - { - $data = array(); + protected function unify() + { + $data = array(); - $data = $this->getAddData($data, $this->paths['customPath']); + $data = $this->getAddData($data, $this->paths['customPath']); - foreach ($this->getMetadata()->getModuleList() as $moduleName) { - $modulePath = str_replace('{*}', $moduleName, $this->paths['modulePath']); - $data = $this->getAddData($data, $modulePath); - } + foreach ($this->getMetadata()->getModuleList() as $moduleName) { + $modulePath = str_replace('{*}', $moduleName, $this->paths['modulePath']); + $data = $this->getAddData($data, $modulePath); + } - $data = $this->getAddData($data, $this->paths['corePath']); - - return $data; - } - - protected function getAddData($currData, $routeFile) - { - if (file_exists($routeFile)) { - $content= $this->getFileManager()->getContents($routeFile); - $arrayContent = Json::getArrayData($content); - if (empty($arrayContent)) { - $GLOBALS['log']->error('Route::unify() - Empty file or syntax error - ['.$routeFile.']'); - return $currData; - } - - $currData = $this->addToData($currData, $arrayContent); - } - - return $currData; - } - - - protected function addToData($data, $newData) - { - if (!is_array($newData)) { - return $data; - } - - foreach($newData as $route) { - - $route['route'] = $this->adjustPath($route['route']); - - $data[] = $route; - } + $data = $this->getAddData($data, $this->paths['corePath']); return $data; - } + } + + protected function getAddData($currData, $routeFile) + { + if (file_exists($routeFile)) { + $content= $this->getFileManager()->getContents($routeFile); + $arrayContent = Json::getArrayData($content); + if (empty($arrayContent)) { + $GLOBALS['log']->error('Route::unify() - Empty file or syntax error - ['.$routeFile.']'); + return $currData; + } + + $currData = $this->addToData($currData, $arrayContent); + } + + return $currData; + } + + + protected function addToData($data, $newData) + { + if (!is_array($newData)) { + return $data; + } + + foreach($newData as $route) { + + $route['route'] = $this->adjustPath($route['route']); + + $data[] = $route; + } + + return $data; + } /** * Check and adjust the route path - * - * @param string $routePath - it can be "/App/user", "App/user" - * - * @return string - "/App/user" - */ + * + * @param string $routePath - it can be "/App/user", "App/user" + * + * @return string - "/App/user" + */ protected function adjustPath($routePath) { - $routePath = trim($routePath); + $routePath = trim($routePath); - if ( substr($routePath,0,1) != '/') { - return '/'.$routePath; - } + if ( substr($routePath,0,1) != '/') { + return '/'.$routePath; + } - return $routePath; + return $routePath; } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/System.php b/application/Espo/Core/Utils/System.php index dfc1d84dae..1ba458c5bf 100644 --- a/application/Espo/Core/Utils/System.php +++ b/application/Espo/Core/Utils/System.php @@ -24,81 +24,81 @@ namespace Espo\Core\Utils; class System { - /** - * Get web server name - * - * @return string Ex. "microsoft-iis", "nginx", "apache" - */ - public function getServerType() - { - $serverSoft = $_SERVER['SERVER_SOFTWARE']; + /** + * Get web server name + * + * @return string Ex. "microsoft-iis", "nginx", "apache" + */ + public function getServerType() + { + $serverSoft = $_SERVER['SERVER_SOFTWARE']; - preg_match('/^(.*?)\//i', $serverSoft, $match); - if (empty($match[1])) { - preg_match('/^(.*)\/?/i', $serverSoft, $match); - } - $serverName = strtolower( trim($match[1]) ); + preg_match('/^(.*?)\//i', $serverSoft, $match); + if (empty($match[1])) { + preg_match('/^(.*)\/?/i', $serverSoft, $match); + } + $serverName = strtolower( trim($match[1]) ); - return $serverName; - } + return $serverName; + } - /** - * Get Operating System of web server. Details http://en.wikipedia.org/wiki/Uname - * - * @return string Ex. "windows", "mac", "linux" - */ - public function getOS() - { - $osList = array( - 'windows' => array( - 'win', - 'UWIN', - ), - 'mac' => array( - 'mac', - 'darwin', - ), - 'linux' => array( - 'linux', - 'cygwin', - 'GNU', - 'FreeBSD', - 'OpenBSD', - 'NetBSD', - ), - ); + /** + * Get Operating System of web server. Details http://en.wikipedia.org/wiki/Uname + * + * @return string Ex. "windows", "mac", "linux" + */ + public function getOS() + { + $osList = array( + 'windows' => array( + 'win', + 'UWIN', + ), + 'mac' => array( + 'mac', + 'darwin', + ), + 'linux' => array( + 'linux', + 'cygwin', + 'GNU', + 'FreeBSD', + 'OpenBSD', + 'NetBSD', + ), + ); - $sysOS = strtolower(PHP_OS); + $sysOS = strtolower(PHP_OS); - foreach ($osList as $osName => $osSystem) { - if (preg_match('/^('.implode('|', $osSystem).')/i', $sysOS)) { - return $osName; - } - } + foreach ($osList as $osName => $osSystem) { + if (preg_match('/^('.implode('|', $osSystem).')/i', $sysOS)) { + return $osName; + } + } - return false; - } + return false; + } - /** - * Get root directory of EspoCRM - * - * @return string - */ - public function getRootDir() - { - $bPath = realpath('bootstrap.php'); - $rootDir = dirname($bPath); + /** + * Get root directory of EspoCRM + * + * @return string + */ + public function getRootDir() + { + $bPath = realpath('bootstrap.php'); + $rootDir = dirname($bPath); - return $rootDir; - } + return $rootDir; + } - /** - * Get path to PHP - * - * @return string - */ - public function getPhpBin() - { - return (defined("PHP_BINDIR"))? PHP_BINDIR.DIRECTORY_SEPARATOR.'php' : 'php'; - } + /** + * Get path to PHP + * + * @return string + */ + public function getPhpBin() + { + return (defined("PHP_BINDIR"))? PHP_BINDIR.DIRECTORY_SEPARATOR.'php' : 'php'; + } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Util.php b/application/Espo/Core/Utils/Util.php index ecf05a7f57..bb205362ae 100644 --- a/application/Espo/Core/Utils/Util.php +++ b/application/Espo/Core/Utils/Util.php @@ -25,403 +25,403 @@ namespace Espo\Core\Utils; class Util { - /** - * @var string - default directory separator - */ - protected static $separator = DIRECTORY_SEPARATOR; + /** + * @var string - default directory separator + */ + protected static $separator = DIRECTORY_SEPARATOR; - protected static $reservedWords = array('Case'); + protected static $reservedWords = array('Case'); - /** - * Get a folder separator - * - * @return string - */ - public static function getSeparator() - { - return static::$separator; - } + /** + * Get a folder separator + * + * @return string + */ + public static function getSeparator() + { + return static::$separator; + } - /** - * Convert to format with defined delimeter - * ex. Espo/Utils to Espo\Utils - * - * @param string $name - * @param string $delim - delimiter - * - * @return string - */ - public static function toFormat($name, $delim = '/') - { - return preg_replace("/[\/\\\]/", $delim, $name); - } + /** + * Convert to format with defined delimeter + * ex. Espo/Utils to Espo\Utils + * + * @param string $name + * @param string $delim - delimiter + * + * @return string + */ + public static function toFormat($name, $delim = '/') + { + return preg_replace("/[\/\\\]/", $delim, $name); + } - /** - * Convert name to Camel Case format, ex. camel-case to camelCase - * @param string $name - * @param boolean $capitaliseFirstChar - * @param string $symbol - * @return string - */ - public static function toCamelCase($name, $capitaliseFirstChar = false, $symbol = '-') - { - if($capitaliseFirstChar) { - $name[0] = strtoupper($name[0]); - } - return preg_replace_callback('/'.$symbol.'([a-z])/', 'static::toCamelCaseConversion', $name); - } + /** + * Convert name to Camel Case format, ex. camel-case to camelCase + * @param string $name + * @param boolean $capitaliseFirstChar + * @param string $symbol + * @return string + */ + public static function toCamelCase($name, $capitaliseFirstChar = false, $symbol = '-') + { + if($capitaliseFirstChar) { + $name[0] = strtoupper($name[0]); + } + return preg_replace_callback('/'.$symbol.'([a-z])/', 'static::toCamelCaseConversion', $name); + } - protected static function toCamelCaseConversion($matches) - { - return strtoupper($matches[1]); - } + protected static function toCamelCaseConversion($matches) + { + return strtoupper($matches[1]); + } - /** - * Convert name from Camel Case format. - * ex. camelCase to camel-case - * - * @param string $name - * - * @return string - */ - public static function fromCamelCase($name, $symbol = '-') - { - $name[0] = strtolower($name[0]); - return preg_replace_callback('/([A-Z])/', function ($matches) use ($symbol) { - return $symbol . strtolower($matches[1]); - }, $name); - } + /** + * Convert name from Camel Case format. + * ex. camelCase to camel-case + * + * @param string $name + * + * @return string + */ + public static function fromCamelCase($name, $symbol = '-') + { + $name[0] = strtolower($name[0]); + return preg_replace_callback('/([A-Z])/', function ($matches) use ($symbol) { + return $symbol . strtolower($matches[1]); + }, $name); + } - /** - * Convert name from Camel Case format to underscore. - * ex. camelCase to camel_case - * - * @param string $name - * - * @return string - */ - public static function toUnderScore($name) - { - return static::fromCamelCase($name, '_'); - } + /** + * Convert name from Camel Case format to underscore. + * ex. camelCase to camel_case + * + * @param string $name + * + * @return string + */ + public static function toUnderScore($name) + { + return static::fromCamelCase($name, '_'); + } - /** - * Merge arrays recursively (default PHP function is not suitable) - * - * @param array $currentArray - * @param array $newArray - chief array (priority is same as for array_merge()) - * - * @return array - */ - public static function merge($currentArray, $newArray) - { - $mergeIdentifier = '__APPEND__'; + /** + * Merge arrays recursively (default PHP function is not suitable) + * + * @param array $currentArray + * @param array $newArray - chief array (priority is same as for array_merge()) + * + * @return array + */ + public static function merge($currentArray, $newArray) + { + $mergeIdentifier = '__APPEND__'; - if (is_array($currentArray) && (!is_array($newArray) || empty($newArray))) { - return $currentArray; - } else if ((!is_array($currentArray) || empty($currentArray)) && is_array($newArray)) { - return $newArray; - } else if ((!is_array($currentArray) || empty($currentArray)) && (!is_array($newArray) || empty($newArray))) { - return array(); - } + if (is_array($currentArray) && (!is_array($newArray) || empty($newArray))) { + return $currentArray; + } else if ((!is_array($currentArray) || empty($currentArray)) && is_array($newArray)) { + return $newArray; + } else if ((!is_array($currentArray) || empty($currentArray)) && (!is_array($newArray) || empty($newArray))) { + return array(); + } - /** add root items from currentArray */ - foreach ($currentArray as $currentName => $currentValue) { + /** add root items from currentArray */ + foreach ($currentArray as $currentName => $currentValue) { - if (!array_key_exists($currentName, $newArray)) { + if (!array_key_exists($currentName, $newArray)) { - $newArray[$currentName] = $currentValue; + $newArray[$currentName] = $currentValue; - } else if (is_array($currentValue) && is_array($newArray[$currentName])) { + } else if (is_array($currentValue) && is_array($newArray[$currentName])) { - /** check __APPEND__ identifier */ - $appendKey = array_search($mergeIdentifier, $newArray[$currentName], true); - if ($appendKey !== false) { - unset($newArray[$currentName][$appendKey]); - $newArray[$currentName] = array_merge($currentValue, $newArray[$currentName]); - } else if (!static::isSingleArray($newArray[$currentName])) { - $newArray[$currentName] = static::merge($currentValue, $newArray[$currentName]); - } + /** check __APPEND__ identifier */ + $appendKey = array_search($mergeIdentifier, $newArray[$currentName], true); + if ($appendKey !== false) { + unset($newArray[$currentName][$appendKey]); + $newArray[$currentName] = array_merge($currentValue, $newArray[$currentName]); + } else if (!static::isSingleArray($newArray[$currentName])) { + $newArray[$currentName] = static::merge($currentValue, $newArray[$currentName]); + } - } - } + } + } - return $newArray; - } + return $newArray; + } - /** - * Get a full path of the file - * - * @param string | array $folderPath - Folder path, Ex. myfolder - * @param string $filePath - File path, Ex. file.json - * - * @return string - */ - public static function concatPath($folderPath, $filePath = null) - { - if (is_array($folderPath)) { - $fullPath = ''; - foreach ($folderPath as $path) { - $fullPath = static::concatPath($fullPath, $path); - } - return $fullPath; - } + /** + * Get a full path of the file + * + * @param string | array $folderPath - Folder path, Ex. myfolder + * @param string $filePath - File path, Ex. file.json + * + * @return string + */ + public static function concatPath($folderPath, $filePath = null) + { + if (is_array($folderPath)) { + $fullPath = ''; + foreach ($folderPath as $path) { + $fullPath = static::concatPath($fullPath, $path); + } + return $fullPath; + } - if (empty($filePath)) { - return $folderPath; - } - if (empty($folderPath)) { - return $filePath; - } + if (empty($filePath)) { + return $folderPath; + } + if (empty($folderPath)) { + return $filePath; + } - if (substr($folderPath, -1) == static::getSeparator()) { - return $folderPath . $filePath; - } - return $folderPath . static::getSeparator() . $filePath; - } + if (substr($folderPath, -1) == static::getSeparator()) { + return $folderPath . $filePath; + } + return $folderPath . static::getSeparator() . $filePath; + } - /** - * Convert array to object format recursively - * - * @param array $array - * @return object - */ - public static function arrayToObject($array) - { - if (is_array($array)) { - return (object) array_map("static::arrayToObject", $array); - } else { - return $array; // Return an object - } - } + /** + * Convert array to object format recursively + * + * @param array $array + * @return object + */ + public static function arrayToObject($array) + { + if (is_array($array)) { + return (object) array_map("static::arrayToObject", $array); + } else { + return $array; // Return an object + } + } - /** - * Convert object to array format recursively - * - * @param object $object - * @return array - */ - public static function objectToArray($object) - { - if (is_object($object)) { - $object = (array) $object; - } + /** + * Convert object to array format recursively + * + * @param object $object + * @return array + */ + public static function objectToArray($object) + { + if (is_object($object)) { + $object = (array) $object; + } - return is_array($object) ? array_map("static::objectToArray", $object) : $object; - } + return is_array($object) ? array_map("static::objectToArray", $object) : $object; + } - /** - * Appends 'Obj' if name is reserved PHP word. - * - * @param string $name - * @return string - */ - public static function normilizeClassName($name) - { - if (in_array($name, self::$reservedWords)) { - $name .= 'Obj'; - } - return $name; - } + /** + * Appends 'Obj' if name is reserved PHP word. + * + * @param string $name + * @return string + */ + public static function normilizeClassName($name) + { + if (in_array($name, self::$reservedWords)) { + $name .= 'Obj'; + } + return $name; + } - /** - * Get Naming according to prefix or postfix type - * - * @param string $name - * @param string $prePostFix - * @param string $type - * - * @return string - */ - public static function getNaming($name, $prePostFix, $type = 'prefix', $symbol = '-') - { - if ($type == 'prefix') { - return static::toCamelCase($prePostFix.$symbol.$name, false, $symbol); - } else if ($type == 'postfix') { - return static::toCamelCase($name.$symbol.$prePostFix, false, $symbol); - } + /** + * Get Naming according to prefix or postfix type + * + * @param string $name + * @param string $prePostFix + * @param string $type + * + * @return string + */ + public static function getNaming($name, $prePostFix, $type = 'prefix', $symbol = '-') + { + if ($type == 'prefix') { + return static::toCamelCase($prePostFix.$symbol.$name, false, $symbol); + } else if ($type == 'postfix') { + return static::toCamelCase($name.$symbol.$prePostFix, false, $symbol); + } - return null; - } + return null; + } - /** - * Replace $search in array recursively - * - * @param string $search - * @param string $replace - * @param string $array - * @param string $isKeys - * - * @return array - */ - public static function replaceInArray($search = '', $replace = '', $array = false, $isKeys = true) - { - if (!is_array($array)) { - return str_replace($search, $replace, $array); - } + /** + * Replace $search in array recursively + * + * @param string $search + * @param string $replace + * @param string $array + * @param string $isKeys + * + * @return array + */ + public static function replaceInArray($search = '', $replace = '', $array = false, $isKeys = true) + { + if (!is_array($array)) { + return str_replace($search, $replace, $array); + } - $newArr = array(); - foreach ($array as $key => $value) { - $addKey = $key; - if ($isKeys) { //Replace keys - $addKey = str_replace($search, $replace, $key); - } + $newArr = array(); + foreach ($array as $key => $value) { + $addKey = $key; + if ($isKeys) { //Replace keys + $addKey = str_replace($search, $replace, $key); + } - // Recurse - $newArr[$addKey] = static::replaceInArray($search, $replace, $value, $isKeys); - } + // Recurse + $newArr[$addKey] = static::replaceInArray($search, $replace, $value, $isKeys); + } - return $newArr; - } + return $newArr; + } - /** - * Unset content items defined in the unset.json - * - * @param array $content - * @param string | array $unsets in format - * array( - * 'EntityName1' => array( 'unset1', 'unset2' ), - * 'EntityName2' => array( 'unset1', 'unset2' ), - * ) - * OR - * array('EntityName1.unset1', 'EntityName1.unset2', .....) - * OR - * 'EntityName1.unset1' - * - * @return array - */ - public static function unsetInArray(array $content, $unsets) - { - if (empty($unsets)) { - return $content; - } + /** + * Unset content items defined in the unset.json + * + * @param array $content + * @param string | array $unsets in format + * array( + * 'EntityName1' => array( 'unset1', 'unset2' ), + * 'EntityName2' => array( 'unset1', 'unset2' ), + * ) + * OR + * array('EntityName1.unset1', 'EntityName1.unset2', .....) + * OR + * 'EntityName1.unset1' + * + * @return array + */ + public static function unsetInArray(array $content, $unsets) + { + if (empty($unsets)) { + return $content; + } - if (is_string($unsets)) { - $unsets = (array) $unsets; - } + if (is_string($unsets)) { + $unsets = (array) $unsets; + } - foreach($unsets as $rootKey => $unsetItem){ - $unsetItem = is_array($unsetItem) ? $unsetItem : (array) $unsetItem; + foreach($unsets as $rootKey => $unsetItem){ + $unsetItem = is_array($unsetItem) ? $unsetItem : (array) $unsetItem; - foreach($unsetItem as $unsetSett){ - if (!empty($unsetSett)){ - $keyItems = explode('.', $unsetSett); - $currVal = isset($content[$rootKey]) ? "\$content['{$rootKey}']" : "\$content"; + foreach($unsetItem as $unsetSett){ + if (!empty($unsetSett)){ + $keyItems = explode('.', $unsetSett); + $currVal = isset($content[$rootKey]) ? "\$content['{$rootKey}']" : "\$content"; - $lastKey = array_pop($keyItems); - foreach($keyItems as $keyItem){ - $currVal .= "['{$keyItem}']"; - } + $lastKey = array_pop($keyItems); + foreach($keyItems as $keyItem){ + $currVal .= "['{$keyItem}']"; + } - $unsetElem = $currVal . "['{$lastKey}']"; + $unsetElem = $currVal . "['{$lastKey}']"; - $currVal = " - if (isset({$unsetElem}) || ( is_array({$currVal}) && array_key_exists({$lastKey}, {$currVal}) )) { - unset({$unsetElem}); - } "; - eval($currVal); - } - } - } + $currVal = " + if (isset({$unsetElem}) || ( is_array({$currVal}) && array_key_exists({$lastKey}, {$currVal}) )) { + unset({$unsetElem}); + } "; + eval($currVal); + } + } + } - return $content; - } + return $content; + } - /** - * Get class name from the file path - * - * @param string $filePath - * - * @return string - */ - public static function getClassName($filePath) - { - $className = preg_replace('/\.php$/i', '', $filePath); - $className = preg_replace('/^(application|custom)\//i', '', $className); - $className = '\\'.static::toFormat($className, '\\'); + /** + * Get class name from the file path + * + * @param string $filePath + * + * @return string + */ + public static function getClassName($filePath) + { + $className = preg_replace('/\.php$/i', '', $filePath); + $className = preg_replace('/^(application|custom)\//i', '', $className); + $className = '\\'.static::toFormat($className, '\\'); - return $className; - } + return $className; + } - /** - * Return values of defined $key. - * - * @param array $array - * @param string $key Ex. of key is "entityDefs", "entityDefs.User" - * @param mixed $default - * @return mixed - */ - public static function getValueByKey(array $array, $key = null, $default = null) - { - if (!isset($key) || empty($key)) { - return $array; - } + /** + * Return values of defined $key. + * + * @param array $array + * @param string $key Ex. of key is "entityDefs", "entityDefs.User" + * @param mixed $default + * @return mixed + */ + public static function getValueByKey(array $array, $key = null, $default = null) + { + if (!isset($key) || empty($key)) { + return $array; + } - $keys = explode('.', $key); + $keys = explode('.', $key); - $lastItem = $array; - foreach($keys as $keyName) { - if (isset($lastItem[$keyName]) && is_array($lastItem)) { - $lastItem = $lastItem[$keyName]; - } else { - return $default; - } - } + $lastItem = $array; + foreach($keys as $keyName) { + if (isset($lastItem[$keyName]) && is_array($lastItem)) { + $lastItem = $lastItem[$keyName]; + } else { + return $default; + } + } - return $lastItem; - } + return $lastItem; + } - /** - * Check if two variables are equals - * - * @param mixed $var1 - * @param mixed $var2 - * @return boolean - */ - public static function isEquals($var1, $var2) - { - if (is_array($var1)) { - static::ksortRecursive($var1); - } - if (is_array($var2)) { - static::ksortRecursive($var2); - } + /** + * Check if two variables are equals + * + * @param mixed $var1 + * @param mixed $var2 + * @return boolean + */ + public static function isEquals($var1, $var2) + { + if (is_array($var1)) { + static::ksortRecursive($var1); + } + if (is_array($var2)) { + static::ksortRecursive($var2); + } - return ($var1 === $var2); - } + return ($var1 === $var2); + } - /** - * Sort array recursively - * @param array $array - * @return bool - */ - public static function ksortRecursive(&$array) - { - if (!is_array($array)) { - return false; - } + /** + * Sort array recursively + * @param array $array + * @return bool + */ + public static function ksortRecursive(&$array) + { + if (!is_array($array)) { + return false; + } - ksort($array); - foreach ($array as $key => $value) { - static::ksortRecursive($array[$key]); - } + ksort($array); + foreach ($array as $key => $value) { + static::ksortRecursive($array[$key]); + } - return true; - } + return true; + } - public static function isSingleArray(array $array) - { - foreach ($array as $key => $value) { - if (!is_int($key)) { - return false; - } - } + public static function isSingleArray(array $array) + { + foreach ($array as $key => $value) { + if (!is_int($key)) { + return false; + } + } - return true; - } + return true; + } } diff --git a/application/Espo/Core/defaults/config.php b/application/Espo/Core/defaults/config.php index 31e6e67053..97271412b2 100644 --- a/application/Espo/Core/defaults/config.php +++ b/application/Espo/Core/defaults/config.php @@ -21,79 +21,79 @@ ************************************************************************/ return array ( - 'database' => - array ( - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'port' => '', - 'dbname' => '', - 'user' => '', - 'password' => '', - ), - 'useCache' => true, - 'recordsPerPage' => 20, - 'recordsPerPageSmall' => 5, - 'applicationName' => 'EspoCRM', - 'version' => '@@version', - 'timeZone' => 'UTC', - 'dateFormat' => 'MM/DD/YYYY', - 'timeFormat' => 'HH:mm', - 'weekStart' => 0, - 'thousandSeparator' => ',', - 'decimalMark' => '.', - 'exportDelimiter' => ';', - 'currencyList' => - array ( - ), - 'defaultCurrency' => 'USD', - 'baseCurrency' => 'USD', - 'currencyRates' => array( - ), - 'outboundEmailIsShared' => true, - 'outboundEmailFromName' => 'EspoCRM', - 'outboundEmailFromAddress' => '', - 'smtpServer' => '', - 'smtpPort' => 25, - 'smtpAuth' => true, - 'smtpSecurity' => '', - 'smtpUsername' => '', - 'smtpPassword' => '', - 'languageList' => array( - 'en_US', - 'de_DE', - 'es_ES', - 'fr_FR', - 'nl_NL', - 'tr_TR', - 'ro_RO', - 'ru_RU', - 'pl_PL', - 'pt_BR', - 'vi_VN' - ), - 'language' => 'en_US', - 'logger' => - array ( - 'path' => 'data/logs/espo.log', - 'level' => 'ERROR', /** DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY */ - 'isRotate' => true, /** rotate log files every day */ - 'maxRotateFiles' => 30, /** max number of rotate files */ - ), - 'authenticationMethod' => 'Espo', - 'globalSearchEntityList' => - array ( - 0 => 'Account', - 1 => 'Contact', - 2 => 'Lead', - 3 => 'Opportunity', - ), - "tabList" => array("Account", "Contact", "Lead", "Opportunity", "Calendar", "Meeting", "Call", "Task", "Case", "Email"), - "quickCreateList" => array("Account", "Contact", "Lead", "Opportunity", "Meeting", "Call", "Task", "Case"), - 'calendarDefaultEntity' => 'Meeting', - 'disableExport' => false, - 'assignmentEmailNotifications' => false, - 'assignmentEmailNotificationsEntityList' => array('Lead', 'Opportunity', 'Task', 'Case'), - 'emailMessageMaxSize' => 10, - 'isInstalled' => false, + 'database' => + array ( + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'port' => '', + 'dbname' => '', + 'user' => '', + 'password' => '', + ), + 'useCache' => true, + 'recordsPerPage' => 20, + 'recordsPerPageSmall' => 5, + 'applicationName' => 'EspoCRM', + 'version' => '@@version', + 'timeZone' => 'UTC', + 'dateFormat' => 'MM/DD/YYYY', + 'timeFormat' => 'HH:mm', + 'weekStart' => 0, + 'thousandSeparator' => ',', + 'decimalMark' => '.', + 'exportDelimiter' => ';', + 'currencyList' => + array ( + ), + 'defaultCurrency' => 'USD', + 'baseCurrency' => 'USD', + 'currencyRates' => array( + ), + 'outboundEmailIsShared' => true, + 'outboundEmailFromName' => 'EspoCRM', + 'outboundEmailFromAddress' => '', + 'smtpServer' => '', + 'smtpPort' => 25, + 'smtpAuth' => true, + 'smtpSecurity' => '', + 'smtpUsername' => '', + 'smtpPassword' => '', + 'languageList' => array( + 'en_US', + 'de_DE', + 'es_ES', + 'fr_FR', + 'nl_NL', + 'tr_TR', + 'ro_RO', + 'ru_RU', + 'pl_PL', + 'pt_BR', + 'vi_VN' + ), + 'language' => 'en_US', + 'logger' => + array ( + 'path' => 'data/logs/espo.log', + 'level' => 'ERROR', /** DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY */ + 'isRotate' => true, /** rotate log files every day */ + 'maxRotateFiles' => 30, /** max number of rotate files */ + ), + 'authenticationMethod' => 'Espo', + 'globalSearchEntityList' => + array ( + 0 => 'Account', + 1 => 'Contact', + 2 => 'Lead', + 3 => 'Opportunity', + ), + "tabList" => array("Account", "Contact", "Lead", "Opportunity", "Calendar", "Meeting", "Call", "Task", "Case", "Email"), + "quickCreateList" => array("Account", "Contact", "Lead", "Opportunity", "Meeting", "Call", "Task", "Case"), + 'calendarDefaultEntity' => 'Meeting', + 'disableExport' => false, + 'assignmentEmailNotifications' => false, + 'assignmentEmailNotificationsEntityList' => array('Lead', 'Opportunity', 'Task', 'Case'), + 'emailMessageMaxSize' => 10, + 'isInstalled' => false, ); diff --git a/application/Espo/Core/defaults/layout/detail.json b/application/Espo/Core/defaults/layout/detail.json index 992d2ea1ba..2b813b000f 100644 --- a/application/Espo/Core/defaults/layout/detail.json +++ b/application/Espo/Core/defaults/layout/detail.json @@ -1,6 +1,6 @@ [{ - "label":"Overview", - "rows": [ - [{"name":"name"}] - ] + "label":"Overview", + "rows": [ + [{"name":"name"}] + ] }] diff --git a/application/Espo/Core/defaults/layout/detailSmall.json b/application/Espo/Core/defaults/layout/detailSmall.json index fca42b50da..0305a5ee76 100644 --- a/application/Espo/Core/defaults/layout/detailSmall.json +++ b/application/Espo/Core/defaults/layout/detailSmall.json @@ -1,6 +1,6 @@ [{ - "label":"", - "rows": [ - [{"name":"name"}] - ] + "label":"", + "rows": [ + [{"name":"name"}] + ] }] diff --git a/application/Espo/Core/defaults/systemConfig.php b/application/Espo/Core/defaults/systemConfig.php index 5c7943193d..b40179a649 100644 --- a/application/Espo/Core/defaults/systemConfig.php +++ b/application/Espo/Core/defaults/systemConfig.php @@ -21,100 +21,100 @@ ************************************************************************/ return array ( - 'defaultPermissions' => - array ( - 'dir' => '0775', - 'file' => '0664', - 'user' => '', - 'group' => '', - ), + 'defaultPermissions' => + array ( + 'dir' => '0775', + 'file' => '0664', + 'user' => '', + 'group' => '', + ), - 'permissionMap' => array( + 'permissionMap' => array( - /** array('0664', '0775') */ - 'writable' => array( - 'data', - 'custom', - ), + /** array('0664', '0775') */ + 'writable' => array( + 'data', + 'custom', + ), - /** array('0644', '0755') */ - 'readable' => array( - 'api', - 'application', - 'client', - 'vendor', - 'index.php', - 'cron.php', - 'rebuild.php', - 'main.html', - 'reset.html', - ), - ), - 'cron' => array( - 'maxJobNumber' => 15, /** Max number of jobs per one execution */ - 'jobPeriod' => 7800, /** Period for jobs, ex. if cron executed at 15:35, it will execute all pending jobs for times from 14:05 to 15:35 */ - 'minExecutionTime' => 50, /** to avoid too frequency execution **/ - ), - 'crud' => array( - 'get' => 'read', - 'post' => 'create', - 'put' => 'update', - 'patch' => 'patch', - 'delete' => 'delete', - ), - 'systemUser' => array( - 'id' => 'system', - 'userName' => 'system', - 'firstName' => '', - 'lastName' => 'System', - ), - 'systemItems' => - array ( - 'systemItems', - 'adminItems', - 'configPath', - 'cachePath', - 'database', - 'crud', - 'logger', - 'isInstalled', - 'defaultPermissions', - 'systemUser', - 'permissionMap', - 'permissionRules', - 'passwordSalt', - ), - 'adminItems' => - array ( - 'devMode', - 'outboundEmailIsShared', - 'outboundEmailFromName', - 'outboundEmailFromAddress', - 'smtpServer', - 'smtpPort', - 'smtpAuth', - 'smtpSecurity', - 'smtpUsername', - 'smtpPassword', - 'cron', - 'authenticationMethod', - 'ldapHost', - 'ldapPort', - 'ldapSecurity', - 'ldapAuth', - 'ldapUsername', - 'ldapPassword', - 'ldapBindRequiresDn', - 'ldapBaseDn', - 'ldapUserLoginFilter', - 'ldapAccountCanonicalForm', - 'ldapAccountDomainName', - 'ldapAccountDomainNameShort', - 'ldapAccountFilterFormat', - 'ldapTryUsernameSplit', - 'ldapOptReferrals', - 'ldapCreateEspoUser', - ), - 'isInstalled' => false, + /** array('0644', '0755') */ + 'readable' => array( + 'api', + 'application', + 'client', + 'vendor', + 'index.php', + 'cron.php', + 'rebuild.php', + 'main.html', + 'reset.html', + ), + ), + 'cron' => array( + 'maxJobNumber' => 15, /** Max number of jobs per one execution */ + 'jobPeriod' => 7800, /** Period for jobs, ex. if cron executed at 15:35, it will execute all pending jobs for times from 14:05 to 15:35 */ + 'minExecutionTime' => 50, /** to avoid too frequency execution **/ + ), + 'crud' => array( + 'get' => 'read', + 'post' => 'create', + 'put' => 'update', + 'patch' => 'patch', + 'delete' => 'delete', + ), + 'systemUser' => array( + 'id' => 'system', + 'userName' => 'system', + 'firstName' => '', + 'lastName' => 'System', + ), + 'systemItems' => + array ( + 'systemItems', + 'adminItems', + 'configPath', + 'cachePath', + 'database', + 'crud', + 'logger', + 'isInstalled', + 'defaultPermissions', + 'systemUser', + 'permissionMap', + 'permissionRules', + 'passwordSalt', + ), + 'adminItems' => + array ( + 'devMode', + 'outboundEmailIsShared', + 'outboundEmailFromName', + 'outboundEmailFromAddress', + 'smtpServer', + 'smtpPort', + 'smtpAuth', + 'smtpSecurity', + 'smtpUsername', + 'smtpPassword', + 'cron', + 'authenticationMethod', + 'ldapHost', + 'ldapPort', + 'ldapSecurity', + 'ldapAuth', + 'ldapUsername', + 'ldapPassword', + 'ldapBindRequiresDn', + 'ldapBaseDn', + 'ldapUserLoginFilter', + 'ldapAccountCanonicalForm', + 'ldapAccountDomainName', + 'ldapAccountDomainNameShort', + 'ldapAccountFilterFormat', + 'ldapTryUsernameSplit', + 'ldapOptReferrals', + 'ldapCreateEspoUser', + ), + 'isInstalled' => false, ); diff --git a/application/Espo/Entities/Email.php b/application/Espo/Entities/Email.php index 1139f45b50..3e222338ec 100644 --- a/application/Espo/Entities/Email.php +++ b/application/Espo/Entities/Email.php @@ -25,75 +25,75 @@ namespace Espo\Entities; class Email extends \Espo\Core\ORM\Entity { - protected function getSubject() - { - return $this->get('name'); - } - - protected function setSubject($value) - { - return $this->set('name', $value); - } - - public function addAttachment(\Espo\Entities\Attachment $attachment) - { - if (!empty($this->id)) { - $attachment->set('parentId', $this->id); - $attachment->set('parentType', 'Email'); - if ($this->entityManager->saveEntity($attachment)) { - return true; - } - } - } - - public function getBodyPlainForSending() - { - $bodyPlain = $this->get('bodyPlain'); - if (!empty($bodyPlain)) { - return $bodyPlain; - } + protected function getSubject() + { + return $this->get('name'); + } + + protected function setSubject($value) + { + return $this->set('name', $value); + } + + public function addAttachment(\Espo\Entities\Attachment $attachment) + { + if (!empty($this->id)) { + $attachment->set('parentId', $this->id); + $attachment->set('parentType', 'Email'); + if ($this->entityManager->saveEntity($attachment)) { + return true; + } + } + } + + public function getBodyPlainForSending() + { + $bodyPlain = $this->get('bodyPlain'); + if (!empty($bodyPlain)) { + return $bodyPlain; + } - $body = $this->get('body'); - - $breaks = array("
","
","
","
","<br />","<br/>","<br>"); - $body = str_ireplace($breaks, "\r\n", $body); - $body = strip_tags($body); - return $body; - } - - public function getBodyForSending() - { - $body = $this->get('body'); - if (!empty($body)) { - $attachmentList = $this->getInlineAttachments(); - foreach ($attachmentList as $attachment) { - $body = str_replace("?entryPoint=attachment&id={$attachment->id}", "cid:{$attachment->id}", $body); - } - } - - $body = str_replace("", "
", $body); - - return $body; - } - - public function getInlineAttachments() - { - $attachmentList = array(); - $body = $this->get('body'); - if (!empty($body)) { - if (preg_match_all("/\?entryPoint=attachment&id=([^&=\"']+)/", $body, $matches)) { - if (!empty($matches[1]) && is_array($matches[1])) { - foreach($matches[1] as $id) { - $attachment = $this->entityManager->getEntity('Attachment', $id); - if ($attachment) { - $attachmentList[] = $attachment; - } - } - } - } - - } - return $attachmentList; - } + $body = $this->get('body'); + + $breaks = array("
","
","
","
","<br />","<br/>","<br>"); + $body = str_ireplace($breaks, "\r\n", $body); + $body = strip_tags($body); + return $body; + } + + public function getBodyForSending() + { + $body = $this->get('body'); + if (!empty($body)) { + $attachmentList = $this->getInlineAttachments(); + foreach ($attachmentList as $attachment) { + $body = str_replace("?entryPoint=attachment&id={$attachment->id}", "cid:{$attachment->id}", $body); + } + } + + $body = str_replace("
", "
", $body); + + return $body; + } + + public function getInlineAttachments() + { + $attachmentList = array(); + $body = $this->get('body'); + if (!empty($body)) { + if (preg_match_all("/\?entryPoint=attachment&id=([^&=\"']+)/", $body, $matches)) { + if (!empty($matches[1]) && is_array($matches[1])) { + foreach($matches[1] as $id) { + $attachment = $this->entityManager->getEntity('Attachment', $id); + if ($attachment) { + $attachmentList[] = $attachment; + } + } + } + } + + } + return $attachmentList; + } } diff --git a/application/Espo/Entities/EmailAddress.php b/application/Espo/Entities/EmailAddress.php index 18377e5179..625dc2069a 100644 --- a/application/Espo/Entities/EmailAddress.php +++ b/application/Espo/Entities/EmailAddress.php @@ -27,13 +27,13 @@ use Espo\Core\Exceptions\Error; class EmailAddress extends \Espo\Core\ORM\Entity { - protected function setName($value) - { - if (empty($value)) { - throw new Error("Not valid email address '{$value}'"); - } - $this->valuesContainer['name'] = $value; - $this->set('lower', strtolower($value)); - } + protected function setName($value) + { + if (empty($value)) { + throw new Error("Not valid email address '{$value}'"); + } + $this->valuesContainer['name'] = $value; + $this->set('lower', strtolower($value)); + } } diff --git a/application/Espo/Entities/Extension.php b/application/Espo/Entities/Extension.php index abad6e82e9..2f17e2b202 100644 --- a/application/Espo/Entities/Extension.php +++ b/application/Espo/Entities/Extension.php @@ -23,7 +23,7 @@ namespace Espo\Entities; class Extension extends \Espo\Core\ORM\Entity -{ - +{ + } diff --git a/application/Espo/Entities/ExternalAccount.php b/application/Espo/Entities/ExternalAccount.php index e52c51e256..f60c87a562 100644 --- a/application/Espo/Entities/ExternalAccount.php +++ b/application/Espo/Entities/ExternalAccount.php @@ -23,6 +23,6 @@ namespace Espo\Entities; class ExternalAccount extends Integration -{ +{ } diff --git a/application/Espo/Entities/Integration.php b/application/Espo/Entities/Integration.php index 0471893328..2de706b84e 100644 --- a/application/Espo/Entities/Integration.php +++ b/application/Espo/Entities/Integration.php @@ -23,153 +23,153 @@ namespace Espo\Entities; class Integration extends \Espo\Core\ORM\Entity -{ - public function get($name) - { - if ($name == 'id') { - return $this->id; - } - - if ($this->hasField($name)) { - if (array_key_exists($name, $this->valuesContainer)) { - return $this->valuesContainer[$name]; - } - } else { - if ($this->get('data')) { - $data = $this->get('data'); - } else { - $data = new \stdClass(); - } - if (isset($data->$name)) { - return $data->$name; - } - } - return null; - } - - public function clear($name) - { - parent::clear($name); - - $data = $this->get('data'); - if (empty($data)) { - $data = new \stdClass(); - } - unset($data->$name); - $this->set('data', $data); - } - - public function set($p1, $p2) - { - if (is_array($p1)) { - if ($p2 === null) { - $p2 = false; - } - $this->populateFromArray($p1, $p2); - return; - } - - $name = $p1; - $value = $p2; - - if ($name == 'id') { - $this->id = $value; - return; - } - - if ($this->hasField($name)) { - $this->valuesContainer[$name] = $value; - } else { - if (!$this->get('enabled')) { - return; - } - $data = $this->get('data'); - if (empty($data)) { - $data = new \stdClass(); - } - $data->$name = $value; - $this->set('data', $data); - } - } - - public function populateFromArray(array $arr, $onlyAccessible = true, $reset = false) - { - if ($reset) { - $this->reset(); - } - - foreach ($arr as $field => $value) { - if (is_string($field)) { - if (is_array($value) || ($value instanceof \stdClass)) { - $value = json_encode($value); - } - - if ($this->hasField($field)) { - $fields = $this->getFields(); - $fieldDefs = $fields[$field]; - - if (!is_null($value)) { - switch ($fieldDefs['type']) { - case self::VARCHAR: - break; - case self::BOOL: - $value = ($value === 'true' || $value === '1' || $value === true); - break; - case self::INT: - $value = intval($value); - break; - case self::FLOAT: - $value = floatval($value); - break; - case self::JSON_ARRAY: - $value = is_string($value) ? json_decode($value) : $value; - if (!is_array($value)) { - $value = null; - } - break; - case self::JSON_OBJECT: - $value = is_string($value) ? json_decode($value) : $value; - if (!($value instanceof \stdClass) && !is_array($value)) { - $value = null; - } - break; - default: - break; - } - } - } - +{ + public function get($name) + { + if ($name == 'id') { + return $this->id; + } + + if ($this->hasField($name)) { + if (array_key_exists($name, $this->valuesContainer)) { + return $this->valuesContainer[$name]; + } + } else { + if ($this->get('data')) { + $data = $this->get('data'); + } else { + $data = new \stdClass(); + } + if (isset($data->$name)) { + return $data->$name; + } + } + return null; + } + + public function clear($name) + { + parent::clear($name); + + $data = $this->get('data'); + if (empty($data)) { + $data = new \stdClass(); + } + unset($data->$name); + $this->set('data', $data); + } + + public function set($p1, $p2) + { + if (is_array($p1)) { + if ($p2 === null) { + $p2 = false; + } + $this->populateFromArray($p1, $p2); + return; + } + + $name = $p1; + $value = $p2; + + if ($name == 'id') { + $this->id = $value; + return; + } + + if ($this->hasField($name)) { + $this->valuesContainer[$name] = $value; + } else { + if (!$this->get('enabled')) { + return; + } + $data = $this->get('data'); + if (empty($data)) { + $data = new \stdClass(); + } + $data->$name = $value; + $this->set('data', $data); + } + } + + public function populateFromArray(array $arr, $onlyAccessible = true, $reset = false) + { + if ($reset) { + $this->reset(); + } + + foreach ($arr as $field => $value) { + if (is_string($field)) { + if (is_array($value) || ($value instanceof \stdClass)) { + $value = json_encode($value); + } + + if ($this->hasField($field)) { + $fields = $this->getFields(); + $fieldDefs = $fields[$field]; + + if (!is_null($value)) { + switch ($fieldDefs['type']) { + case self::VARCHAR: + break; + case self::BOOL: + $value = ($value === 'true' || $value === '1' || $value === true); + break; + case self::INT: + $value = intval($value); + break; + case self::FLOAT: + $value = floatval($value); + break; + case self::JSON_ARRAY: + $value = is_string($value) ? json_decode($value) : $value; + if (!is_array($value)) { + $value = null; + } + break; + case self::JSON_OBJECT: + $value = is_string($value) ? json_decode($value) : $value; + if (!($value instanceof \stdClass) && !is_array($value)) { + $value = null; + } + break; + default: + break; + } + } + } + - $this->set($field, $value); - } - } - } - - public function toArray() - { - $arr = array(); - if (isset($this->id)) { - $arr['id'] = $this->id; - } - foreach ($this->fields as $field => $defs) { - if ($field == 'id') { - continue; - } - if ($this->has($field)) { - $arr[$field] = $this->get($field); - } - } - - $data = $this->get('data'); - if (empty($data)) { - $data = new \stdClass(); - } - - $dataArr = get_object_vars($data); + $this->set($field, $value); + } + } + } + + public function toArray() + { + $arr = array(); + if (isset($this->id)) { + $arr['id'] = $this->id; + } + foreach ($this->fields as $field => $defs) { + if ($field == 'id') { + continue; + } + if ($this->has($field)) { + $arr[$field] = $this->get($field); + } + } + + $data = $this->get('data'); + if (empty($data)) { + $data = new \stdClass(); + } + + $dataArr = get_object_vars($data); - $arr = array_merge($arr, $dataArr); - return $arr; - } - + $arr = array_merge($arr, $dataArr); + return $arr; + } + } diff --git a/application/Espo/Entities/Note.php b/application/Espo/Entities/Note.php index d58e8eb25b..15fd55579a 100644 --- a/application/Espo/Entities/Note.php +++ b/application/Espo/Entities/Note.php @@ -24,21 +24,21 @@ namespace Espo\Entities; class Note extends \Espo\Core\ORM\Entity { - public function loadAttachments() - { - $collection = $this->get('attachments'); - $ids = array(); - $names = new \stdClass(); - $types = new \stdClass(); - foreach ($collection as $e) { - $id = $e->id; - $ids[] = $id; - $names->$id = $e->get('name'); - $types->$id = $e->get('type'); - } - $this->set('attachmentsIds', $ids); - $this->set('attachmentsNames', $names); - $this->set('attachmentsTypes', $types); - } + public function loadAttachments() + { + $collection = $this->get('attachments'); + $ids = array(); + $names = new \stdClass(); + $types = new \stdClass(); + foreach ($collection as $e) { + $id = $e->id; + $ids[] = $id; + $names->$id = $e->get('name'); + $types->$id = $e->get('type'); + } + $this->set('attachmentsIds', $ids); + $this->set('attachmentsNames', $names); + $this->set('attachmentsTypes', $types); + } } diff --git a/application/Espo/Entities/PhoneNumber.php b/application/Espo/Entities/PhoneNumber.php index 7ee7e7e9bc..0ad87caf52 100644 --- a/application/Espo/Entities/PhoneNumber.php +++ b/application/Espo/Entities/PhoneNumber.php @@ -26,12 +26,12 @@ use Espo\Core\Exceptions\Error; class PhoneNumber extends \Espo\Core\ORM\Entity { - protected function setName($value) - { - if (empty($value)) { - throw new Error("Phone number can't be empty"); - } - $this->valuesContainer['name'] = $value; - } + protected function setName($value) + { + if (empty($value)) { + throw new Error("Phone number can't be empty"); + } + $this->valuesContainer['name'] = $value; + } } diff --git a/application/Espo/Entities/Preferences.php b/application/Espo/Entities/Preferences.php index 0afa6d4049..458f61b1c0 100644 --- a/application/Espo/Entities/Preferences.php +++ b/application/Espo/Entities/Preferences.php @@ -25,21 +25,21 @@ namespace Espo\Entities; class Preferences extends \Espo\Core\ORM\Entity { - public function getSmtpParams() - { - $smtpParams = array(); - $smtpParams['server'] = $this->get('smtpServer'); - if ($smtpParams['server']) { - $smtpParams['port'] = $this->get('smtpPort'); - $smtpParams['server'] = $this->get('smtpServer'); - $smtpParams['auth'] = $this->get('smtpAuth'); - $smtpParams['security'] = $this->get('smtpSecurity'); - $smtpParams['username'] = $this->get('smtpUsername'); - $smtpParams['password'] = $this->get('smtpPassword'); - return $smtpParams; - } else { - return false; - } - } + public function getSmtpParams() + { + $smtpParams = array(); + $smtpParams['server'] = $this->get('smtpServer'); + if ($smtpParams['server']) { + $smtpParams['port'] = $this->get('smtpPort'); + $smtpParams['server'] = $this->get('smtpServer'); + $smtpParams['auth'] = $this->get('smtpAuth'); + $smtpParams['security'] = $this->get('smtpSecurity'); + $smtpParams['username'] = $this->get('smtpUsername'); + $smtpParams['password'] = $this->get('smtpPassword'); + return $smtpParams; + } else { + return false; + } + } } diff --git a/application/Espo/Entities/User.php b/application/Espo/Entities/User.php index f8723d73be..27f7006f92 100644 --- a/application/Espo/Entities/User.php +++ b/application/Espo/Entities/User.php @@ -23,9 +23,9 @@ namespace Espo\Entities; class User extends \Espo\Core\Entities\Person -{ - public function isAdmin() - { - return $this->get('isAdmin'); - } +{ + public function isAdmin() + { + return $this->get('isAdmin'); + } } diff --git a/application/Espo/EntryPoints/Attachment.php b/application/Espo/EntryPoints/Attachment.php index 2f001ebf0a..097d21b3ce 100644 --- a/application/Espo/EntryPoints/Attachment.php +++ b/application/Espo/EntryPoints/Attachment.php @@ -28,44 +28,44 @@ use \Espo\Core\Exceptions\BadRequest; class Attachment extends \Espo\Core\EntryPoints\Base { - public static $authRequired = true; - - public function run() - { - $id = $_GET['id']; - if (empty($id)) { - throw new BadRequest(); - } - - $attachment = $this->getEntityManager()->getEntity('Attachment', $id); - - if (!$attachment) { - throw new NotFound(); - } - - if ($attachment->get('parentId') && $attachment->get('parentType')) { - $parent = $this->getEntityManager()->getEntity($attachment->get('parentType'), $attachment->get('parentId')); - if (!$this->getAcl()->check($parent)) { - throw new Forbidden(); - } - } - - $fileName = "data/upload/{$attachment->id}"; - - if (!file_exists($fileName)) { - throw new NotFound(); - } - - if ($attachment->get('type')) { - header('Content-Type: ' . $attachment->get('type')); - } - - header('Pragma: public'); - header('Content-Length: ' . filesize($fileName)); - ob_clean(); - flush(); - readfile($fileName); - exit; - } + public static $authRequired = true; + + public function run() + { + $id = $_GET['id']; + if (empty($id)) { + throw new BadRequest(); + } + + $attachment = $this->getEntityManager()->getEntity('Attachment', $id); + + if (!$attachment) { + throw new NotFound(); + } + + if ($attachment->get('parentId') && $attachment->get('parentType')) { + $parent = $this->getEntityManager()->getEntity($attachment->get('parentType'), $attachment->get('parentId')); + if (!$this->getAcl()->check($parent)) { + throw new Forbidden(); + } + } + + $fileName = "data/upload/{$attachment->id}"; + + if (!file_exists($fileName)) { + throw new NotFound(); + } + + if ($attachment->get('type')) { + header('Content-Type: ' . $attachment->get('type')); + } + + header('Pragma: public'); + header('Content-Length: ' . filesize($fileName)); + ob_clean(); + flush(); + readfile($fileName); + exit; + } } diff --git a/application/Espo/EntryPoints/Download.php b/application/Espo/EntryPoints/Download.php index 99a5ef0ef5..5fdd7573da 100644 --- a/application/Espo/EntryPoints/Download.php +++ b/application/Espo/EntryPoints/Download.php @@ -28,59 +28,59 @@ use \Espo\Core\Exceptions\BadRequest; class Download extends \Espo\Core\EntryPoints\Base { - public static $authRequired = true; - - protected $fileTypesToShowInline = array( - 'application/pdf', - ); - - public function run() - { - $id = $_GET['id']; - if (empty($id)) { - throw new BadRequest(); - } - - $attachment = $this->getEntityManager()->getEntity('Attachment', $id); - - if (!$attachment) { - throw new NotFound(); - } - - if ($attachment->get('parentId') && $attachment->get('parentType')) { - $parent = $this->getEntityManager()->getEntity($attachment->get('parentType'), $attachment->get('parentId')); - if (!$this->getAcl()->check($parent)) { - throw new Forbidden(); - } - } - - $fileName = "data/upload/{$attachment->id}"; - - if (!file_exists($fileName)) { - throw new NotFound(); - } - - $type = $attachment->get('type'); - - $disposition = 'attachment'; - if (in_array($type, $this->fileTypesToShowInline)) { - $disposition = 'inline'; - } - - - header('Content-Description: File Transfer'); - if ($type) { - header('Content-Type: ' . $type); - } - header('Content-Disposition: ' . $disposition . '; filename=' . $attachment->get('name')); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - header('Content-Length: ' . filesize($fileName)); - ob_clean(); - flush(); - readfile($fileName); - exit; - } + public static $authRequired = true; + + protected $fileTypesToShowInline = array( + 'application/pdf', + ); + + public function run() + { + $id = $_GET['id']; + if (empty($id)) { + throw new BadRequest(); + } + + $attachment = $this->getEntityManager()->getEntity('Attachment', $id); + + if (!$attachment) { + throw new NotFound(); + } + + if ($attachment->get('parentId') && $attachment->get('parentType')) { + $parent = $this->getEntityManager()->getEntity($attachment->get('parentType'), $attachment->get('parentId')); + if (!$this->getAcl()->check($parent)) { + throw new Forbidden(); + } + } + + $fileName = "data/upload/{$attachment->id}"; + + if (!file_exists($fileName)) { + throw new NotFound(); + } + + $type = $attachment->get('type'); + + $disposition = 'attachment'; + if (in_array($type, $this->fileTypesToShowInline)) { + $disposition = 'inline'; + } + + + header('Content-Description: File Transfer'); + if ($type) { + header('Content-Type: ' . $type); + } + header('Content-Disposition: ' . $disposition . '; filename=' . $attachment->get('name')); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + header('Content-Length: ' . filesize($fileName)); + ob_clean(); + flush(); + readfile($fileName); + exit; + } } diff --git a/application/Espo/EntryPoints/Image.php b/application/Espo/EntryPoints/Image.php index 976a768ce0..eb356615ab 100644 --- a/application/Espo/EntryPoints/Image.php +++ b/application/Espo/EntryPoints/Image.php @@ -29,166 +29,166 @@ use \Espo\Core\Exceptions\Error; class Image extends \Espo\Core\EntryPoints\Base { - public static $authRequired = true; - - protected $allowedFileTypes = array( - 'image/jpeg', - 'image/png', - 'image/gif', - ); - - protected $imageSizes = array( - 'x-small' => array(64, 64), - 'small' => array(128, 128), - 'medium' => array(256, 256), - 'large' => array(512, 512), - 'x-large' => array(864, 864), - 'xx-large' => array(1024, 1024), - ); - - - public function run() - { - $id = $_GET['id']; - if (empty($id)) { - throw new BadRequest(); - } - - $size = null; - if (!empty($_GET['size'])) { - $size = $_GET['size']; - } - - $this->show($id, $size); - } - - protected function show($id, $size) - { - $attachment = $this->getEntityManager()->getEntity('Attachment', $id); - - if (!$attachment) { - throw new NotFound(); - } - - if ($attachment->get('parentId') && $attachment->get('parentType')) { - $parent = $this->getEntityManager()->getEntity($attachment->get('parentType'), $attachment->get('parentId')); - if ($parent && !$this->getAcl()->check($parent)) { - throw new Forbidden(); - } - } - - $filePath = "data/upload/{$attachment->id}"; - - $fileType = $attachment->get('type'); - - if (!file_exists($filePath)) { - throw new NotFound(); - } - - if (!in_array($fileType, $this->allowedFileTypes)) { - throw new Error(); - } - - if (!empty($size)) { - if (!empty($this->imageSizes[$size])) { - $thumbFilePath = "data/upload/thumbs/{$attachment->id}_{$size}"; - - if (!file_exists($thumbFilePath)) { - $targetImage = $this->getThumbImage($filePath, $fileType, $size); - ob_start(); - - switch ($fileType) { - case 'image/jpeg': - imagejpeg($targetImage); - break; - case 'image/png': - imagepng($targetImage); - break; - case 'image/gif': - imagegif($targetImage); - break; - } - $contents = ob_get_contents(); - ob_end_clean(); - imagedestroy($targetImage); - $this->getContainer()->get('fileManager')->putContents($thumbFilePath, $contents); - } - $filePath = $thumbFilePath; - - } else { - throw new Error(); - } - } - - if (!empty($size)) { - $fileName = $attachment->id . '_' . $size . '.jpg'; - } else { - $fileName = $attachment->get('name'); - } - header('Content-Disposition:inline;filename="'.$fileName.'"'); - if (!empty($fileType)) { - header('Content-Type: ' . $fileType); - } - header('Pragma: public'); - $fileSize = filesize($filePath); - if ($fileSize) { - header('Content-Length: ' . $fileSize); - } - ob_clean(); - flush(); - readfile($filePath); - exit; - } - - protected function getThumbImage($filePath, $fileType, $size) - { - list($originalWidth, $originalHeight) = getimagesize($filePath); - list($width, $height) = $this->imageSizes[$size]; - - - if ($originalWidth <= $width && $originalHeight <= $height) { - $targetWidth = $originalWidth; - $targetHeight = $originalHeight; - } else { - if ($originalWidth > $originalHeight) { - $targetWidth = $width; - $targetHeight = $originalHeight / ($originalWidth / $width); - if ($targetHeight > $height) { - $targetHeight = $height; - $targetWidth = $originalWidth / ($originalHeight / $height); - } - } else { - $targetHeight = $height; - $targetWidth = $originalWidth / ($originalHeight / $height); - if ($targetWidth > $width) { - $targetWidth = $width; - $targetHeight = $originalHeight / ($originalWidth / $width); - } - } - } - - $targetImage = imagecreatetruecolor($targetWidth, $targetHeight); - switch ($fileType) { - case 'image/jpeg': - $sourceImage = imagecreatefromjpeg($filePath); - imagecopyresized($targetImage, $sourceImage, 0, 0, 0, 0, $targetWidth, $targetHeight, $originalWidth, $originalHeight); - break; - case 'image/png': - $sourceImage = imagecreatefrompng($filePath); - imagealphablending($targetImage, false); - imagesavealpha($targetImage, true); - $transparent = imagecolorallocatealpha($targetImage, 255, 255, 255, 127); - imagefilledrectangle($targetImage, 0, 0, $targetWidth, $targetHeight, $transparent); - imagecopyresampled($targetImage, $sourceImage, 0, 0, 0, 0, $targetWidth, $targetHeight, $originalWidth, $originalHeight); - break; - case 'image/gif': - $sourceImage = imagecreatefromgif($filePath); - imagecopyresized($targetImage, $sourceImage, 0, 0, 0, 0, $targetWidth, $targetHeight, $originalWidth, $originalHeight); - break; - } - - - return $targetImage; - } + public static $authRequired = true; + + protected $allowedFileTypes = array( + 'image/jpeg', + 'image/png', + 'image/gif', + ); + + protected $imageSizes = array( + 'x-small' => array(64, 64), + 'small' => array(128, 128), + 'medium' => array(256, 256), + 'large' => array(512, 512), + 'x-large' => array(864, 864), + 'xx-large' => array(1024, 1024), + ); + + + public function run() + { + $id = $_GET['id']; + if (empty($id)) { + throw new BadRequest(); + } + + $size = null; + if (!empty($_GET['size'])) { + $size = $_GET['size']; + } + + $this->show($id, $size); + } + + protected function show($id, $size) + { + $attachment = $this->getEntityManager()->getEntity('Attachment', $id); + + if (!$attachment) { + throw new NotFound(); + } + + if ($attachment->get('parentId') && $attachment->get('parentType')) { + $parent = $this->getEntityManager()->getEntity($attachment->get('parentType'), $attachment->get('parentId')); + if ($parent && !$this->getAcl()->check($parent)) { + throw new Forbidden(); + } + } + + $filePath = "data/upload/{$attachment->id}"; + + $fileType = $attachment->get('type'); + + if (!file_exists($filePath)) { + throw new NotFound(); + } + + if (!in_array($fileType, $this->allowedFileTypes)) { + throw new Error(); + } + + if (!empty($size)) { + if (!empty($this->imageSizes[$size])) { + $thumbFilePath = "data/upload/thumbs/{$attachment->id}_{$size}"; + + if (!file_exists($thumbFilePath)) { + $targetImage = $this->getThumbImage($filePath, $fileType, $size); + ob_start(); + + switch ($fileType) { + case 'image/jpeg': + imagejpeg($targetImage); + break; + case 'image/png': + imagepng($targetImage); + break; + case 'image/gif': + imagegif($targetImage); + break; + } + $contents = ob_get_contents(); + ob_end_clean(); + imagedestroy($targetImage); + $this->getContainer()->get('fileManager')->putContents($thumbFilePath, $contents); + } + $filePath = $thumbFilePath; + + } else { + throw new Error(); + } + } + + if (!empty($size)) { + $fileName = $attachment->id . '_' . $size . '.jpg'; + } else { + $fileName = $attachment->get('name'); + } + header('Content-Disposition:inline;filename="'.$fileName.'"'); + if (!empty($fileType)) { + header('Content-Type: ' . $fileType); + } + header('Pragma: public'); + $fileSize = filesize($filePath); + if ($fileSize) { + header('Content-Length: ' . $fileSize); + } + ob_clean(); + flush(); + readfile($filePath); + exit; + } + + protected function getThumbImage($filePath, $fileType, $size) + { + list($originalWidth, $originalHeight) = getimagesize($filePath); + list($width, $height) = $this->imageSizes[$size]; + + + if ($originalWidth <= $width && $originalHeight <= $height) { + $targetWidth = $originalWidth; + $targetHeight = $originalHeight; + } else { + if ($originalWidth > $originalHeight) { + $targetWidth = $width; + $targetHeight = $originalHeight / ($originalWidth / $width); + if ($targetHeight > $height) { + $targetHeight = $height; + $targetWidth = $originalWidth / ($originalHeight / $height); + } + } else { + $targetHeight = $height; + $targetWidth = $originalWidth / ($originalHeight / $height); + if ($targetWidth > $width) { + $targetWidth = $width; + $targetHeight = $originalHeight / ($originalWidth / $width); + } + } + } + + $targetImage = imagecreatetruecolor($targetWidth, $targetHeight); + switch ($fileType) { + case 'image/jpeg': + $sourceImage = imagecreatefromjpeg($filePath); + imagecopyresized($targetImage, $sourceImage, 0, 0, 0, 0, $targetWidth, $targetHeight, $originalWidth, $originalHeight); + break; + case 'image/png': + $sourceImage = imagecreatefrompng($filePath); + imagealphablending($targetImage, false); + imagesavealpha($targetImage, true); + $transparent = imagecolorallocatealpha($targetImage, 255, 255, 255, 127); + imagefilledrectangle($targetImage, 0, 0, $targetWidth, $targetHeight, $transparent); + imagecopyresampled($targetImage, $sourceImage, 0, 0, 0, 0, $targetWidth, $targetHeight, $originalWidth, $originalHeight); + break; + case 'image/gif': + $sourceImage = imagecreatefromgif($filePath); + imagecopyresized($targetImage, $sourceImage, 0, 0, 0, 0, $targetWidth, $targetHeight, $originalWidth, $originalHeight); + break; + } + + + return $targetImage; + } } diff --git a/application/Espo/EntryPoints/LogoImage.php b/application/Espo/EntryPoints/LogoImage.php index b332bd64ee..f0573739bc 100644 --- a/application/Espo/EntryPoints/LogoImage.php +++ b/application/Espo/EntryPoints/LogoImage.php @@ -29,24 +29,24 @@ use \Espo\Core\Exceptions\Error; class LogoImage extends Image { - public static $authRequired = false; - - public function run() - { - $this->imageSizes['small-logo'] = array(173, 38); - - $id = $this->getConfig()->get('companyLogoId'); - - if (empty($id)) { - throw new NotFound(); - } - - $size = null; - if (!empty($_GET['size'])) { - $size = $_GET['size']; - } - - $this->show($id, $size); - } + public static $authRequired = false; + + public function run() + { + $this->imageSizes['small-logo'] = array(173, 38); + + $id = $this->getConfig()->get('companyLogoId'); + + if (empty($id)) { + throw new NotFound(); + } + + $size = null; + if (!empty($_GET['size'])) { + $size = $_GET['size']; + } + + $this->show($id, $size); + } } diff --git a/application/Espo/Hooks/Common/AssignmentEmailNotification.php b/application/Espo/Hooks/Common/AssignmentEmailNotification.php index 4191222c62..34f422231b 100644 --- a/application/Espo/Hooks/Common/AssignmentEmailNotification.php +++ b/application/Espo/Hooks/Common/AssignmentEmailNotification.php @@ -25,34 +25,34 @@ namespace Espo\Hooks\Common; use Espo\ORM\Entity; class AssignmentEmailNotification extends \Espo\Core\Hooks\Base -{ - - public function afterSave(Entity $entity) - { - if ( - $this->getConfig()->get('assignmentEmailNotifications') - && - in_array($entity->getEntityName(), $this->getConfig()->get('assignmentEmailNotificationsEntityList', array())) - ) { - - $userId = $entity->get('assignedUserId'); - if (!empty($userId) && $userId != $this->getUser()->id && $entity->isFieldChanged('assignedUserId')) { - $job = $this->getEntityManager()->getEntity('Job'); - $job->set(array( - 'serviceName' => 'EmailNotification', - 'method' => 'notifyAboutAssignmentJob', - 'data' => json_encode(array( - 'userId' => $userId, - 'assignerUserId' => $this->getUser()->id, - 'entityId' => $entity->id, - 'entityType' => $entity->getEntityName() - )), - 'executeTime' => date('Y-m-d H:i:s'), - )); - $this->getEntityManager()->saveEntity($job); - } - } - } +{ + + public function afterSave(Entity $entity) + { + if ( + $this->getConfig()->get('assignmentEmailNotifications') + && + in_array($entity->getEntityName(), $this->getConfig()->get('assignmentEmailNotificationsEntityList', array())) + ) { + + $userId = $entity->get('assignedUserId'); + if (!empty($userId) && $userId != $this->getUser()->id && $entity->isFieldChanged('assignedUserId')) { + $job = $this->getEntityManager()->getEntity('Job'); + $job->set(array( + 'serviceName' => 'EmailNotification', + 'method' => 'notifyAboutAssignmentJob', + 'data' => json_encode(array( + 'userId' => $userId, + 'assignerUserId' => $this->getUser()->id, + 'entityId' => $entity->id, + 'entityType' => $entity->getEntityName() + )), + 'executeTime' => date('Y-m-d H:i:s'), + )); + $this->getEntityManager()->saveEntity($job); + } + } + } } diff --git a/application/Espo/Hooks/Common/Stream.php b/application/Espo/Hooks/Common/Stream.php index 362ecae555..6845c99a2c 100644 --- a/application/Espo/Hooks/Common/Stream.php +++ b/application/Espo/Hooks/Common/Stream.php @@ -26,142 +26,142 @@ use Espo\ORM\Entity; class Stream extends \Espo\Core\Hooks\Base { - protected $streamService = null; - - protected $auditedFieldsCache = array(); - - protected $statusDefs = array( - 'Lead' => 'status', - 'Case' => 'status', - 'Opportunity' => 'stage', - ); - - protected function init() - { - $this->dependencies[] = 'serviceFactory'; - } - - protected function getServiceFactory() - { - return $this->getInjection('serviceFactory'); - } - - protected function checkHasStream(Entity $entity) - { - $entityName = $entity->getEntityName(); - return $this->getMetadata()->get("scopes.{$entityName}.stream"); - } - - public function afterRemove(Entity $entity) - { - if ($this->checkHasStream($entity)) { - $this->getStreamService()->unfollowAllUsersFromEntity($entity); - } - } - - protected function isLinkObservableInStream($scope, $link) - { - return $this->getMetadata()->get("scopes.{$scope}.stream") && - in_array($link, $this->getMetadata()->get("entityDefs.Note.streamRelated.{$scope}", array())); - } - - protected function handleCreateRelated(Entity $entity) - { - $linkDefs = $this->getMetadata()->get("entityDefs." . $entity->getEntityName() . ".links", array()); - - $scopeNotifiedList = array(); - foreach ($linkDefs as $link => $defs) { - if ($defs['type'] == 'belongsTo') { - $foreign = $defs['foreign']; - $scope = $defs['entity']; - $entityId = $entity->get($link . 'Id'); - if (!empty($scope) && !empty($entityId)) { - if (in_array($scope, $scopeNotifiedList) || !$this->isLinkObservableInStream($scope, $foreign)) { - continue; - } - $this->getStreamService()->noteCreateRelated($entity, $scope, $entityId); - $scopeNotifiedList[] = $scope; - } - } else if ($defs['type'] == 'belongsToParent') { - $foreign = $defs['foreign']; - $scope = $entity->get($link . 'Type'); - $entityId = $entity->get($link . 'Id'); - if (!empty($scope) && !empty($entityId)) { - if (in_array($scope, $scopeNotifiedList) || !$this->isLinkObservableInStream($scope, $foreign)) { - continue; - } - $this->getStreamService()->noteCreateRelated($entity, $scope, $entityId); - $scopeNotifiedList[] = $scope; - - } - } else if ($defs['type'] == 'hasMany') { - $foreign = $defs['foreign']; - $scope = $defs['entity']; - $entityIds = $entity->get($link . 'Ids'); - if (!empty($scope) && is_array($entityIds) && !empty($entityIds)) { - if (in_array($scope, $scopeNotifiedList) || !$this->isLinkObservableInStream($scope, $foreign)) { - continue; - } - $entityId = $entityIds[0]; - $this->getStreamService()->noteCreateRelated($entity, $scope, $entityId); - $scopeNotifiedList[] = $scope; - } - } - } - } - - public function afterSave(Entity $entity) - { - $entityName = $entity->getEntityName(); - - if ($this->checkHasStream($entity)) { - if (!$entity->isFetched()) { - - $assignedUserId = $entity->get('assignedUserId'); - $createdById = $entity->get('createdById'); - - if (!empty($createdById)) { - $this->getStreamService()->followEntity($entity, $createdById); - } - - if (!empty($assignedUserId) && $createdById != $assignedUserId) { - $this->getStreamService()->followEntity($entity, $assignedUserId); - } - $this->getStreamService()->noteCreate($entity); - - } else { - if ($entity->isFieldChanged('assignedUserId')) { - $assignedUserId = $entity->get('assignedUserId'); - if (!empty($assignedUserId)) { - $this->getStreamService()->followEntity($entity, $assignedUserId); - $this->getStreamService()->noteAssign($entity); - } - } - $this->getStreamService()->handleAudited($entity); - - if (array_key_exists($entityName, $this->statusDefs)) { - $field = $this->statusDefs[$entityName]; - $value = $entity->get($field); - if (!empty($value) && $value != $entity->getFetched($field)) { - $this->getStreamService()->noteStatus($entity, $field); - } - } - } + protected $streamService = null; + + protected $auditedFieldsCache = array(); + + protected $statusDefs = array( + 'Lead' => 'status', + 'Case' => 'status', + 'Opportunity' => 'stage', + ); + + protected function init() + { + $this->dependencies[] = 'serviceFactory'; + } + + protected function getServiceFactory() + { + return $this->getInjection('serviceFactory'); + } + + protected function checkHasStream(Entity $entity) + { + $entityName = $entity->getEntityName(); + return $this->getMetadata()->get("scopes.{$entityName}.stream"); + } + + public function afterRemove(Entity $entity) + { + if ($this->checkHasStream($entity)) { + $this->getStreamService()->unfollowAllUsersFromEntity($entity); + } + } + + protected function isLinkObservableInStream($scope, $link) + { + return $this->getMetadata()->get("scopes.{$scope}.stream") && + in_array($link, $this->getMetadata()->get("entityDefs.Note.streamRelated.{$scope}", array())); + } + + protected function handleCreateRelated(Entity $entity) + { + $linkDefs = $this->getMetadata()->get("entityDefs." . $entity->getEntityName() . ".links", array()); + + $scopeNotifiedList = array(); + foreach ($linkDefs as $link => $defs) { + if ($defs['type'] == 'belongsTo') { + $foreign = $defs['foreign']; + $scope = $defs['entity']; + $entityId = $entity->get($link . 'Id'); + if (!empty($scope) && !empty($entityId)) { + if (in_array($scope, $scopeNotifiedList) || !$this->isLinkObservableInStream($scope, $foreign)) { + continue; + } + $this->getStreamService()->noteCreateRelated($entity, $scope, $entityId); + $scopeNotifiedList[] = $scope; + } + } else if ($defs['type'] == 'belongsToParent') { + $foreign = $defs['foreign']; + $scope = $entity->get($link . 'Type'); + $entityId = $entity->get($link . 'Id'); + if (!empty($scope) && !empty($entityId)) { + if (in_array($scope, $scopeNotifiedList) || !$this->isLinkObservableInStream($scope, $foreign)) { + continue; + } + $this->getStreamService()->noteCreateRelated($entity, $scope, $entityId); + $scopeNotifiedList[] = $scope; + + } + } else if ($defs['type'] == 'hasMany') { + $foreign = $defs['foreign']; + $scope = $defs['entity']; + $entityIds = $entity->get($link . 'Ids'); + if (!empty($scope) && is_array($entityIds) && !empty($entityIds)) { + if (in_array($scope, $scopeNotifiedList) || !$this->isLinkObservableInStream($scope, $foreign)) { + continue; + } + $entityId = $entityIds[0]; + $this->getStreamService()->noteCreateRelated($entity, $scope, $entityId); + $scopeNotifiedList[] = $scope; + } + } + } + } + + public function afterSave(Entity $entity) + { + $entityName = $entity->getEntityName(); + + if ($this->checkHasStream($entity)) { + if (!$entity->isFetched()) { + + $assignedUserId = $entity->get('assignedUserId'); + $createdById = $entity->get('createdById'); + + if (!empty($createdById)) { + $this->getStreamService()->followEntity($entity, $createdById); + } + + if (!empty($assignedUserId) && $createdById != $assignedUserId) { + $this->getStreamService()->followEntity($entity, $assignedUserId); + } + $this->getStreamService()->noteCreate($entity); + + } else { + if ($entity->isFieldChanged('assignedUserId')) { + $assignedUserId = $entity->get('assignedUserId'); + if (!empty($assignedUserId)) { + $this->getStreamService()->followEntity($entity, $assignedUserId); + $this->getStreamService()->noteAssign($entity); + } + } + $this->getStreamService()->handleAudited($entity); + + if (array_key_exists($entityName, $this->statusDefs)) { + $field = $this->statusDefs[$entityName]; + $value = $entity->get($field); + if (!empty($value) && $value != $entity->getFetched($field)) { + $this->getStreamService()->noteStatus($entity, $field); + } + } + } - } - - if (!$entity->isFetched() && $this->getMetadata()->get("scopes.{$entityName}.tab")) { - $this->handleCreateRelated($entity); - } - } - - protected function getStreamService() - { - if (empty($this->streamService)) { - $this->streamService = $this->getServiceFactory()->create('Stream'); - } - return $this->streamService; - } + } + + if (!$entity->isFetched() && $this->getMetadata()->get("scopes.{$entityName}.tab")) { + $this->handleCreateRelated($entity); + } + } + + protected function getStreamService() + { + if (empty($this->streamService)) { + $this->streamService = $this->getServiceFactory()->create('Stream'); + } + return $this->streamService; + } } diff --git a/application/Espo/Hooks/Note/Mentions.php b/application/Espo/Hooks/Note/Mentions.php index aca031423b..c0ce229b80 100644 --- a/application/Espo/Hooks/Note/Mentions.php +++ b/application/Espo/Hooks/Note/Mentions.php @@ -26,84 +26,84 @@ use Espo\ORM\Entity; class Mentions extends \Espo\Core\Hooks\Base { - public static $order = 9; - - protected $notificationService = null; - - protected function init() - { - $this->dependencies[] = 'serviceFactory'; - } - - protected function getServiceFactory() - { - return $this->getInjection('serviceFactory'); - } - - protected function addMentionData($entity) - { - $post = $entity->get('post'); - - $mentionData = new \stdClass(); - - $previousMentionList = array(); - if ($entity->isFetched()) { - $data = $entity->get('data'); - if (!empty($data) && !empty($data->mentions)) { - $previousMentionList = array_keys(get_object_vars($data->mentions)); - } - } - - preg_match_all('/(@\w+)/', $post, $matches); - - if (is_array($matches) && !empty($matches[0]) && is_array($matches[0])) { - foreach ($matches[0] as $item) { - $userName = substr($item, 1); - $user = $this->getEntityManager()->getRepository('User')->where(array('userName' => $userName))->findOne(); - if ($user) { - $m = array( - 'id' => $user->id, - 'name' => $user->get('name'), - 'userName' => $user->get('userName'), - '_scope' => $user->getEntityName() - ); - $mentionData->$item = (object) $m; - if (!in_array($item, $previousMentionList)) { - $this->notifyAboutMention($entity, $user); - } - } - } - } - - $data = $entity->get('data'); - if (empty($data)) { - $data = new \stdClass(); - } - $data->mentions = $mentionData; - - $entity->set('data', $data); - } - - public function beforeSave(Entity $entity) - { - if ($entity->get('type') == 'Post') { - $post = $entity->get('post'); - - $this->addMentionData($entity); - } - } - - protected function notifyAboutMention(Entity $entity, \Espo\Entities\User $user) - { - $this->getNotificationService()->notifyAboutMentionInPost($user->id, $entity->id); - } - - protected function getNotificationService() - { - if (empty($this->notificationService)) { - $this->notificationService = $this->getServiceFactory()->create('Notification'); - } - return $this->notificationService; - } + public static $order = 9; + + protected $notificationService = null; + + protected function init() + { + $this->dependencies[] = 'serviceFactory'; + } + + protected function getServiceFactory() + { + return $this->getInjection('serviceFactory'); + } + + protected function addMentionData($entity) + { + $post = $entity->get('post'); + + $mentionData = new \stdClass(); + + $previousMentionList = array(); + if ($entity->isFetched()) { + $data = $entity->get('data'); + if (!empty($data) && !empty($data->mentions)) { + $previousMentionList = array_keys(get_object_vars($data->mentions)); + } + } + + preg_match_all('/(@\w+)/', $post, $matches); + + if (is_array($matches) && !empty($matches[0]) && is_array($matches[0])) { + foreach ($matches[0] as $item) { + $userName = substr($item, 1); + $user = $this->getEntityManager()->getRepository('User')->where(array('userName' => $userName))->findOne(); + if ($user) { + $m = array( + 'id' => $user->id, + 'name' => $user->get('name'), + 'userName' => $user->get('userName'), + '_scope' => $user->getEntityName() + ); + $mentionData->$item = (object) $m; + if (!in_array($item, $previousMentionList)) { + $this->notifyAboutMention($entity, $user); + } + } + } + } + + $data = $entity->get('data'); + if (empty($data)) { + $data = new \stdClass(); + } + $data->mentions = $mentionData; + + $entity->set('data', $data); + } + + public function beforeSave(Entity $entity) + { + if ($entity->get('type') == 'Post') { + $post = $entity->get('post'); + + $this->addMentionData($entity); + } + } + + protected function notifyAboutMention(Entity $entity, \Espo\Entities\User $user) + { + $this->getNotificationService()->notifyAboutMentionInPost($user->id, $entity->id); + } + + protected function getNotificationService() + { + if (empty($this->notificationService)) { + $this->notificationService = $this->getServiceFactory()->create('Notification'); + } + return $this->notificationService; + } } diff --git a/application/Espo/Hooks/Note/Notifications.php b/application/Espo/Hooks/Note/Notifications.php index 4d59d77e9d..b4c8d1485b 100644 --- a/application/Espo/Hooks/Note/Notifications.php +++ b/application/Espo/Hooks/Note/Notifications.php @@ -26,80 +26,80 @@ use Espo\ORM\Entity; class Notifications extends \Espo\Core\Hooks\Base { - protected $notificationService = null; - - public static $order = 14; - - protected function init() - { - $this->dependencies[] = 'serviceFactory'; - } - - protected function getServiceFactory() - { - return $this->getInjection('serviceFactory'); - } - - protected function getMentionedUserList($entity) - { - $mentionedUserList = array(); - $data = $entity->get('data'); - if (($data instanceof \stdClass) && ($data->mentions instanceof \stdClass)) { - $mentions = get_object_vars($data->mentions); - foreach ($mentions as $d) { - $mentionedUserList[] = $d->id; - } - } - return $mentionedUserList; - } - - public function afterSave(Entity $entity) - { - if (!$entity->isFetched()) { + protected $notificationService = null; + + public static $order = 14; + + protected function init() + { + $this->dependencies[] = 'serviceFactory'; + } + + protected function getServiceFactory() + { + return $this->getInjection('serviceFactory'); + } + + protected function getMentionedUserList($entity) + { + $mentionedUserList = array(); + $data = $entity->get('data'); + if (($data instanceof \stdClass) && ($data->mentions instanceof \stdClass)) { + $mentions = get_object_vars($data->mentions); + foreach ($mentions as $d) { + $mentionedUserList[] = $d->id; + } + } + return $mentionedUserList; + } + + public function afterSave(Entity $entity) + { + if (!$entity->isFetched()) { - $parentType = $entity->get('parentType'); - $parentId = $entity->get('parentId'); - - if ($parentType && $parentId) { + $parentType = $entity->get('parentType'); + $parentId = $entity->get('parentId'); + + if ($parentType && $parentId) { - $mentionedUserList = $this->getMentionedUserList($entity); - - $pdo = $this->getEntityManager()->getPDO(); - $sql = " - SELECT user_id AS userId - FROM subscription - WHERE entity_id = " . $pdo->quote($parentId) . " AND entity_type = " . $pdo->quote($parentType); - $sth = $pdo->prepare($sql); - $sth->execute(); - $userIdList = array(); - while ($row = $sth->fetch(\PDO::FETCH_ASSOC)) { - if ($this->getUser()->id != $row['userId'] && !in_array($row['userId'], $mentionedUserList)) { - $userIdList[] = $row['userId']; - } - } - if (!empty($userIdList)) { - $job = $this->getEntityManager()->getEntity('Job'); - $job->set(array( - 'serviceName' => 'Notification', - 'method' => 'notifyAboutNoteFromJob', - 'data' => array( - 'userIdList' => $userIdList, - 'noteId' => $entity->id - ), - 'executeTime' => date('Y-m-d H:i:s'), - )); - $this->getEntityManager()->saveEntity($job); - } - } - } - } - - protected function getNotificationService() - { - if (empty($this->notificationService)) { - $this->notificationService = $this->getServiceFactory()->create('Notification'); - } - return $this->notificationService; - } + $mentionedUserList = $this->getMentionedUserList($entity); + + $pdo = $this->getEntityManager()->getPDO(); + $sql = " + SELECT user_id AS userId + FROM subscription + WHERE entity_id = " . $pdo->quote($parentId) . " AND entity_type = " . $pdo->quote($parentType); + $sth = $pdo->prepare($sql); + $sth->execute(); + $userIdList = array(); + while ($row = $sth->fetch(\PDO::FETCH_ASSOC)) { + if ($this->getUser()->id != $row['userId'] && !in_array($row['userId'], $mentionedUserList)) { + $userIdList[] = $row['userId']; + } + } + if (!empty($userIdList)) { + $job = $this->getEntityManager()->getEntity('Job'); + $job->set(array( + 'serviceName' => 'Notification', + 'method' => 'notifyAboutNoteFromJob', + 'data' => array( + 'userIdList' => $userIdList, + 'noteId' => $entity->id + ), + 'executeTime' => date('Y-m-d H:i:s'), + )); + $this->getEntityManager()->saveEntity($job); + } + } + } + } + + protected function getNotificationService() + { + if (empty($this->notificationService)) { + $this->notificationService = $this->getServiceFactory()->create('Notification'); + } + return $this->notificationService; + } } diff --git a/application/Espo/Modules/Crm/Business/CaseDistribution/LeastBusy.php b/application/Espo/Modules/Crm/Business/CaseDistribution/LeastBusy.php index 03d20264e3..a1beea5ba0 100644 --- a/application/Espo/Modules/Crm/Business/CaseDistribution/LeastBusy.php +++ b/application/Espo/Modules/Crm/Business/CaseDistribution/LeastBusy.php @@ -24,52 +24,52 @@ namespace Espo\Modules\Crm\Business\CaseDistribution; class LeastBusy { - protected $entityManager; - - public function __construct($entityManager) - { - $this->entityManager = $entityManager; - } - - protected function getEntityManager() - { - return $this->entityManager; - } - - public function getUser($team) - { - $userList = $team->get('users'); - if (count($userList) == 0) { - return false; - } - - $countHash = array(); - - foreach ($userList as $user) { - $count = $this->getEntityManager()->getRepository('Case')->where(array( - 'assignedUserId' => $user->id, - 'status<>' => array('Closed', 'Rejected', 'Duplicated') - ))->count(); - $countHash[$user->id] = $count; - } - - $foundUserId = false; - $min = false; - foreach ($countHash as $userId => $count) { - if ($min === false) { - $min = $count; - $foundUserId = $userId; - } else { - if ($count < $min) { - $min = $clunt; - $foundUserId = $userId; - } - } - } - - if ($foundUserId !== false) { - return $this->getEntityManager()->getEntity('User', $foundUserId); - } - } + protected $entityManager; + + public function __construct($entityManager) + { + $this->entityManager = $entityManager; + } + + protected function getEntityManager() + { + return $this->entityManager; + } + + public function getUser($team) + { + $userList = $team->get('users'); + if (count($userList) == 0) { + return false; + } + + $countHash = array(); + + foreach ($userList as $user) { + $count = $this->getEntityManager()->getRepository('Case')->where(array( + 'assignedUserId' => $user->id, + 'status<>' => array('Closed', 'Rejected', 'Duplicated') + ))->count(); + $countHash[$user->id] = $count; + } + + $foundUserId = false; + $min = false; + foreach ($countHash as $userId => $count) { + if ($min === false) { + $min = $count; + $foundUserId = $userId; + } else { + if ($count < $min) { + $min = $clunt; + $foundUserId = $userId; + } + } + } + + if ($foundUserId !== false) { + return $this->getEntityManager()->getEntity('User', $foundUserId); + } + } } diff --git a/application/Espo/Modules/Crm/Business/CaseDistribution/RoundRobin.php b/application/Espo/Modules/Crm/Business/CaseDistribution/RoundRobin.php index 788281ca5e..f22aa544b4 100644 --- a/application/Espo/Modules/Crm/Business/CaseDistribution/RoundRobin.php +++ b/application/Espo/Modules/Crm/Business/CaseDistribution/RoundRobin.php @@ -24,48 +24,48 @@ namespace Espo\Modules\Crm\Business\CaseDistribution; class RoundRobin { - protected $entityManager; - - public function __construct($entityManager) - { - $this->entityManager = $entityManager; - } - - protected function getEntityManager() - { - return $this->entityManager; - } - - public function getUser($team) - { - $userList = $team->get('users'); - if (count($userList) == 0) { - return false; - } - - $userIdList = array(); - - foreach ($userList as $user) { - $userIdList[] = $user->id; - } - - - $case = $this->getEntityManager()->getRepository('Case')->where(array( - 'assignedUserId' => $userIdList, - ))->order('createdAt', 'DESC')->findOne(); - - if (empty($case)) { - $num = 0; - } else { - $num = array_search($case->get('assignedUserId'), $userIdList); - if ($num === false || $num == count($userIdList) - 1) { - $num = 0; - } else { - $num++; - } - } - - return $this->getEntityManager()->getEntity('User', $userIdList[$num]); - } + protected $entityManager; + + public function __construct($entityManager) + { + $this->entityManager = $entityManager; + } + + protected function getEntityManager() + { + return $this->entityManager; + } + + public function getUser($team) + { + $userList = $team->get('users'); + if (count($userList) == 0) { + return false; + } + + $userIdList = array(); + + foreach ($userList as $user) { + $userIdList[] = $user->id; + } + + + $case = $this->getEntityManager()->getRepository('Case')->where(array( + 'assignedUserId' => $userIdList, + ))->order('createdAt', 'DESC')->findOne(); + + if (empty($case)) { + $num = 0; + } else { + $num = array_search($case->get('assignedUserId'), $userIdList); + if ($num === false || $num == count($userIdList) - 1) { + $num = 0; + } else { + $num++; + } + } + + return $this->getEntityManager()->getEntity('User', $userIdList[$num]); + } } diff --git a/application/Espo/Modules/Crm/Business/Event/Ics.php b/application/Espo/Modules/Crm/Business/Event/Ics.php index 76ca43a904..e6fcc4a4ec 100644 --- a/application/Espo/Modules/Crm/Business/Event/Ics.php +++ b/application/Espo/Modules/Crm/Business/Event/Ics.php @@ -4,172 +4,172 @@ namespace Espo\Modules\Crm\Business\Event; class Ics { - private $_d_end; + private $_d_end; - private $_d_start; + private $_d_start; - private $_s_address; + private $_s_address; - private $_s_description; + private $_s_description; - private $_s_html; - - private $_s_who; - - private $_s_email; + private $_s_html; + + private $_s_who; + + private $_s_email; - private $_s_uri; - - private $_s_uid; + private $_s_uri; + + private $_s_uid; - private $_s_summary; + private $_s_summary; - private $_s_output; + private $_s_output; - private $_s_prodid; - - public function __construct($prodid, array $attributes = array()) - { - if (!is_string($prodid) || $prodid === '') { - throw new \Exception('PRODID is required'); - } + private $_s_prodid; + + public function __construct($prodid, array $attributes = array()) + { + if (!is_string($prodid) || $prodid === '') { + throw new \Exception('PRODID is required'); + } - $this->_s_prodid = $prodid; + $this->_s_prodid = $prodid; - foreach ($attributes as $key => $value) { - $this->$key = $value; - } - } - - public function __set($name, $value) - { - switch ($name) { - case 'startDate': - $this->_d_start = $value; - break; + foreach ($attributes as $key => $value) { + $this->$key = $value; + } + } + + public function __set($name, $value) + { + switch ($name) { + case 'startDate': + $this->_d_start = $value; + break; - case 'endDate': - $this->_d_end = $value; - break; + case 'endDate': + $this->_d_end = $value; + break; - case 'address': - $this->_s_address = $value; - break; + case 'address': + $this->_s_address = $value; + break; - case 'summary': - $this->_s_summary = $value; - break; - - case 'who': - $this->_s_who = $value; - break; - - case 'email': - $this->_s_email = $value; - break; + case 'summary': + $this->_s_summary = $value; + break; + + case 'who': + $this->_s_who = $value; + break; + + case 'email': + $this->_s_email = $value; + break; - case 'uri': - $this->_s_uri = $value; - break; - - case 'uid': - $this->_s_uid = $value; - break; + case 'uri': + $this->_s_uri = $value; + break; + + case 'uid': + $this->_s_uid = $value; + break; - case 'description': - $this->_s_description = $value; - break; + case 'description': + $this->_s_description = $value; + break; - case 'html': - $this->_s_html = $value; - break; - } + case 'html': + $this->_s_html = $value; + break; + } - return $this; - } - - public function __get($name) { - switch ($name) - { - case 'startDate': - return $this->_d_start; - break; + return $this; + } + + public function __get($name) { + switch ($name) + { + case 'startDate': + return $this->_d_start; + break; - case 'endDate': - return $this->_d_end; - break; + case 'endDate': + return $this->_d_end; + break; - case 'address': - return $this->_s_address; - break; + case 'address': + return $this->_s_address; + break; - case 'summary': - return $this->_s_summary; - break; + case 'summary': + return $this->_s_summary; + break; - case 'uri': - return $this->_s_uri; - break; - - case 'who': - return $this->_s_who; - break; - - case 'email': - return $this->_s_email; - break; - - case 'uid': - return $this->_s_uid; - break; + case 'uri': + return $this->_s_uri; + break; + + case 'who': + return $this->_s_who; + break; + + case 'email': + return $this->_s_email; + break; + + case 'uid': + return $this->_s_uid; + break; - case 'description': - return $this->_s_description; - break; + case 'description': + return $this->_s_description; + break; - case 'html': - return $this->_s_html; - break; - } - } - - public function get() - { - ($this->_s_output) ? $this->_s_output : $this->_generate(); + case 'html': + return $this->_s_html; + break; + } + } + + public function get() + { + ($this->_s_output) ? $this->_s_output : $this->_generate(); - return $this->_s_output; - } - - private function _generate() - { - $this->_s_output = "BEGIN:VCALENDAR\n". - "VERSION:2.0\n". - "PRODID:-".$this->_s_prodid."\n". - "METHOD:REQUEST\n". - "BEGIN:VEVENT\n". - "DTSTART:".$this->_dateToCal($this->startDate)."\n". - "DTEND:".$this->_dateToCal($this->endDate)."\n". - "SUMMARY:New ".$this->_escapeString($this->summary)."\n". - "LOCATION:".$this->_escapeString($this->address)."\n". - "ORGANIZER;CN=".$this->_escapeString($this->who).":MAILTO:" . $this->_escapeString($this->email)."\n". - "DESCRIPTION:".$this->_escapeString($this->description)."\n". - "X-ALT-DESC;FMTTYPE=text/html:".$this->_escapeString($this->html)."\n". - "URL;VALUE=URI:".$this->_escapeString($this->uri)."\n". - "UID:".$this->uid."\n". - "SEQUENCE:0\n". - "DTSTAMP:".$this->_dateToCal(time())."\n". - "END:VEVENT\n". - "END:VCALENDAR\n"; - } - - private function _dateToCal($timestamp) - { - return date('Ymd\THis\Z', ($timestamp) ? $timestamp : time()); - } + return $this->_s_output; + } + + private function _generate() + { + $this->_s_output = "BEGIN:VCALENDAR\n". + "VERSION:2.0\n". + "PRODID:-".$this->_s_prodid."\n". + "METHOD:REQUEST\n". + "BEGIN:VEVENT\n". + "DTSTART:".$this->_dateToCal($this->startDate)."\n". + "DTEND:".$this->_dateToCal($this->endDate)."\n". + "SUMMARY:New ".$this->_escapeString($this->summary)."\n". + "LOCATION:".$this->_escapeString($this->address)."\n". + "ORGANIZER;CN=".$this->_escapeString($this->who).":MAILTO:" . $this->_escapeString($this->email)."\n". + "DESCRIPTION:".$this->_escapeString($this->description)."\n". + "X-ALT-DESC;FMTTYPE=text/html:".$this->_escapeString($this->html)."\n". + "URL;VALUE=URI:".$this->_escapeString($this->uri)."\n". + "UID:".$this->uid."\n". + "SEQUENCE:0\n". + "DTSTAMP:".$this->_dateToCal(time())."\n". + "END:VEVENT\n". + "END:VCALENDAR\n"; + } + + private function _dateToCal($timestamp) + { + return date('Ymd\THis\Z', ($timestamp) ? $timestamp : time()); + } - private function _escapeString($string) - { - return preg_replace('/([\,;])/','\\\$1', ($string) ? $string : ''); - } + private function _escapeString($string) + { + return preg_replace('/([\,;])/','\\\$1', ($string) ? $string : ''); + } } diff --git a/application/Espo/Modules/Crm/Business/Event/Invitations.php b/application/Espo/Modules/Crm/Business/Event/Invitations.php index ee042db6c5..f58c7fe804 100644 --- a/application/Espo/Modules/Crm/Business/Event/Invitations.php +++ b/application/Espo/Modules/Crm/Business/Event/Invitations.php @@ -6,126 +6,126 @@ use \Espo\ORM\Entity; class Invitations { - protected $entityManager; - - protected $mailSender; - - protected $config; - - protected $dateTime; - - protected $language; - - protected $fileManager; - - protected $ics; - - public function __construct($entityManager, $mailSender, $config, $dateTime, $language, $fileManager) - { - $this->entityManager = $entityManager; - $this->mailSender = $mailSender; - $this->config = $config; - $this->dateTime = $dateTime; - $this->language = $language; - $this->fileManager = $fileManager; - } - - protected function getEntityManager() - { - return $this->entityManager; - } - - protected function parseInvitationTemplate($contents, $entity, $invitee = null, $uid = null) - { - $contents = str_replace('{name}', $entity->get('name'), $contents); - $contents = str_replace('{eventType}', strtolower($this->language->translate($entity->getEntityName(), 'scopeNames')), $contents); - $contents = str_replace('{dateStart}', $this->dateTime->convertSystemDateTimeToGlobal($entity->get('dateStart')), $contents); - if ($invitee) { - $contents = str_replace('{inviteeName}', $invitee->get('name'), $contents); - } - if ($uid) { - $siteUrl = rtrim($this->config->get('siteUrl'), '/'); - $contents = str_replace('{acceptLink}', $siteUrl . '?entryPoint=eventConfirmation&action=accept&uid=' . $uid->get('name'), $contents); - $contents = str_replace('{declineLink}', $siteUrl . '?entryPoint=eventConfirmation&action=decline&uid=' . $uid->get('name'), $contents); - } - return $contents; - } - - public function sendInvitation(Entity $entity, Entity $invitee, $link) - { - $uid = $this->getEntityManager()->getEntity('UniqueId'); - $uid->set('data', json_encode(array( - 'eventType' => $entity->getEntityName(), - 'eventId' => $entity->id, - 'inviteeId' => $invitee->id, - 'inviteeType' => $invitee->getEntityName(), - 'link' => $link - ))); - $this->getEntityManager()->saveEntity($uid); + protected $entityManager; + + protected $mailSender; + + protected $config; + + protected $dateTime; + + protected $language; + + protected $fileManager; + + protected $ics; + + public function __construct($entityManager, $mailSender, $config, $dateTime, $language, $fileManager) + { + $this->entityManager = $entityManager; + $this->mailSender = $mailSender; + $this->config = $config; + $this->dateTime = $dateTime; + $this->language = $language; + $this->fileManager = $fileManager; + } + + protected function getEntityManager() + { + return $this->entityManager; + } + + protected function parseInvitationTemplate($contents, $entity, $invitee = null, $uid = null) + { + $contents = str_replace('{name}', $entity->get('name'), $contents); + $contents = str_replace('{eventType}', strtolower($this->language->translate($entity->getEntityName(), 'scopeNames')), $contents); + $contents = str_replace('{dateStart}', $this->dateTime->convertSystemDateTimeToGlobal($entity->get('dateStart')), $contents); + if ($invitee) { + $contents = str_replace('{inviteeName}', $invitee->get('name'), $contents); + } + if ($uid) { + $siteUrl = rtrim($this->config->get('siteUrl'), '/'); + $contents = str_replace('{acceptLink}', $siteUrl . '?entryPoint=eventConfirmation&action=accept&uid=' . $uid->get('name'), $contents); + $contents = str_replace('{declineLink}', $siteUrl . '?entryPoint=eventConfirmation&action=decline&uid=' . $uid->get('name'), $contents); + } + return $contents; + } + + public function sendInvitation(Entity $entity, Entity $invitee, $link) + { + $uid = $this->getEntityManager()->getEntity('UniqueId'); + $uid->set('data', json_encode(array( + 'eventType' => $entity->getEntityName(), + 'eventId' => $entity->id, + 'inviteeId' => $invitee->id, + 'inviteeType' => $invitee->getEntityName(), + 'link' => $link + ))); + $this->getEntityManager()->saveEntity($uid); - $email = $this->getEntityManager()->getEntity('Email'); - $email->set('to', $invitee->get('emailAddress')); + $email = $this->getEntityManager()->getEntity('Email'); + $email->set('to', $invitee->get('emailAddress')); - $subjectTplFileName = 'custom/Espo/Custom/Resources/templates/InvitationSubject.tpl'; - if (!file_exists($subjectTplFileName)) { - $subjectTplFileName = 'application/Espo/Modules/Crm/Resources/templates/InvitationSubject.tpl'; - } - $subjectTpl = file_get_contents($subjectTplFileName); + $subjectTplFileName = 'custom/Espo/Custom/Resources/templates/InvitationSubject.tpl'; + if (!file_exists($subjectTplFileName)) { + $subjectTplFileName = 'application/Espo/Modules/Crm/Resources/templates/InvitationSubject.tpl'; + } + $subjectTpl = file_get_contents($subjectTplFileName); - $bodyTplFileName = 'custom/Espo/Custom/Resources/templates/InvitationBody.tpl'; - if (!file_exists($bodyTplFileName)) { - $bodyTplFileName = 'application/Espo/Modules/Crm/Resources/templates/InvitationBody.tpl'; - } - $bodyTpl = file_get_contents($bodyTplFileName); + $bodyTplFileName = 'custom/Espo/Custom/Resources/templates/InvitationBody.tpl'; + if (!file_exists($bodyTplFileName)) { + $bodyTplFileName = 'application/Espo/Modules/Crm/Resources/templates/InvitationBody.tpl'; + } + $bodyTpl = file_get_contents($bodyTplFileName); - $subject = $this->parseInvitationTemplate($subjectTpl, $entity, $invitee, $uid); - $subject = str_replace(array("\n", "\r"), '', $subject); - - $body = $this->parseInvitationTemplate($bodyTpl, $entity, $invitee, $uid); + $subject = $this->parseInvitationTemplate($subjectTpl, $entity, $invitee, $uid); + $subject = str_replace(array("\n", "\r"), '', $subject); + + $body = $this->parseInvitationTemplate($bodyTpl, $entity, $invitee, $uid); - $email->set('subject', $subject); - $email->set('body', $body); - $email->set('isHtml', true); - $this->getEntityManager()->saveEntity($email); - - $attachment = $this->getEntityManager()->getEntity('Attachment'); - $attachment->set(array( - 'name' => 'event.ics', - 'type' => 'text/calendar', - 'contents' => $this->getIscContents($entity), - )); - - $email->addAttachment($attachment); + $email->set('subject', $subject); + $email->set('body', $body); + $email->set('isHtml', true); + $this->getEntityManager()->saveEntity($email); + + $attachment = $this->getEntityManager()->getEntity('Attachment'); + $attachment->set(array( + 'name' => 'event.ics', + 'type' => 'text/calendar', + 'contents' => $this->getIscContents($entity), + )); + + $email->addAttachment($attachment); - $emailSender = $this->mailSender; - $emailSender->send($email); - - $this->getEntityManager()->removeEntity($email); - } - - protected function getIscContents(Entity $entity) - { - $user = $entity->get('assignedUser'); - - $who = ''; - $email = ''; - if ($user) { - $who = $user->get('name'); - $email = $user->get('emailAddress'); - } - - $ics = new Ics('//EspoCRM//EspoCRM Calendar//EN', array( - 'startDate' => strtotime($entity->get('dateStart')), - 'endDate' => strtotime($entity->get('dateEnd')), - 'uid' => $entity->id, - 'summary' => $entity->get('name'), - 'who' => $who, - 'email' => $email, - 'description' => $entity->get('description'), - )); - - return $ics->get(); - } - + $emailSender = $this->mailSender; + $emailSender->send($email); + + $this->getEntityManager()->removeEntity($email); + } + + protected function getIscContents(Entity $entity) + { + $user = $entity->get('assignedUser'); + + $who = ''; + $email = ''; + if ($user) { + $who = $user->get('name'); + $email = $user->get('emailAddress'); + } + + $ics = new Ics('//EspoCRM//EspoCRM Calendar//EN', array( + 'startDate' => strtotime($entity->get('dateStart')), + 'endDate' => strtotime($entity->get('dateEnd')), + 'uid' => $entity->id, + 'summary' => $entity->get('name'), + 'who' => $who, + 'email' => $email, + 'description' => $entity->get('description'), + )); + + return $ics->get(); + } + } diff --git a/application/Espo/Modules/Crm/Controllers/Activities.php b/application/Espo/Modules/Crm/Controllers/Activities.php index 458a54384f..09151b6094 100644 --- a/application/Espo/Modules/Crm/Controllers/Activities.php +++ b/application/Espo/Modules/Crm/Controllers/Activities.php @@ -23,60 +23,60 @@ namespace Espo\Modules\Crm\Controllers; use \Espo\Core\Exceptions\Error, - \Espo\Core\Exceptions\Forbidden, - \Espo\Core\Exceptions\BadRequest; + \Espo\Core\Exceptions\Forbidden, + \Espo\Core\Exceptions\BadRequest; class Activities extends \Espo\Core\Controllers\Base { - public static $defaultAction = 'index'; - - public function actionListCalendarEvents($params, $data, $request) - { - $from = $request->get('from'); - $to = $request->get('to'); - - if (empty($from) || empty($to)) { - throw new BadRequest(); - } - - - $service = $this->getService('Activities'); - return $service->getEvents($this->getUser()->id, $from, $to); - } + public static $defaultAction = 'index'; + + public function actionListCalendarEvents($params, $data, $request) + { + $from = $request->get('from'); + $to = $request->get('to'); + + if (empty($from) || empty($to)) { + throw new BadRequest(); + } + + + $service = $this->getService('Activities'); + return $service->getEvents($this->getUser()->id, $from, $to); + } - public function actionList($params, $data, $request) - { - $name = $params['name']; - - if (!in_array($name, array('activities', 'history'))) { - throw new BadRequest(); - } - - $entityName = $params['scope']; - $id = $params['id']; - - $offset = intval($request->get('offset')); - $maxSize = intval($request->get('maxSize')); - $asc = $request->get('asc') === 'true'; - $sortBy = $request->get('sortBy'); - $where = $request->get('where'); - - $scope = null; - if (!empty($where) && !empty($where['scope']) && $where['scope'] !== 'false') { - $scope = $where['scope']; - } - - $service = $this->getService('Activities'); + public function actionList($params, $data, $request) + { + $name = $params['name']; + + if (!in_array($name, array('activities', 'history'))) { + throw new BadRequest(); + } + + $entityName = $params['scope']; + $id = $params['id']; + + $offset = intval($request->get('offset')); + $maxSize = intval($request->get('maxSize')); + $asc = $request->get('asc') === 'true'; + $sortBy = $request->get('sortBy'); + $where = $request->get('where'); + + $scope = null; + if (!empty($where) && !empty($where['scope']) && $where['scope'] !== 'false') { + $scope = $where['scope']; + } + + $service = $this->getService('Activities'); - $methodName = 'get' . ucfirst($name); - - return $service->$methodName($entityName, $id, array( - 'scope' => $scope, - 'offset' => $offset, - 'maxSize' => $maxSize, - 'asc' => $asc, - 'sortBy' => $sortBy, - )); - } + $methodName = 'get' . ucfirst($name); + + return $service->$methodName($entityName, $id, array( + 'scope' => $scope, + 'offset' => $offset, + 'maxSize' => $maxSize, + 'asc' => $asc, + 'sortBy' => $sortBy, + )); + } } diff --git a/application/Espo/Modules/Crm/Controllers/Call.php b/application/Espo/Modules/Crm/Controllers/Call.php index d664c225e6..4124913784 100644 --- a/application/Espo/Modules/Crm/Controllers/Call.php +++ b/application/Espo/Modules/Crm/Controllers/Call.php @@ -29,23 +29,23 @@ use \Espo\Core\Exceptions\NotFound; class Call extends \Espo\Core\Controllers\Record { - public function actionSendInvitations($params, $data) - { - if (empty($data['id'])) { - throw new BadRequest(); - } - - $entity = $this->getRecordService()->getEntity($data['id']); - - if (!$entity) { - throw new NotFound(); - } - - if (!$this->getAcl()->check($entity, 'edit')) { - throw new Forbidden(); - } - - return $this->getRecordService()->sendInvitations($entity); - } + public function actionSendInvitations($params, $data) + { + if (empty($data['id'])) { + throw new BadRequest(); + } + + $entity = $this->getRecordService()->getEntity($data['id']); + + if (!$entity) { + throw new NotFound(); + } + + if (!$this->getAcl()->check($entity, 'edit')) { + throw new Forbidden(); + } + + return $this->getRecordService()->sendInvitations($entity); + } } diff --git a/application/Espo/Modules/Crm/Controllers/CaseObj.php b/application/Espo/Modules/Crm/Controllers/CaseObj.php index 9b11dda50d..879e8b97d0 100644 --- a/application/Espo/Modules/Crm/Controllers/CaseObj.php +++ b/application/Espo/Modules/Crm/Controllers/CaseObj.php @@ -24,6 +24,6 @@ namespace Espo\Modules\Crm\Controllers; class CaseObj extends \Espo\Core\Controllers\Record { - protected $name = 'Case'; + protected $name = 'Case'; } diff --git a/application/Espo/Modules/Crm/Controllers/InboundEmail.php b/application/Espo/Modules/Crm/Controllers/InboundEmail.php index 8f47587aa0..5698ea5566 100644 --- a/application/Espo/Modules/Crm/Controllers/InboundEmail.php +++ b/application/Espo/Modules/Crm/Controllers/InboundEmail.php @@ -24,24 +24,24 @@ namespace Espo\Modules\Crm\Controllers; class InboundEmail extends \Espo\Core\Controllers\Record { - protected function checkControllerAccess() - { - if (!$this->getUser()->isAdmin()) { - throw new Forbidden(); - } - } - - public function actionGetFolders($params, $data, $request) - { - return $this->getRecordService()->getFolders(array( - 'host' => $request->get('host'), - 'port' => $request->get('port'), - 'ssl' => $request->get('ssl'), - 'username' => $request->get('username'), - 'password' => $request->get('password'), - 'id' => $request->get('id') - )); + protected function checkControllerAccess() + { + if (!$this->getUser()->isAdmin()) { + throw new Forbidden(); + } + } + + public function actionGetFolders($params, $data, $request) + { + return $this->getRecordService()->getFolders(array( + 'host' => $request->get('host'), + 'port' => $request->get('port'), + 'ssl' => $request->get('ssl'), + 'username' => $request->get('username'), + 'password' => $request->get('password'), + 'id' => $request->get('id') + )); - } + } } diff --git a/application/Espo/Modules/Crm/Controllers/Lead.php b/application/Espo/Modules/Crm/Controllers/Lead.php index 4e9dae9b94..4fec44aa8b 100644 --- a/application/Espo/Modules/Crm/Controllers/Lead.php +++ b/application/Espo/Modules/Crm/Controllers/Lead.php @@ -27,16 +27,16 @@ use \Espo\Core\Exceptions\BadRequest; class Lead extends \Espo\Core\Controllers\Record { - public function actionConvert($params, $data) - { - if (empty($data['id'])) { - throw new BadRequest(); - } - $entity = $this->getRecordService()->convert($data['id'], $data['records']); - - if (!empty($entity)) { - return $entity->toArray(); - } - throw new Error(); - } + public function actionConvert($params, $data) + { + if (empty($data['id'])) { + throw new BadRequest(); + } + $entity = $this->getRecordService()->convert($data['id'], $data['records']); + + if (!empty($entity)) { + return $entity->toArray(); + } + throw new Error(); + } } diff --git a/application/Espo/Modules/Crm/Controllers/Meeting.php b/application/Espo/Modules/Crm/Controllers/Meeting.php index d3aa4ce1aa..35e3492e91 100644 --- a/application/Espo/Modules/Crm/Controllers/Meeting.php +++ b/application/Espo/Modules/Crm/Controllers/Meeting.php @@ -27,25 +27,25 @@ use \Espo\Core\Exceptions\BadRequest; use \Espo\Core\Exceptions\NotFound; class Meeting extends \Espo\Core\Controllers\Record -{ - - public function actionSendInvitations($params, $data) - { - if (empty($data['id'])) { - throw new BadRequest(); - } - - $entity = $this->getRecordService()->getEntity($data['id']); - - if (!$entity) { - throw new NotFound(); - } - - if (!$this->getAcl()->check($entity, 'edit')) { - throw new Forbidden(); - } - - return $this->getRecordService()->sendInvitations($entity); - } +{ + + public function actionSendInvitations($params, $data) + { + if (empty($data['id'])) { + throw new BadRequest(); + } + + $entity = $this->getRecordService()->getEntity($data['id']); + + if (!$entity) { + throw new NotFound(); + } + + if (!$this->getAcl()->check($entity, 'edit')) { + throw new Forbidden(); + } + + return $this->getRecordService()->sendInvitations($entity); + } } diff --git a/application/Espo/Modules/Crm/Controllers/Opportunity.php b/application/Espo/Modules/Crm/Controllers/Opportunity.php index 180bf15349..d0b2387d82 100644 --- a/application/Espo/Modules/Crm/Controllers/Opportunity.php +++ b/application/Espo/Modules/Crm/Controllers/Opportunity.php @@ -24,36 +24,36 @@ namespace Espo\Modules\Crm\Controllers; class Opportunity extends \Espo\Core\Controllers\Record { - public function actionReportByLeadSource($params, $data, $request) - { - $dateFrom = $request->get('dateFrom'); - $dateTo = $request->get('dateTo'); - - return $this->getService('Opportunity')->reportByLeadSource($dateFrom, $dateTo); - } - - public function actionReportByStage($params, $data, $request) - { - $dateFrom = $request->get('dateFrom'); - $dateTo = $request->get('dateTo'); - - return $this->getService('Opportunity')->reportByStage($dateFrom, $dateTo); - } - - public function actionReportSalesByMonth($params, $data, $request) - { - $dateFrom = $request->get('dateFrom'); - $dateTo = $request->get('dateTo'); - - return $this->getService('Opportunity')->reportSalesByMonth($dateFrom, $dateTo); - } - - public function actionReportSalesPipeline($params, $data, $request) - { - $dateFrom = $request->get('dateFrom'); - $dateTo = $request->get('dateTo'); - - return $this->getService('Opportunity')->reportSalesPipeline($dateFrom, $dateTo); - } + public function actionReportByLeadSource($params, $data, $request) + { + $dateFrom = $request->get('dateFrom'); + $dateTo = $request->get('dateTo'); + + return $this->getService('Opportunity')->reportByLeadSource($dateFrom, $dateTo); + } + + public function actionReportByStage($params, $data, $request) + { + $dateFrom = $request->get('dateFrom'); + $dateTo = $request->get('dateTo'); + + return $this->getService('Opportunity')->reportByStage($dateFrom, $dateTo); + } + + public function actionReportSalesByMonth($params, $data, $request) + { + $dateFrom = $request->get('dateFrom'); + $dateTo = $request->get('dateTo'); + + return $this->getService('Opportunity')->reportSalesByMonth($dateFrom, $dateTo); + } + + public function actionReportSalesPipeline($params, $data, $request) + { + $dateFrom = $request->get('dateFrom'); + $dateTo = $request->get('dateTo'); + + return $this->getService('Opportunity')->reportSalesPipeline($dateFrom, $dateTo); + } } diff --git a/application/Espo/Modules/Crm/Controllers/Target.php b/application/Espo/Modules/Crm/Controllers/Target.php index 031f82534a..0b18f87586 100644 --- a/application/Espo/Modules/Crm/Controllers/Target.php +++ b/application/Espo/Modules/Crm/Controllers/Target.php @@ -24,22 +24,22 @@ namespace Espo\Modules\Crm\Controllers; use \Espo\Core\Exceptions\Error; use \Espo\Core\Exceptions\BadRequest; - + class Target extends \Espo\Core\Controllers\Record { - - public function actionConvert($params, $data) - { - - if (empty($data['id'])) { - throw new BadRequest(); - } - $entity = $this->getRecordService()->convert($data['id']); - - if (!empty($entity)) { - return $entity->toArray(); - } - throw new Error(); - } + + public function actionConvert($params, $data) + { + + if (empty($data['id'])) { + throw new BadRequest(); + } + $entity = $this->getRecordService()->convert($data['id']); + + if (!empty($entity)) { + return $entity->toArray(); + } + throw new Error(); + } } diff --git a/application/Espo/Modules/Crm/Entities/CaseObj.php b/application/Espo/Modules/Crm/Entities/CaseObj.php index 2444e82f8b..d3308aa380 100644 --- a/application/Espo/Modules/Crm/Entities/CaseObj.php +++ b/application/Espo/Modules/Crm/Entities/CaseObj.php @@ -25,6 +25,6 @@ namespace Espo\Modules\Crm\Entities; class CaseObj extends \Espo\Core\ORM\Entity { - protected $entityName = 'Case'; + protected $entityName = 'Case'; } diff --git a/application/Espo/Modules/Crm/Entities/Target.php b/application/Espo/Modules/Crm/Entities/Target.php index 0c710b22bd..214c88d7ea 100644 --- a/application/Espo/Modules/Crm/Entities/Target.php +++ b/application/Espo/Modules/Crm/Entities/Target.php @@ -24,6 +24,6 @@ namespace Espo\Modules\Crm\Entities; class Target extends \Espo\Core\Entities\Person { - + } diff --git a/application/Espo/Modules/Crm/EntryPoints/EventConfirmation.php b/application/Espo/Modules/Crm/EntryPoints/EventConfirmation.php index 4a540c6607..6964fc1da7 100644 --- a/application/Espo/Modules/Crm/EntryPoints/EventConfirmation.php +++ b/application/Espo/Modules/Crm/EntryPoints/EventConfirmation.php @@ -31,66 +31,66 @@ use \Espo\Core\Exceptions\Error; class EventConfirmation extends \Espo\Core\EntryPoints\Base { - public static $authRequired = false; - - public function run() - { - $uid = $_GET['uid']; - $action = $_GET['action']; - if (empty($uid) || empty($action)) { - throw new BadRequest(); - } - - if (!in_array($action, array('accept', 'decline'))) { - throw new BadRequest(); - } - - $uniqueId = $this->getEntityManager()->getRepository('UniqueId')->where(array('name' => $uid))->findOne(); - - if (!$uniqueId) { - throw new NotFound(); - return; - } - - $data = json_decode($uniqueId->get('data')); - - $eventType = $data->eventType; - $eventId = $data->eventId; - $inviteeType = $data->inviteeType; - $inviteeId = $data->inviteeId; - $link = $data->link; - - if (!empty($eventType) && !empty($eventId) && !empty($inviteeType) && !empty($inviteeId) && !empty($link)) { - $event = $this->getEntityManager()->getEntity($eventType, $eventId); - $invitee = $this->getEntityManager()->getEntity($inviteeType, $inviteeId); - if ($event && $invitee) { - $relDefs = $event->getRelations(); - $tableName = Util::toUnderscore($relDefs[$link]['relationName']); - - $status = 'None'; - if ($action == 'accept') { - $status = 'Accepted'; - } else if ($action == 'decline') { - $status = 'Declined'; - } - - $pdo = $this->getEntityManager()->getPDO(); - $sql = " - UPDATE `{$tableName}` SET status = '{$status}' - WHERE ".strtolower($eventType)."_id = '{$eventId}' AND ".strtolower($inviteeType)."_id = '{$inviteeId}' - "; + public static $authRequired = false; + + public function run() + { + $uid = $_GET['uid']; + $action = $_GET['action']; + if (empty($uid) || empty($action)) { + throw new BadRequest(); + } + + if (!in_array($action, array('accept', 'decline'))) { + throw new BadRequest(); + } + + $uniqueId = $this->getEntityManager()->getRepository('UniqueId')->where(array('name' => $uid))->findOne(); + + if (!$uniqueId) { + throw new NotFound(); + return; + } + + $data = json_decode($uniqueId->get('data')); + + $eventType = $data->eventType; + $eventId = $data->eventId; + $inviteeType = $data->inviteeType; + $inviteeId = $data->inviteeId; + $link = $data->link; + + if (!empty($eventType) && !empty($eventId) && !empty($inviteeType) && !empty($inviteeId) && !empty($link)) { + $event = $this->getEntityManager()->getEntity($eventType, $eventId); + $invitee = $this->getEntityManager()->getEntity($inviteeType, $inviteeId); + if ($event && $invitee) { + $relDefs = $event->getRelations(); + $tableName = Util::toUnderscore($relDefs[$link]['relationName']); + + $status = 'None'; + if ($action == 'accept') { + $status = 'Accepted'; + } else if ($action == 'decline') { + $status = 'Declined'; + } + + $pdo = $this->getEntityManager()->getPDO(); + $sql = " + UPDATE `{$tableName}` SET status = '{$status}' + WHERE ".strtolower($eventType)."_id = '{$eventId}' AND ".strtolower($inviteeType)."_id = '{$inviteeId}' + "; - $sth = $pdo->prepare($sql); - $sth->execute(); - - $this->getEntityManager()->getRepository('UniqueId')->remove($uniqueId); - - echo $status; - return; - } - } - - throw new Error(); - } + $sth = $pdo->prepare($sql); + $sth->execute(); + + $this->getEntityManager()->getRepository('UniqueId')->remove($uniqueId); + + echo $status; + return; + } + } + + throw new Error(); + } } diff --git a/application/Espo/Modules/Crm/Jobs/CheckInboundEmails.php b/application/Espo/Modules/Crm/Jobs/CheckInboundEmails.php index e4481f2a46..37481d313f 100644 --- a/application/Espo/Modules/Crm/Jobs/CheckInboundEmails.php +++ b/application/Espo/Modules/Crm/Jobs/CheckInboundEmails.php @@ -26,25 +26,25 @@ use \Espo\Core\Exceptions; class CheckInboundEmails extends \Espo\Core\Jobs\Base { - public function run() - { - $service = $this->getServiceFactory()->create('InboundEmail'); - $collection = $this->getEntityManager()->getRepository('InboundEmail')->where(array('status' => 'Active'))->find(); - foreach ($collection as $entity) { - try { - $service->fetchFromMailServer($entity); - } catch (\Exception $e) {} - } - - $service = $this->getServiceFactory()->create('EmailAccount'); - $collection = $this->getEntityManager()->getRepository('EmailAccount')->where(array('status' => 'Active'))->find(); - foreach ($collection as $entity) { - try { - $service->fetchFromMailServer($entity); - } catch (\Exception $e) {} - } - - return true; - } + public function run() + { + $service = $this->getServiceFactory()->create('InboundEmail'); + $collection = $this->getEntityManager()->getRepository('InboundEmail')->where(array('status' => 'Active'))->find(); + foreach ($collection as $entity) { + try { + $service->fetchFromMailServer($entity); + } catch (\Exception $e) {} + } + + $service = $this->getServiceFactory()->create('EmailAccount'); + $collection = $this->getEntityManager()->getRepository('EmailAccount')->where(array('status' => 'Active'))->find(); + foreach ($collection as $entity) { + try { + $service->fetchFromMailServer($entity); + } catch (\Exception $e) {} + } + + return true; + } } diff --git a/application/Espo/Modules/Crm/Repositories/Call.php b/application/Espo/Modules/Crm/Repositories/Call.php index 8801c2401b..d3747be783 100644 --- a/application/Espo/Modules/Crm/Repositories/Call.php +++ b/application/Espo/Modules/Crm/Repositories/Call.php @@ -25,26 +25,26 @@ namespace Espo\Modules\Crm\Repositories; use Espo\ORM\Entity; class Call extends \Espo\Core\ORM\Repositories\RDB -{ - protected function beforeSave(Entity $entity) - { - parent::beforeSave($entity); - - $parentId = $entity->get('parentId'); - $parentType = $entity->get('parentType'); - if (!empty($parentId) || !empty($parentType)) { - $parent = $this->getEntityManager()->getEntity($parentType, $parentId); - if (!empty($parent)) { - if ($parent->getEntityName() == 'Account') { - $accountId = $parent->id; - } else if ($parent->has('accountId')) { - $accountId = $parent->get('accountId'); - } - if (!empty($accountId)) { - $entity->set('accountId', $accountId); - } - } - } - } +{ + protected function beforeSave(Entity $entity) + { + parent::beforeSave($entity); + + $parentId = $entity->get('parentId'); + $parentType = $entity->get('parentType'); + if (!empty($parentId) || !empty($parentType)) { + $parent = $this->getEntityManager()->getEntity($parentType, $parentId); + if (!empty($parent)) { + if ($parent->getEntityName() == 'Account') { + $accountId = $parent->id; + } else if ($parent->has('accountId')) { + $accountId = $parent->get('accountId'); + } + if (!empty($accountId)) { + $entity->set('accountId', $accountId); + } + } + } + } } diff --git a/application/Espo/Modules/Crm/Repositories/Contact.php b/application/Espo/Modules/Crm/Repositories/Contact.php index b7677a2e04..a844fe09d0 100644 --- a/application/Espo/Modules/Crm/Repositories/Contact.php +++ b/application/Espo/Modules/Crm/Repositories/Contact.php @@ -25,71 +25,71 @@ namespace Espo\Modules\Crm\Repositories; use Espo\ORM\Entity; class Contact extends \Espo\Core\ORM\Repositories\RDB -{ - public function handleSelectParams(&$params) - { - parent::handleSelectParams($params); - - if (empty($params['customJoin'])) { - $params['customJoin'] = ''; - } - - $params['customJoin'] .= " - LEFT JOIN `account_contact` AS accountContact - ON accountContact.contact_id = contact.id AND accountContact.account_id = contact.account_id AND accountContact.deleted = 0 - "; - } - - public function save(Entity $entity) - { - $result = parent::save($entity); - - $accountIdChanged = $entity->has('accountId') && $entity->get('accountId') != $entity->getFetched('accountId'); - $titleChanged = $entity->has('title') && $entity->get('title') != $entity->getFetched('title'); - - if ($accountIdChanged) { - $accountId = $entity->get('accountId'); - if (empty($accountId)) { - $this->unrelate($entity, 'accounts', $entity->getFetched('accountId')); - return $result; - } - } - - if ($titleChanged) { - if (empty($accountId)) { - $accountId = $entity->getFetched('accountId'); - if (empty($accountId)) { - return $result; - } - } - } - - - if ($accountIdChanged || $titleChanged) { - $pdo = $this->getEntityManager()->getPDO(); - - $sql = " - SELECT id, role FROM account_contact - WHERE - account_id = ".$pdo->quote($accountId)." AND - contact_id = ".$pdo->quote($entity->id)." AND - deleted = 0 - "; - $sth = $pdo->prepare($sql); - if ($row = $sth->fetch()) { - if ($titleChanged && $entity->get('title') != $row['role']) { - $this->updateRelation($entity, 'accounts', $accountId, array( - 'role' => $entity->get('title') - )); - } - } else { - $this->relate($entity, 'accounts', $accountId, array( - 'role' => $entity->get('title') - )); - } - } - - return $result; - } +{ + public function handleSelectParams(&$params) + { + parent::handleSelectParams($params); + + if (empty($params['customJoin'])) { + $params['customJoin'] = ''; + } + + $params['customJoin'] .= " + LEFT JOIN `account_contact` AS accountContact + ON accountContact.contact_id = contact.id AND accountContact.account_id = contact.account_id AND accountContact.deleted = 0 + "; + } + + public function save(Entity $entity) + { + $result = parent::save($entity); + + $accountIdChanged = $entity->has('accountId') && $entity->get('accountId') != $entity->getFetched('accountId'); + $titleChanged = $entity->has('title') && $entity->get('title') != $entity->getFetched('title'); + + if ($accountIdChanged) { + $accountId = $entity->get('accountId'); + if (empty($accountId)) { + $this->unrelate($entity, 'accounts', $entity->getFetched('accountId')); + return $result; + } + } + + if ($titleChanged) { + if (empty($accountId)) { + $accountId = $entity->getFetched('accountId'); + if (empty($accountId)) { + return $result; + } + } + } + + + if ($accountIdChanged || $titleChanged) { + $pdo = $this->getEntityManager()->getPDO(); + + $sql = " + SELECT id, role FROM account_contact + WHERE + account_id = ".$pdo->quote($accountId)." AND + contact_id = ".$pdo->quote($entity->id)." AND + deleted = 0 + "; + $sth = $pdo->prepare($sql); + if ($row = $sth->fetch()) { + if ($titleChanged && $entity->get('title') != $row['role']) { + $this->updateRelation($entity, 'accounts', $accountId, array( + 'role' => $entity->get('title') + )); + } + } else { + $this->relate($entity, 'accounts', $accountId, array( + 'role' => $entity->get('title') + )); + } + } + + return $result; + } } diff --git a/application/Espo/Modules/Crm/Repositories/Lead.php b/application/Espo/Modules/Crm/Repositories/Lead.php index 401211767b..e5f9b2cc97 100644 --- a/application/Espo/Modules/Crm/Repositories/Lead.php +++ b/application/Espo/Modules/Crm/Repositories/Lead.php @@ -25,8 +25,8 @@ namespace Espo\Modules\Crm\Repositories; use Espo\ORM\Entity; class Lead extends \Espo\Core\ORM\Repositories\RDB -{ - +{ + } diff --git a/application/Espo/Modules/Crm/Repositories/Meeting.php b/application/Espo/Modules/Crm/Repositories/Meeting.php index f9834b38cc..c1591433f1 100644 --- a/application/Espo/Modules/Crm/Repositories/Meeting.php +++ b/application/Espo/Modules/Crm/Repositories/Meeting.php @@ -25,26 +25,26 @@ namespace Espo\Modules\Crm\Repositories; use Espo\ORM\Entity; class Meeting extends \Espo\Core\ORM\Repositories\RDB -{ - protected function beforeSave(Entity $entity) - { - parent::beforeSave($entity); - - $parentId = $entity->get('parentId'); - $parentType = $entity->get('parentType'); - if (!empty($parentId) || !empty($parentType)) { - $parent = $this->getEntityManager()->getEntity($parentType, $parentId); - if (!empty($parent)) { - if ($parent->getEntityName() == 'Account') { - $accountId = $parent->id; - } else if ($parent->has('accountId')) { - $accountId = $parent->get('accountId'); - } - if (!empty($accountId)) { - $entity->set('accountId', $accountId); - } - } - } - } +{ + protected function beforeSave(Entity $entity) + { + parent::beforeSave($entity); + + $parentId = $entity->get('parentId'); + $parentType = $entity->get('parentType'); + if (!empty($parentId) || !empty($parentType)) { + $parent = $this->getEntityManager()->getEntity($parentType, $parentId); + if (!empty($parent)) { + if ($parent->getEntityName() == 'Account') { + $accountId = $parent->id; + } else if ($parent->has('accountId')) { + $accountId = $parent->get('accountId'); + } + if (!empty($accountId)) { + $entity->set('accountId', $accountId); + } + } + } + } } diff --git a/application/Espo/Modules/Crm/Repositories/Opportunity.php b/application/Espo/Modules/Crm/Repositories/Opportunity.php index 70224d1a82..a6325d7b7b 100644 --- a/application/Espo/Modules/Crm/Repositories/Opportunity.php +++ b/application/Espo/Modules/Crm/Repositories/Opportunity.php @@ -25,7 +25,7 @@ namespace Espo\Modules\Crm\Repositories; use Espo\ORM\Entity; class Opportunity extends \Espo\Core\ORM\Repositories\RDB -{ +{ } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Account.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Account.json index 9d5671a504..15b7b5487a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Name", - "emailAddress": "E-Mail", - "website": "Webseite", - "phoneNumber": "Telefon", - "billingAddress": "Rechnungsadresse", - "shippingAddress": "Lieferadresse", - "description": "Beschreibung", - "sicCode": "WKN Nummer", - "industry": "Branche", - "type": "Typ", - "contactRole": "Rolle" - }, - "links": { - "contacts": "Kontakte", - "opportunities": "Verkaufschancen", - "cases": "Fälle" - }, - "options": { - "type": { - "Customer": "Kunde", - "Investor": "Investor", - "Partner": "Partner", - "Reseller": "Wiederverkäufer" - }, - "industry": { - "Apparel": "Bekleidungsindustrie", - "Banking": "Bankwesen", - "Computer Software": "Computer Software", - "Education": "Bildungswesen", - "Electronics": "Elektronik", - "Finance": "Finanzsektor", - "Insurance": "Versicherung" - } - }, - "labels": { - "Create Account": "Neue Firma" - } + "fields": { + "name": "Name", + "emailAddress": "E-Mail", + "website": "Webseite", + "phoneNumber": "Telefon", + "billingAddress": "Rechnungsadresse", + "shippingAddress": "Lieferadresse", + "description": "Beschreibung", + "sicCode": "WKN Nummer", + "industry": "Branche", + "type": "Typ", + "contactRole": "Rolle" + }, + "links": { + "contacts": "Kontakte", + "opportunities": "Verkaufschancen", + "cases": "Fälle" + }, + "options": { + "type": { + "Customer": "Kunde", + "Investor": "Investor", + "Partner": "Partner", + "Reseller": "Wiederverkäufer" + }, + "industry": { + "Apparel": "Bekleidungsindustrie", + "Banking": "Bankwesen", + "Computer Software": "Computer Software", + "Education": "Bildungswesen", + "Electronics": "Elektronik", + "Finance": "Finanzsektor", + "Insurance": "Versicherung" + } + }, + "labels": { + "Create Account": "Neue Firma" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Calendar.json index 64d2c086a1..985360e760 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Monat", - "week": "Woche", - "day": "Tag", - "agendaWeek": "Woche", - "agendaDay": "Tag" - }, - "labels": { - "Today": "Heute", - "Create": "Erstellen" - } + "modes": { + "month": "Monat", + "week": "Woche", + "day": "Tag", + "agendaWeek": "Woche", + "agendaDay": "Tag" + }, + "labels": { + "Today": "Heute", + "Create": "Erstellen" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Call.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Call.json index 35fc013cf1..044c9bedee 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Call.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Name", - "parent": "Bezieht sich auf", - "status": "Status", - "dateStart": "Startdatum", - "dateEnd": "Enddatum", - "direction": "Richtung", - "duration": "Dauer", - "description": "Beschreibung", - "users": "Benutzer", - "contacts": "Kontakte", - "leads": "Interessenten" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Geplant", - "Held": "Durchgeführt", - "Not Held": "Nicht durchgeführt" - }, - "direction": { - "Outbound": "Ausgehend", - "Inbound": "Eingehend" - } - }, - "labels": { - "Create Call": "Neuer Anruf", - "Set Held": "Auf Gehalten setzen", - "Set Not Held": "Auf nicht gehalten setzen", - "Send Invitations": "Einladungen versenden" - }, - "presetFilters": { - "planned": "Geplant", - "held": "Durchgeführt", - "todays": "Heutige" - } + "fields": { + "name": "Name", + "parent": "Bezieht sich auf", + "status": "Status", + "dateStart": "Startdatum", + "dateEnd": "Enddatum", + "direction": "Richtung", + "duration": "Dauer", + "description": "Beschreibung", + "users": "Benutzer", + "contacts": "Kontakte", + "leads": "Interessenten" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Geplant", + "Held": "Durchgeführt", + "Not Held": "Nicht durchgeführt" + }, + "direction": { + "Outbound": "Ausgehend", + "Inbound": "Eingehend" + } + }, + "labels": { + "Create Call": "Neuer Anruf", + "Set Held": "Auf Gehalten setzen", + "Set Not Held": "Auf nicht gehalten setzen", + "Send Invitations": "Einladungen versenden" + }, + "presetFilters": { + "planned": "Geplant", + "held": "Durchgeführt", + "todays": "Heutige" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Case.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Case.json index cb74530b73..e1dddd1572 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Case.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Name", - "number": "Nummer", - "status": "Status", - "account": "Firma", - "contact": "Kontakt", - "priority": "Priorität", - "type": "Typ", - "description": "Beschreibung" - }, - "links": { - }, - "options": { - "status": { - "New": "Neu", - "Assigned": "Zugewiesen", - "Pending": "Schwebend", - "Closed": "Abgeschlossen", - "Rejected": "Abgelehnt", - "Duplicate": "Duplizieren" - }, - "priority" : { - "Low": "Niedrig", - "Normal": "Normal", - "High": "Hoch", - "Urgent": "Dringend" - }, - "type": { - "Question": "Frage", - "Incident": "Vorfall", - "Problem": "Problem" - } - }, - "labels": { - "Create Case": "Neuer Fall" - }, - "presetFilters": { - "open": "Offen", - "closed": "Abgeschlossen" - } + "fields": { + "name": "Name", + "number": "Nummer", + "status": "Status", + "account": "Firma", + "contact": "Kontakt", + "priority": "Priorität", + "type": "Typ", + "description": "Beschreibung" + }, + "links": { + }, + "options": { + "status": { + "New": "Neu", + "Assigned": "Zugewiesen", + "Pending": "Schwebend", + "Closed": "Abgeschlossen", + "Rejected": "Abgelehnt", + "Duplicate": "Duplizieren" + }, + "priority" : { + "Low": "Niedrig", + "Normal": "Normal", + "High": "Hoch", + "Urgent": "Dringend" + }, + "type": { + "Question": "Frage", + "Incident": "Vorfall", + "Problem": "Problem" + } + }, + "labels": { + "Create Case": "Neuer Fall" + }, + "presetFilters": { + "open": "Offen", + "closed": "Abgeschlossen" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Contact.json index f381539646..eaf21384da 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Contact.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Name", - "emailAddress": "E-Mail", - "title": "Funktion", - "account": "Firma", - "accounts": "Firmen", - "phoneNumber": "Telefon", - "accountType": "Firmentyp", - "doNotCall": "Nicht anrufen", - "address": "Adresse", - "opportunityRole": "Verkaufschance Rolle", - "accountRole": "Rolle", - "description": "Beschreibung" - }, - "links": { - "opportunities": "Verkaufschancen", - "cases": "Fälle" - }, - "labels": { - "Create Contact": "Neuer Kontakt" - }, - "options": { - "opportunityRole": { - "": "--Kein(e)--", - "Decision Maker": "Entscheider", - "Evaluator": "Vorentscheider", - "Influencer": "Einflussreiche Person" - } - } + "fields": { + "name": "Name", + "emailAddress": "E-Mail", + "title": "Funktion", + "account": "Firma", + "accounts": "Firmen", + "phoneNumber": "Telefon", + "accountType": "Firmentyp", + "doNotCall": "Nicht anrufen", + "address": "Adresse", + "opportunityRole": "Verkaufschance Rolle", + "accountRole": "Rolle", + "description": "Beschreibung" + }, + "links": { + "opportunities": "Verkaufschancen", + "cases": "Fälle" + }, + "labels": { + "Create Contact": "Neuer Kontakt" + }, + "options": { + "opportunityRole": { + "": "--Kein(e)--", + "Decision Maker": "Entscheider", + "Evaluator": "Vorentscheider", + "Influencer": "Einflussreiche Person" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Document.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Document.json index 70ebe0f6a8..a181eea42f 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Document.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Document.json @@ -1,32 +1,32 @@ { - "labels": { - "Create Document": "Neues Dokument", - "Details": "Details" - }, - "fields": { - "name": "Name", - "status": "Status", - "file": "Datei", - "type": "Typ", - "source": "Quelle", - "publishDate": "Veröffentlichungsdatum", - "expirationDate": "Verfallsdatum", - "description": "Beschreibung" - }, - "links": { - "accounts": "Kontakte", - "opportunities": "Verkaufsshancen" - }, - "options": { - "status": { - "Active": "Aktiv", - "Draft": "Entwurf", - "Expired": "Abgelaufen", - "Canceled": "Storniert" - } - }, - "presetFilters": { - "active": "Aktiv", - "draft": "Entwurf" - } + "labels": { + "Create Document": "Neues Dokument", + "Details": "Details" + }, + "fields": { + "name": "Name", + "status": "Status", + "file": "Datei", + "type": "Typ", + "source": "Quelle", + "publishDate": "Veröffentlichungsdatum", + "expirationDate": "Verfallsdatum", + "description": "Beschreibung" + }, + "links": { + "accounts": "Kontakte", + "opportunities": "Verkaufsshancen" + }, + "options": { + "status": { + "Active": "Aktiv", + "Draft": "Entwurf", + "Expired": "Abgelaufen", + "Canceled": "Storniert" + } + }, + "presetFilters": { + "active": "Aktiv", + "draft": "Entwurf" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Global.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Global.json index e483b79b4f..bcb0343212 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Global.json @@ -1,81 +1,81 @@ { - "scopeNames": { - "Account": "Firma", - "Contact": "Kontakt", - "Lead": "Interessent", - "Target": "Zielkontakt", - "Opportunity": "Verkaufschance", - "Meeting": "Meeting", - "Calendar": "Kalender", - "Call": "Anruf", - "Task": "Aufgabe", - "Case": "Fall", - "InboundEmail": "Eingehende E-Mails" - }, - "scopeNamesPlural": { - "Account": "Firmen", - "Contact": "Kontakte", - "Lead": "Interessenten", - "Target": "Zielkontakte", - "Opportunity": "Verkaufschancen", - "Meeting": "Meetings", - "Calendar": "Kalender", - "Call": "Anrufe", - "Task": "Aufgaben", - "Case": "Fälle", - "InboundEmail": "Eingehende E-Mails" - }, - "dashlets": { - "Leads": "Meine Interessenten", - "Opportunities": "Meine Verkaufschancen", - "Tasks": "Meine Aufgaben", - "Cases": "Meine Fälle", - "Calendar": "Kalender", - "Calls": "Meine Anrufe", - "Meetings": "Meine Meetings", - "OpportunitiesByStage": "Verkaufschancen nach Verkaufsphase", - "OpportunitiesByLeadSource": "Verkaufschancen nach Quelle", - "SalesByMonth": "Umsätze nach Monat", - "SalesPipeline": "Verkaufspipeline" - }, - "labels": { - "Create InboundEmail": "Eingehende E-Mail erstellen", - "Activities": "Aktivitäten", - "History": "Verlauf", - "Attendees": "Teilnehmer", - "Schedule Meeting": "Meeting planen", - "Schedule Call": "Anruf planen", - "Compose Email": "E-Mail erstellen", - "Log Meeting": "Meeting erfassen", - "Log Call": "Anruf erfassen", - "Archive Email": "E-Mail archivieren", - "Create Task": "Neue Aufgabe", - "Tasks": "Aufgaben" - }, - "fields": { - "billingAddressCity": "Ort", - "billingAddressCountry": "Land", - "billingAddressPostalCode": "PLZ", - "billingAddressState": "Bundesland", - "billingAddressStreet": "Straße", - "addressCity": "Ort", - "addressStreet": "Straße", - "addressCountry": "Land", - "addressState": "Bundesland", - "addressPostalCode": "PLZ", - "shippingAddressCity": "Ort (Lieferadresse)", - "shippingAddressStreet": "Straße (Lieferadresse)", - "shippingAddressCountry": "Land (Lieferadresse)", - "shippingAddressState": "Bundesland\/Kanton (Lieferadresse)", - "shippingAddressPostalCode": "PLZ (Lieferadresse)" - }, - "links": { - "contacts": "Kontakte", - "opportunities": "Verkaufschancen", - "leads": "Interessenten", - "meetings": "Meetings", - "calls": "Anrufe", - "tasks": "Aufgaben", - "emails": "E-Mails" - } + "scopeNames": { + "Account": "Firma", + "Contact": "Kontakt", + "Lead": "Interessent", + "Target": "Zielkontakt", + "Opportunity": "Verkaufschance", + "Meeting": "Meeting", + "Calendar": "Kalender", + "Call": "Anruf", + "Task": "Aufgabe", + "Case": "Fall", + "InboundEmail": "Eingehende E-Mails" + }, + "scopeNamesPlural": { + "Account": "Firmen", + "Contact": "Kontakte", + "Lead": "Interessenten", + "Target": "Zielkontakte", + "Opportunity": "Verkaufschancen", + "Meeting": "Meetings", + "Calendar": "Kalender", + "Call": "Anrufe", + "Task": "Aufgaben", + "Case": "Fälle", + "InboundEmail": "Eingehende E-Mails" + }, + "dashlets": { + "Leads": "Meine Interessenten", + "Opportunities": "Meine Verkaufschancen", + "Tasks": "Meine Aufgaben", + "Cases": "Meine Fälle", + "Calendar": "Kalender", + "Calls": "Meine Anrufe", + "Meetings": "Meine Meetings", + "OpportunitiesByStage": "Verkaufschancen nach Verkaufsphase", + "OpportunitiesByLeadSource": "Verkaufschancen nach Quelle", + "SalesByMonth": "Umsätze nach Monat", + "SalesPipeline": "Verkaufspipeline" + }, + "labels": { + "Create InboundEmail": "Eingehende E-Mail erstellen", + "Activities": "Aktivitäten", + "History": "Verlauf", + "Attendees": "Teilnehmer", + "Schedule Meeting": "Meeting planen", + "Schedule Call": "Anruf planen", + "Compose Email": "E-Mail erstellen", + "Log Meeting": "Meeting erfassen", + "Log Call": "Anruf erfassen", + "Archive Email": "E-Mail archivieren", + "Create Task": "Neue Aufgabe", + "Tasks": "Aufgaben" + }, + "fields": { + "billingAddressCity": "Ort", + "billingAddressCountry": "Land", + "billingAddressPostalCode": "PLZ", + "billingAddressState": "Bundesland", + "billingAddressStreet": "Straße", + "addressCity": "Ort", + "addressStreet": "Straße", + "addressCountry": "Land", + "addressState": "Bundesland", + "addressPostalCode": "PLZ", + "shippingAddressCity": "Ort (Lieferadresse)", + "shippingAddressStreet": "Straße (Lieferadresse)", + "shippingAddressCountry": "Land (Lieferadresse)", + "shippingAddressState": "Bundesland\/Kanton (Lieferadresse)", + "shippingAddressPostalCode": "PLZ (Lieferadresse)" + }, + "links": { + "contacts": "Kontakte", + "opportunities": "Verkaufschancen", + "leads": "Interessenten", + "meetings": "Meetings", + "calls": "Anrufe", + "tasks": "Aufgaben", + "emails": "E-Mails" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/InboundEmail.json index a797d12b86..8cb40105ad 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/InboundEmail.json @@ -1,52 +1,52 @@ { - "fields": { - "name": "Name", - "team": "Team", - "status": "Status", - "assignToUser": "Mit Benutzer verknüpfen", - "host": "Host", - "username": "Benutzername", - "password": "Passwort", - "port": "Port", - "monitoredFolders": "Überwachter Ordner", - "trashFolder": "Papierkorb Ordner", - "ssl": "SSL", - "createCase": "Neuer Fall", - "reply": "Antworten", - "caseDistribution": "Fall Verteilung", - "replyEmailTemplate": "Vorlage E-Mail Antwort", - "replyFromAddress": "Von Adresse antworten", - "replyToAddress": "Antwort an Adresse", - "replyFromName": "Von Name antworten" - }, - "tooltips": { - "reply": "Absender informieren dass die E-Mail empfangen wurde.", - "createCase": "Fall aus eingehender E-Mail automatisch erstellen.", - "replyToAddress": "Geben Sie die E-Mail Adresse dieser Mailbox an, um Antworten hier zu empfangen.", - "caseDistribution": "Wie Fälle zugewiesen werden. Entweder direkt dem Benutzer oder im Team.", - "assignToUser": "Benutzer E-Mails\/Fälle werden zugewiesen an", - "team": "Team E-Mails\/Fälle werden verknüpft mit" - }, - "links": { - }, - "options": { - "status": { - "Active": "Aktiv", - "Inactive": "Inaktiv" - }, - "caseDistribution": { - "Direct-Assignment": "Direkte Zuordnung", - "Round-Robin": "Umlauf-Verfahren", - "Least-Busy": "geringste Auslastung" - } - }, - "labels": { - "Create InboundEmail": "Eingehende E-Mail erstellen", - "IMAP": "IMAP", - "Actions": "Aktionen", - "Main": "Wichtig" - }, - "messages": { - "couldNotConnectToImap": "Kann keine Verbindung zum IMAP Server herstellen" - } + "fields": { + "name": "Name", + "team": "Team", + "status": "Status", + "assignToUser": "Mit Benutzer verknüpfen", + "host": "Host", + "username": "Benutzername", + "password": "Passwort", + "port": "Port", + "monitoredFolders": "Überwachter Ordner", + "trashFolder": "Papierkorb Ordner", + "ssl": "SSL", + "createCase": "Neuer Fall", + "reply": "Antworten", + "caseDistribution": "Fall Verteilung", + "replyEmailTemplate": "Vorlage E-Mail Antwort", + "replyFromAddress": "Von Adresse antworten", + "replyToAddress": "Antwort an Adresse", + "replyFromName": "Von Name antworten" + }, + "tooltips": { + "reply": "Absender informieren dass die E-Mail empfangen wurde.", + "createCase": "Fall aus eingehender E-Mail automatisch erstellen.", + "replyToAddress": "Geben Sie die E-Mail Adresse dieser Mailbox an, um Antworten hier zu empfangen.", + "caseDistribution": "Wie Fälle zugewiesen werden. Entweder direkt dem Benutzer oder im Team.", + "assignToUser": "Benutzer E-Mails\/Fälle werden zugewiesen an", + "team": "Team E-Mails\/Fälle werden verknüpft mit" + }, + "links": { + }, + "options": { + "status": { + "Active": "Aktiv", + "Inactive": "Inaktiv" + }, + "caseDistribution": { + "Direct-Assignment": "Direkte Zuordnung", + "Round-Robin": "Umlauf-Verfahren", + "Least-Busy": "geringste Auslastung" + } + }, + "labels": { + "Create InboundEmail": "Eingehende E-Mail erstellen", + "IMAP": "IMAP", + "Actions": "Aktionen", + "Main": "Wichtig" + }, + "messages": { + "couldNotConnectToImap": "Kann keine Verbindung zum IMAP Server herstellen" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Lead.json index a5ec914108..7bcb68aa9d 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Lead.json @@ -1,50 +1,50 @@ { - "labels": { - "Converted To": "Umgewandelt zu", - "Create Lead": "Neuer Interessent", - "Convert": "Umwandeln" - }, - "fields": { - "name": "Name", - "emailAddress": "E-Mail", - "title": "Funktion", - "website": "Webseite", - "phoneNumber": "Telefon", - "accountName": "Firmenname", - "doNotCall": "Nicht anrufen", - "address": "Adresse", - "status": "Status", - "source": "Quelle", - "opportunityAmount": "Verkaufschance Betrag", - "opportunityAmountConverted": "Verkaufschance Betrag (konvertiert)", - "description": "Beschreibung", - "createdAccount": "Firma", - "createdContact": "Kontakt", - "createdOpportunity": "Verkaufschance" - }, - "links": { - }, - "options": { - "status": { - "New": "Neu", - "Assigned": "Zugewiesen", - "In Process": "In Arbeit", - "Converted": "Umgewandelt", - "Recycled": "Wiedereröffnet", - "Dead": "'Gestorben'" - }, - "source": { - "Call": "Anruf", - "Email": "E-Mail", - "Existing Customer": "Bestehender Kunde", - "Partner": "Partner", - "Public Relations": "Public Relations", - "Web Site": "Web Seite", - "Campaign": "Kampagne", - "Other": "Andere" - } - }, - "presetFilters": { - "active": "Aktiv" - } + "labels": { + "Converted To": "Umgewandelt zu", + "Create Lead": "Neuer Interessent", + "Convert": "Umwandeln" + }, + "fields": { + "name": "Name", + "emailAddress": "E-Mail", + "title": "Funktion", + "website": "Webseite", + "phoneNumber": "Telefon", + "accountName": "Firmenname", + "doNotCall": "Nicht anrufen", + "address": "Adresse", + "status": "Status", + "source": "Quelle", + "opportunityAmount": "Verkaufschance Betrag", + "opportunityAmountConverted": "Verkaufschance Betrag (konvertiert)", + "description": "Beschreibung", + "createdAccount": "Firma", + "createdContact": "Kontakt", + "createdOpportunity": "Verkaufschance" + }, + "links": { + }, + "options": { + "status": { + "New": "Neu", + "Assigned": "Zugewiesen", + "In Process": "In Arbeit", + "Converted": "Umgewandelt", + "Recycled": "Wiedereröffnet", + "Dead": "'Gestorben'" + }, + "source": { + "Call": "Anruf", + "Email": "E-Mail", + "Existing Customer": "Bestehender Kunde", + "Partner": "Partner", + "Public Relations": "Public Relations", + "Web Site": "Web Seite", + "Campaign": "Kampagne", + "Other": "Andere" + } + }, + "presetFilters": { + "active": "Aktiv" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Meeting.json index c1d0121026..eff1911912 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Meeting.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Name", - "parent": "Bezieht sich auf", - "status": "Status", - "dateStart": "Startdatum", - "dateEnd": "Enddatum", - "duration": "Dauer", - "description": "Beschreibung", - "users": "Benutzer", - "contacts": "Kontakte", - "leads": "Interessenten" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Geplant", - "Held": "Durchgeführt", - "Not Held": "Nicht durchgeführt" - } - }, - "labels": { - "Create Meeting": "Neues Meeting", - "Set Held": "Auf Gehalten setzen", - "Set Not Held": "Auf nicht gehalten setzen", - "Send Invitations": "Einladungen versenden", - "Saved as Held": "Gespeichert als durchgeführt", - "Saved as Not Held": "Gespeichert als nicht durchgeführt" - }, - "presetFilters": { - "planned": "Geplant", - "held": "Durchgeführt", - "todays": "Heutige" - } + "fields": { + "name": "Name", + "parent": "Bezieht sich auf", + "status": "Status", + "dateStart": "Startdatum", + "dateEnd": "Enddatum", + "duration": "Dauer", + "description": "Beschreibung", + "users": "Benutzer", + "contacts": "Kontakte", + "leads": "Interessenten" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Geplant", + "Held": "Durchgeführt", + "Not Held": "Nicht durchgeführt" + } + }, + "labels": { + "Create Meeting": "Neues Meeting", + "Set Held": "Auf Gehalten setzen", + "Set Not Held": "Auf nicht gehalten setzen", + "Send Invitations": "Einladungen versenden", + "Saved as Held": "Gespeichert als durchgeführt", + "Saved as Not Held": "Gespeichert als nicht durchgeführt" + }, + "presetFilters": { + "planned": "Geplant", + "held": "Durchgeführt", + "todays": "Heutige" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Opportunity.json index 5a977bb8b4..abcfcd2ecd 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Opportunity.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Name", - "account": "Firma", - "stage": "Verkaufsphase", - "amount": "Betrag", - "probability": "Wahrscheinlichkeit (%)", - "leadSource": "Quelle", - "doNotCall": "Nicht anrufen", - "closeDate": "Abschlussdatum", - "contacts": "Kontakte", - "description": "Beschreibung", - "amountConverted": "Betrag (konvertiert)" - }, - "links": { - "contacts": "Kontakte" - }, - "options": { - "stage": { - "Prospecting": "Prospecting", - "Qualification": "Qualifikation", - "Needs Analysis": "Bedarfserhebung", - "Value Proposition": "Richtangebot", - "Id. Decision Makers": "Entscheider ident.", - "Perception Analysis": "Analyse Sichtweise", - "Proposal/Price Quote": "Preisangebot", - "Negotiation/Review": "Verhandlung\/Überarbeitung", - "Closed Won": "Gewonnen", - "Closed Lost": "Verloren" - } - }, - "labels": { - "Create Opportunity": "Neue Verkaufschance" - }, - "presetFilters": { - "open": "Offen", - "won": "Gewonnen" - } + "fields": { + "name": "Name", + "account": "Firma", + "stage": "Verkaufsphase", + "amount": "Betrag", + "probability": "Wahrscheinlichkeit (%)", + "leadSource": "Quelle", + "doNotCall": "Nicht anrufen", + "closeDate": "Abschlussdatum", + "contacts": "Kontakte", + "description": "Beschreibung", + "amountConverted": "Betrag (konvertiert)" + }, + "links": { + "contacts": "Kontakte" + }, + "options": { + "stage": { + "Prospecting": "Prospecting", + "Qualification": "Qualifikation", + "Needs Analysis": "Bedarfserhebung", + "Value Proposition": "Richtangebot", + "Id. Decision Makers": "Entscheider ident.", + "Perception Analysis": "Analyse Sichtweise", + "Proposal/Price Quote": "Preisangebot", + "Negotiation/Review": "Verhandlung\/Überarbeitung", + "Closed Won": "Gewonnen", + "Closed Lost": "Verloren" + } + }, + "labels": { + "Create Opportunity": "Neue Verkaufschance" + }, + "presetFilters": { + "open": "Offen", + "won": "Gewonnen" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Target.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Target.json index b9290a5ac1..c61fb35656 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Target.json @@ -1,19 +1,19 @@ { - "fields": { - "name": "Name", - "emailAddress": "E-Mail", - "title": "Funktion", - "website": "Webseite", - "accountName": "Firmenname", - "phoneNumber": "Telefon", - "doNotCall": "Nicht anrufen", - "address": "Adresse", - "description": "Beschreibung" - }, - "links": { - }, - "labels": { - "Create Target": "Neuer Zielkontakt", - "Convert to Lead": "Zu Interessent umwandeln" - } + "fields": { + "name": "Name", + "emailAddress": "E-Mail", + "title": "Funktion", + "website": "Webseite", + "accountName": "Firmenname", + "phoneNumber": "Telefon", + "doNotCall": "Nicht anrufen", + "address": "Adresse", + "description": "Beschreibung" + }, + "links": { + }, + "labels": { + "Create Target": "Neuer Zielkontakt", + "Convert to Lead": "Zu Interessent umwandeln" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Task.json b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Task.json index 593540c441..e772b7d8e0 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/de_DE/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/de_DE/Task.json @@ -1,37 +1,37 @@ { - "fields": { - "name": "Name", - "parent": "Bezieht sich auf", - "status": "Status", - "dateStart": "Startdatum", - "dateEnd": "Fällig am", - "priority": "Priorität", - "description": "Beschreibung", - "isOverdue": "Ist überfällig" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Nicht begonnen", - "Started": "In Bearbeitung", - "Completed": "Abgeschlossen", - "Canceled": "Storniert" - }, - "priority" : { - "Low": "Niedrig", - "Normal": "Normal", - "High": "Hoch", - "Urgent": "Dringend" - } - }, - "labels": { - "Create Task": "Neue Aufgabe" - }, - "presetFilters": { - "actual": "Tatsächlich", - "completed": "Abgeschlossen", - "todays": "Heutige", - "overdue": "Überfällig" - } + "fields": { + "name": "Name", + "parent": "Bezieht sich auf", + "status": "Status", + "dateStart": "Startdatum", + "dateEnd": "Fällig am", + "priority": "Priorität", + "description": "Beschreibung", + "isOverdue": "Ist überfällig" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Nicht begonnen", + "Started": "In Bearbeitung", + "Completed": "Abgeschlossen", + "Canceled": "Storniert" + }, + "priority" : { + "Low": "Niedrig", + "Normal": "Normal", + "High": "Hoch", + "Urgent": "Dringend" + } + }, + "labels": { + "Create Task": "Neue Aufgabe" + }, + "presetFilters": { + "actual": "Tatsächlich", + "completed": "Abgeschlossen", + "todays": "Heutige", + "overdue": "Überfällig" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json index f3f0313121..b382599bc8 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Name", - "emailAddress": "Email", - "website": "Website", - "phoneNumber": "Phone", - "billingAddress": "Billing Address", - "shippingAddress": "Shipping Address", - "description": "Description", - "sicCode": "Sic Code", - "industry": "Industry", - "type": "Type", - "contactRole": "Role" - }, - "links": { - "contacts": "Contacts", - "opportunities": "Opportunities", - "cases": "Cases", - "documents": "Documents" - }, - "options": { - "type": { - "Customer": "Customer", - "Investor": "Investor", - "Partner": "Partner", - "Reseller": "Reseller" - }, - "industry": { - "Apparel": "Apparel", - "Banking": "Banking", - "Computer Software": "Computer Software", - "Education": "Education", - "Electronics": "Electronics", - "Finance": "Finance", - "Insurance": "Insurance" - } - }, - "labels": { - "Create Account": "Create Account", - "Copy Billing": "Copy Billing" - } + "fields": { + "name": "Name", + "emailAddress": "Email", + "website": "Website", + "phoneNumber": "Phone", + "billingAddress": "Billing Address", + "shippingAddress": "Shipping Address", + "description": "Description", + "sicCode": "Sic Code", + "industry": "Industry", + "type": "Type", + "contactRole": "Role" + }, + "links": { + "contacts": "Contacts", + "opportunities": "Opportunities", + "cases": "Cases", + "documents": "Documents" + }, + "options": { + "type": { + "Customer": "Customer", + "Investor": "Investor", + "Partner": "Partner", + "Reseller": "Reseller" + }, + "industry": { + "Apparel": "Apparel", + "Banking": "Banking", + "Computer Software": "Computer Software", + "Education": "Education", + "Electronics": "Electronics", + "Finance": "Finance", + "Insurance": "Insurance" + } + }, + "labels": { + "Create Account": "Create Account", + "Copy Billing": "Copy Billing" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Admin.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Admin.json index 711b65939c..cde2bff2bc 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Admin.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Admin.json @@ -1,5 +1,5 @@ { - "layouts": { - "detailConvert": "Convert Lead" - } + "layouts": { + "detailConvert": "Convert Lead" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Calendar.json index 0a05d5cf23..a6dd884345 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Month", - "week": "Week", - "day": "Day", - "agendaWeek": "Week", - "agendaDay": "Day" - }, - "labels": { - "Today": "Today", - "Create": "Create" - } + "modes": { + "month": "Month", + "week": "Week", + "day": "Day", + "agendaWeek": "Week", + "agendaDay": "Day" + }, + "labels": { + "Today": "Today", + "Create": "Create" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Call.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Call.json index 78cb294d23..f8836b5cb9 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Call.json @@ -1,44 +1,44 @@ { - "fields": { - "name": "Name", - "parent": "Parent", - "status": "Status", - "dateStart": "Date Start", - "dateEnd": "Date End", - "direction": "Direction", - "duration": "Duration", - "description": "Description", - "users": "Users", - "contacts": "Contacts", - "leads": "Leads" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planned", - "Held": "Held", - "Not Held": "Not Held" - }, - "direction": { - "Outbound": "Outbound", - "Inbound": "Inbound" - }, - "acceptanceStatus": { - "None": "None", - "Accepted": "Accepted", - "Declined": "Declined" - } - }, - "labels": { - "Create Call": "Create Call", - "Set Held": "Set Held", - "Set Not Held": "Set Not Held", - "Send Invitations": "Send Invitations" - }, - "presetFilters": { - "planned": "Planned", - "held": "Held", - "todays": "Today's" - } + "fields": { + "name": "Name", + "parent": "Parent", + "status": "Status", + "dateStart": "Date Start", + "dateEnd": "Date End", + "direction": "Direction", + "duration": "Duration", + "description": "Description", + "users": "Users", + "contacts": "Contacts", + "leads": "Leads" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planned", + "Held": "Held", + "Not Held": "Not Held" + }, + "direction": { + "Outbound": "Outbound", + "Inbound": "Inbound" + }, + "acceptanceStatus": { + "None": "None", + "Accepted": "Accepted", + "Declined": "Declined" + } + }, + "labels": { + "Create Call": "Create Call", + "Set Held": "Set Held", + "Set Not Held": "Set Not Held", + "Send Invitations": "Send Invitations" + }, + "presetFilters": { + "planned": "Planned", + "held": "Held", + "todays": "Today's" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Case.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Case.json index 8b7289e39b..78cd8765f9 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Case.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Name", - "number": "Number", - "status": "Status", - "account": "Account", - "contact": "Contact", - "priority": "Priority", - "type": "Type", - "description": "Description" - }, - "links": { - }, - "options": { - "status": { - "New": "New", - "Assigned": "Assigned", - "Pending": "Pending", - "Closed": "Closed", - "Rejected": "Rejected", - "Duplicate": "Duplicate" - }, - "priority" : { - "Low": "Low", - "Normal": "Normal", - "High": "High", - "Urgent": "Urgent" - }, - "type": { - "Question": "Question", - "Incident": "Incident", - "Problem": "Problem" - } - }, - "labels": { - "Create Case": "Create Case" - }, - "presetFilters": { - "open": "Open", - "closed": "Closed" - } + "fields": { + "name": "Name", + "number": "Number", + "status": "Status", + "account": "Account", + "contact": "Contact", + "priority": "Priority", + "type": "Type", + "description": "Description" + }, + "links": { + }, + "options": { + "status": { + "New": "New", + "Assigned": "Assigned", + "Pending": "Pending", + "Closed": "Closed", + "Rejected": "Rejected", + "Duplicate": "Duplicate" + }, + "priority" : { + "Low": "Low", + "Normal": "Normal", + "High": "High", + "Urgent": "Urgent" + }, + "type": { + "Question": "Question", + "Incident": "Incident", + "Problem": "Problem" + } + }, + "labels": { + "Create Case": "Create Case" + }, + "presetFilters": { + "open": "Open", + "closed": "Closed" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json index 8f6fce3272..2908a84de3 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Name", - "emailAddress": "Email", - "title": "Title", - "account": "Account", - "accounts": "Accounts", - "phoneNumber": "Phone", - "accountType": "Account Type", - "doNotCall": "Do Not Call", - "address": "Address", - "opportunityRole": "Opportunity Role", - "accountRole": "Role", - "description": "Description" - }, - "links": { - "opportunities": "Opportunities", - "cases": "Cases" - }, - "labels": { - "Create Contact": "Create Contact" - }, - "options": { - "opportunityRole": { - "": "--None--", - "Decision Maker": "Decision Maker", - "Evaluator": "Evaluator", - "Influencer": "Influencer" - } - } + "fields": { + "name": "Name", + "emailAddress": "Email", + "title": "Title", + "account": "Account", + "accounts": "Accounts", + "phoneNumber": "Phone", + "accountType": "Account Type", + "doNotCall": "Do Not Call", + "address": "Address", + "opportunityRole": "Opportunity Role", + "accountRole": "Role", + "description": "Description" + }, + "links": { + "opportunities": "Opportunities", + "cases": "Cases" + }, + "labels": { + "Create Contact": "Create Contact" + }, + "options": { + "opportunityRole": { + "": "--None--", + "Decision Maker": "Decision Maker", + "Evaluator": "Evaluator", + "Influencer": "Influencer" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Document.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Document.json index bf5fb241bc..83099ff80c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Document.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Document.json @@ -1,32 +1,32 @@ { - "labels": { - "Create Document": "Create Document", - "Details": "Details" - }, - "fields": { - "name": "Name", - "status": "Status", - "file": "File", - "type": "Type", - "source": "Source", - "publishDate": "Publish Date", - "expirationDate": "Expiration Date", - "description": "Description" - }, - "links": { - "accounts": "Accounts", - "opportunities": "Opportunities" - }, - "options": { - "status": { - "Active": "Active", - "Draft": "Draft", - "Expired": "Expired", - "Canceled": "Canceled" - } - }, - "presetFilters": { - "active": "Active", - "draft": "Draft" - } + "labels": { + "Create Document": "Create Document", + "Details": "Details" + }, + "fields": { + "name": "Name", + "status": "Status", + "file": "File", + "type": "Type", + "source": "Source", + "publishDate": "Publish Date", + "expirationDate": "Expiration Date", + "description": "Description" + }, + "links": { + "accounts": "Accounts", + "opportunities": "Opportunities" + }, + "options": { + "status": { + "Active": "Active", + "Draft": "Draft", + "Expired": "Expired", + "Canceled": "Canceled" + } + }, + "presetFilters": { + "active": "Active", + "draft": "Draft" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Global.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Global.json index 5c941555db..342448f156 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Global.json @@ -1,83 +1,83 @@ { - "scopeNames": { - "Account": "Account", - "Contact": "Contact", - "Lead": "Lead", - "Target": "Target", - "Opportunity": "Opportunity", - "Meeting": "Meeting", - "Calendar": "Calendar", - "Call": "Call", - "Task": "Task", - "Case": "Case", - "InboundEmail": "Inbound Email", - "Document": "Document" - }, - "scopeNamesPlural": { - "Account": "Accounts", - "Contact": "Contacts", - "Lead": "Leads", - "Target": "Targets", - "Opportunity": "Opportunities", - "Meeting": "Meetings", - "Calendar": "Calendar", - "Call": "Calls", - "Task": "Tasks", - "Case": "Cases", - "InboundEmail": "Inbound Emails", - "Document": "Documents" - }, - "dashlets": { - "Leads": "My Leads", - "Opportunities": "My Opportunities", - "Tasks": "My Tasks", - "Cases": "My Cases", - "Calendar": "Calendar", - "Calls": "My Calls", - "Meetings": "My Meetings", - "OpportunitiesByStage": "Opportunities by Stage", - "OpportunitiesByLeadSource": "Opportunities by Lead Source", - "SalesByMonth": "Sales by Month", - "SalesPipeline": "Sales Pipeline" - }, - "labels": { - "Create InboundEmail": "Create Inbound Email", - "Activities": "Activities", - "History": "History", - "Attendees": "Attendees", - "Schedule Meeting": "Schedule Meeting", - "Schedule Call": "Schedule Call", - "Compose Email": "Compose Email", - "Log Meeting": "Log Meeting", - "Log Call": "Log Call", - "Archive Email": "Archive Email", - "Create Task": "Create Task", - "Tasks": "Tasks" - }, - "fields": { - "billingAddressCity": "City", - "billingAddressCountry": "Country", - "billingAddressPostalCode": "Postal Code", - "billingAddressState": "State", - "billingAddressStreet": "Street", - "addressCity": "City", - "addressStreet": "Street", - "addressCountry": "Country", - "addressState": "State", - "addressPostalCode": "Postal Code", - "shippingAddressCity": "City (Shipping)", - "shippingAddressStreet": "Street (Shipping)", - "shippingAddressCountry": "Country (Shipping)", - "shippingAddressState": "State (Shipping)", - "shippingAddressPostalCode": "Postal Code (Shipping)" - }, - "links": { - "contacts": "Contacts", - "opportunities": "Opportunities", - "leads": "Leads", - "meetings": "Meetings", - "calls": "Calls", - "tasks": "Tasks", - "emails": "Emails" - } + "scopeNames": { + "Account": "Account", + "Contact": "Contact", + "Lead": "Lead", + "Target": "Target", + "Opportunity": "Opportunity", + "Meeting": "Meeting", + "Calendar": "Calendar", + "Call": "Call", + "Task": "Task", + "Case": "Case", + "InboundEmail": "Inbound Email", + "Document": "Document" + }, + "scopeNamesPlural": { + "Account": "Accounts", + "Contact": "Contacts", + "Lead": "Leads", + "Target": "Targets", + "Opportunity": "Opportunities", + "Meeting": "Meetings", + "Calendar": "Calendar", + "Call": "Calls", + "Task": "Tasks", + "Case": "Cases", + "InboundEmail": "Inbound Emails", + "Document": "Documents" + }, + "dashlets": { + "Leads": "My Leads", + "Opportunities": "My Opportunities", + "Tasks": "My Tasks", + "Cases": "My Cases", + "Calendar": "Calendar", + "Calls": "My Calls", + "Meetings": "My Meetings", + "OpportunitiesByStage": "Opportunities by Stage", + "OpportunitiesByLeadSource": "Opportunities by Lead Source", + "SalesByMonth": "Sales by Month", + "SalesPipeline": "Sales Pipeline" + }, + "labels": { + "Create InboundEmail": "Create Inbound Email", + "Activities": "Activities", + "History": "History", + "Attendees": "Attendees", + "Schedule Meeting": "Schedule Meeting", + "Schedule Call": "Schedule Call", + "Compose Email": "Compose Email", + "Log Meeting": "Log Meeting", + "Log Call": "Log Call", + "Archive Email": "Archive Email", + "Create Task": "Create Task", + "Tasks": "Tasks" + }, + "fields": { + "billingAddressCity": "City", + "billingAddressCountry": "Country", + "billingAddressPostalCode": "Postal Code", + "billingAddressState": "State", + "billingAddressStreet": "Street", + "addressCity": "City", + "addressStreet": "Street", + "addressCountry": "Country", + "addressState": "State", + "addressPostalCode": "Postal Code", + "shippingAddressCity": "City (Shipping)", + "shippingAddressStreet": "Street (Shipping)", + "shippingAddressCountry": "Country (Shipping)", + "shippingAddressState": "State (Shipping)", + "shippingAddressPostalCode": "Postal Code (Shipping)" + }, + "links": { + "contacts": "Contacts", + "opportunities": "Opportunities", + "leads": "Leads", + "meetings": "Meetings", + "calls": "Calls", + "tasks": "Tasks", + "emails": "Emails" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/InboundEmail.json index 207137fe44..324d95f9fa 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/InboundEmail.json @@ -1,52 +1,52 @@ { - "fields": { - "name": "Name", - "team": "Team", - "status": "Status", - "assignToUser": "Assign to User", - "host": "Host", - "username": "Username", - "password": "Password", - "port": "Port", - "monitoredFolders": "Monitored Folders", - "trashFolder": "Trash Folder", - "ssl": "SSL", - "createCase": "Create Case", - "reply": "Reply", - "caseDistribution": "Case Distribution", - "replyEmailTemplate": "Reply Email Template", - "replyFromAddress": "Reply From Address", - "replyToAddress": "Reply To Address", - "replyFromName": "Reply From Name" - }, - "tooltips": { - "reply": "Notify email senders that their emails has been received.", - "createCase": "Automatically create case from incoming emails.", - "replyToAddress": "Specify email address of this mailbox to make response come here.", - "caseDistribution": "How cases will be assigned to. Assigned directly to the user or among the team.", - "assignToUser": "User emails/cases will be assigned to.", - "team": "Team emails/cases will be related to." - }, - "links": { - }, - "options": { - "status": { - "Active": "Active", - "Inactive": "Inactive" - }, - "caseDistribution": { - "Direct-Assignment": "Direct-Assignment", - "Round-Robin": "Round-Robin", - "Least-Busy": "Least-Busy" - } - }, - "labels": { - "Create InboundEmail": "Create Inbound Email", - "IMAP": "IMAP", - "Actions": "Actions", - "Main": "Main" - }, - "messages": { - "couldNotConnectToImap": "Could not connect to IMAP server" - } + "fields": { + "name": "Name", + "team": "Team", + "status": "Status", + "assignToUser": "Assign to User", + "host": "Host", + "username": "Username", + "password": "Password", + "port": "Port", + "monitoredFolders": "Monitored Folders", + "trashFolder": "Trash Folder", + "ssl": "SSL", + "createCase": "Create Case", + "reply": "Reply", + "caseDistribution": "Case Distribution", + "replyEmailTemplate": "Reply Email Template", + "replyFromAddress": "Reply From Address", + "replyToAddress": "Reply To Address", + "replyFromName": "Reply From Name" + }, + "tooltips": { + "reply": "Notify email senders that their emails has been received.", + "createCase": "Automatically create case from incoming emails.", + "replyToAddress": "Specify email address of this mailbox to make response come here.", + "caseDistribution": "How cases will be assigned to. Assigned directly to the user or among the team.", + "assignToUser": "User emails/cases will be assigned to.", + "team": "Team emails/cases will be related to." + }, + "links": { + }, + "options": { + "status": { + "Active": "Active", + "Inactive": "Inactive" + }, + "caseDistribution": { + "Direct-Assignment": "Direct-Assignment", + "Round-Robin": "Round-Robin", + "Least-Busy": "Least-Busy" + } + }, + "labels": { + "Create InboundEmail": "Create Inbound Email", + "IMAP": "IMAP", + "Actions": "Actions", + "Main": "Main" + }, + "messages": { + "couldNotConnectToImap": "Could not connect to IMAP server" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json index ff8b1ef300..b608450ab8 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Lead.json @@ -1,50 +1,50 @@ { - "labels": { - "Converted To": "Converted To", - "Create Lead": "Create Lead", - "Convert": "Convert" - }, - "fields": { - "name": "Name", - "emailAddress": "Email", - "title": "Title", - "website": "Website", - "phoneNumber": "Phone", - "accountName": "Account Name", - "doNotCall": "Do Not Call", - "address": "Address", - "status": "Status", - "source": "Source", - "opportunityAmount": "Opportunity Amount", - "opportunityAmountConverted": "Opportunity Amount (converted)", - "description": "Description", - "createdAccount": "Account", - "createdContact": "Contact", - "createdOpportunity": "Opportunity" - }, - "links": { - }, - "options": { - "status": { - "New": "New", - "Assigned": "Assigned", - "In Process": "In Process", - "Converted": "Converted", - "Recycled": "Recycled", - "Dead": "Dead" - }, - "source": { - "Call": "Call", - "Email": "Email", - "Existing Customer": "Existing Customer", - "Partner": "Partner", - "Public Relations": "Public Relations", - "Web Site": "Web Site", - "Campaign": "Campaign", - "Other": "Other" - } - }, - "presetFilters": { - "active": "Active" - } + "labels": { + "Converted To": "Converted To", + "Create Lead": "Create Lead", + "Convert": "Convert" + }, + "fields": { + "name": "Name", + "emailAddress": "Email", + "title": "Title", + "website": "Website", + "phoneNumber": "Phone", + "accountName": "Account Name", + "doNotCall": "Do Not Call", + "address": "Address", + "status": "Status", + "source": "Source", + "opportunityAmount": "Opportunity Amount", + "opportunityAmountConverted": "Opportunity Amount (converted)", + "description": "Description", + "createdAccount": "Account", + "createdContact": "Contact", + "createdOpportunity": "Opportunity" + }, + "links": { + }, + "options": { + "status": { + "New": "New", + "Assigned": "Assigned", + "In Process": "In Process", + "Converted": "Converted", + "Recycled": "Recycled", + "Dead": "Dead" + }, + "source": { + "Call": "Call", + "Email": "Email", + "Existing Customer": "Existing Customer", + "Partner": "Partner", + "Public Relations": "Public Relations", + "Web Site": "Web Site", + "Campaign": "Campaign", + "Other": "Other" + } + }, + "presetFilters": { + "active": "Active" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Meeting.json index fab31af477..ddfb732cbd 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Meeting.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Name", - "parent": "Parent", - "status": "Status", - "dateStart": "Date Start", - "dateEnd": "Date End", - "duration": "Duration", - "description": "Description", - "users": "Users", - "contacts": "Contacts", - "leads": "Leads" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planned", - "Held": "Held", - "Not Held": "Not Held" - }, - "acceptanceStatus": { - "None": "None", - "Accepted": "Accepted", - "Declined": "Declined" - } - }, - "labels": { - "Create Meeting": "Create Meeting", - "Set Held": "Set Held", - "Set Not Held": "Set Not Held", - "Send Invitations": "Send Invitations" - }, - "presetFilters": { - "planned": "Planned", - "held": "Held", - "todays": "Today's" - } + "fields": { + "name": "Name", + "parent": "Parent", + "status": "Status", + "dateStart": "Date Start", + "dateEnd": "Date End", + "duration": "Duration", + "description": "Description", + "users": "Users", + "contacts": "Contacts", + "leads": "Leads" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planned", + "Held": "Held", + "Not Held": "Not Held" + }, + "acceptanceStatus": { + "None": "None", + "Accepted": "Accepted", + "Declined": "Declined" + } + }, + "labels": { + "Create Meeting": "Create Meeting", + "Set Held": "Set Held", + "Set Not Held": "Set Not Held", + "Send Invitations": "Send Invitations" + }, + "presetFilters": { + "planned": "Planned", + "held": "Held", + "todays": "Today's" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json index fd1953f729..9e1cab09bf 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json @@ -1,41 +1,41 @@ { - "fields": { - "name": "Name", - "account": "Account", - "stage": "Stage", - "amount": "Amount", - "probability": "Probability, %", - "leadSource": "Lead Source", - "doNotCall": "Do Not Call", - "closeDate": "Close Date", - "contacts": "Contacts", - "description": "Description", - "amountConverted": "Amount (converted)", - "amountWeightedConverted": "Amount Weighted" - }, - "links": { - "contacts": "Contacts", - "documents": "Documents" - }, - "options": { - "stage": { - "Prospecting": "Prospecting", - "Qualification": "Qualification", - "Needs Analysis": "Needs Analysis", - "Value Proposition": "Value Proposition", - "Id. Decision Makers": "Id. Decision Makers", - "Perception Analysis": "Perception Analysis", - "Proposal/Price Quote": "Proposal/Price Quote", - "Negotiation/Review": "Negotiation/Review", - "Closed Won": "Closed Won", - "Closed Lost": "Closed Lost" - } - }, - "labels": { - "Create Opportunity": "Create Opportunity" - }, - "presetFilters": { - "open": "Open", - "won": "Won" - } + "fields": { + "name": "Name", + "account": "Account", + "stage": "Stage", + "amount": "Amount", + "probability": "Probability, %", + "leadSource": "Lead Source", + "doNotCall": "Do Not Call", + "closeDate": "Close Date", + "contacts": "Contacts", + "description": "Description", + "amountConverted": "Amount (converted)", + "amountWeightedConverted": "Amount Weighted" + }, + "links": { + "contacts": "Contacts", + "documents": "Documents" + }, + "options": { + "stage": { + "Prospecting": "Prospecting", + "Qualification": "Qualification", + "Needs Analysis": "Needs Analysis", + "Value Proposition": "Value Proposition", + "Id. Decision Makers": "Id. Decision Makers", + "Perception Analysis": "Perception Analysis", + "Proposal/Price Quote": "Proposal/Price Quote", + "Negotiation/Review": "Negotiation/Review", + "Closed Won": "Closed Won", + "Closed Lost": "Closed Lost" + } + }, + "labels": { + "Create Opportunity": "Create Opportunity" + }, + "presetFilters": { + "open": "Open", + "won": "Won" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Target.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Target.json index 153acf0958..c06b518df7 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Target.json @@ -1,19 +1,19 @@ { - "fields": { - "name": "Name", - "emailAddress": "Email", - "title": "Title", - "website": "Website", - "accountName": "Account Name", - "phoneNumber": "Phone", - "doNotCall": "Do Not Call", - "address": "Address", - "description": "Description" - }, - "links": { - }, - "labels": { - "Create Target": "Create Target", - "Convert to Lead": "Convert to Lead" - } + "fields": { + "name": "Name", + "emailAddress": "Email", + "title": "Title", + "website": "Website", + "accountName": "Account Name", + "phoneNumber": "Phone", + "doNotCall": "Do Not Call", + "address": "Address", + "description": "Description" + }, + "links": { + }, + "labels": { + "Create Target": "Create Target", + "Convert to Lead": "Convert to Lead" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Task.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Task.json index 8d5bcb4e59..18583ed216 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Task.json @@ -1,38 +1,38 @@ { - "fields": { - "name": "Name", - "parent": "Parent", - "status": "Status", - "dateStart": "Date Start", - "dateEnd": "Date Due", - "priority": "Priority", - "description": "Description", - "isOverdue": "Is Overdue" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Not Started", - "Started": "Started", - "Completed": "Completed", - "Canceled": "Canceled" - }, - "priority" : { - "Low": "Low", - "Normal": "Normal", - "High": "High", - "Urgent": "Urgent" - } - }, - "labels": { - "Create Task": "Create Task", - "Complete": "Complete" - }, - "presetFilters": { - "actual": "Actual", - "completed": "Completed", - "todays": "Today's", - "overdue": "Overdue" - } + "fields": { + "name": "Name", + "parent": "Parent", + "status": "Status", + "dateStart": "Date Start", + "dateEnd": "Date Due", + "priority": "Priority", + "description": "Description", + "isOverdue": "Is Overdue" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Not Started", + "Started": "Started", + "Completed": "Completed", + "Canceled": "Canceled" + }, + "priority" : { + "Low": "Low", + "Normal": "Normal", + "High": "High", + "Urgent": "Urgent" + } + }, + "labels": { + "Create Task": "Create Task", + "Complete": "Complete" + }, + "presetFilters": { + "actual": "Actual", + "completed": "Completed", + "todays": "Today's", + "overdue": "Overdue" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Account.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Account.json index c30c3b81f7..d4a0f3a575 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Nombre", - "emailAddress": "Correo electrónico", - "website": "Sito Web", - "phone": "Teléfono", - "fax": "Fax", - "billingAddress": "Dirección de Facturación", - "shippingAddress": "Dirección de Envío", - "description": "Descripción", - "sicCode": "Sic Code", - "industry": "Industria", - "type": "Tipo" - }, - "links": { - "contacts": "Contactos", - "opportunities": "Oportunidades", - "cases": "Casos" - }, - "options": { - "type": { - "Customer": "Cliente", - "Investor": "Inversor", - "Partner": "Partner", - "Reseller": "REvendedor" - }, - "industry": { - "Apparel": "Apparel", - "Banking": "Banking", - "Computer Software": "Software", - "Education": "Educación", - "Electronics": "Electrónicos", - "Finance": "Finanzas", - "Insurance": "Seguros" - } - }, - "labels": { - "Create Account": "Crear Cuenta" - } + "fields": { + "name": "Nombre", + "emailAddress": "Correo electrónico", + "website": "Sito Web", + "phone": "Teléfono", + "fax": "Fax", + "billingAddress": "Dirección de Facturación", + "shippingAddress": "Dirección de Envío", + "description": "Descripción", + "sicCode": "Sic Code", + "industry": "Industria", + "type": "Tipo" + }, + "links": { + "contacts": "Contactos", + "opportunities": "Oportunidades", + "cases": "Casos" + }, + "options": { + "type": { + "Customer": "Cliente", + "Investor": "Inversor", + "Partner": "Partner", + "Reseller": "REvendedor" + }, + "industry": { + "Apparel": "Apparel", + "Banking": "Banking", + "Computer Software": "Software", + "Education": "Educación", + "Electronics": "Electrónicos", + "Finance": "Finanzas", + "Insurance": "Seguros" + } + }, + "labels": { + "Create Account": "Crear Cuenta" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Calendar.json index b41e3beed7..c6ac56c47f 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Mes", - "week": "Semana", - "day": "Día", - "agendaWeek": "Semana", - "agendaDay": "Día" - }, - "labels": { - "Today": "Hoy", - "Create": "Crear" - } + "modes": { + "month": "Mes", + "week": "Semana", + "day": "Día", + "agendaWeek": "Semana", + "agendaDay": "Día" + }, + "labels": { + "Today": "Hoy", + "Create": "Crear" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Call.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Call.json index 1c2dbd39db..31b9a34e63 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Call.json @@ -1,34 +1,34 @@ { - "fields": { - "name": "Nombre", - "parent": "Padre", - "status": "Estado", - "dateStart": "Fecha de Comienzo", - "dateEnd": "Fecha de Finalización", - "direction": "Dirección", - "duration": "Duración", - "description": "Descripción", - "users": "Usuarios", - "contacts": "Contactos", - "leads": "Potenciales" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planeada", - "Held": "Celebrada", - "Not Held": "Sin Celebrar" - }, - "direction": { - "Outbound": "Saliente", - "Inbound": "Entrante" - } - }, - "labels": { - "Create Call": "Crear Llamada", - "Set Held": "Establecer Celebrada", - "Set Not Held": "Establecer no Celebrada", - "Send Invitations": "Enviar Invitaciones" - } + "fields": { + "name": "Nombre", + "parent": "Padre", + "status": "Estado", + "dateStart": "Fecha de Comienzo", + "dateEnd": "Fecha de Finalización", + "direction": "Dirección", + "duration": "Duración", + "description": "Descripción", + "users": "Usuarios", + "contacts": "Contactos", + "leads": "Potenciales" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planeada", + "Held": "Celebrada", + "Not Held": "Sin Celebrar" + }, + "direction": { + "Outbound": "Saliente", + "Inbound": "Entrante" + } + }, + "labels": { + "Create Call": "Crear Llamada", + "Set Held": "Establecer Celebrada", + "Set Not Held": "Establecer no Celebrada", + "Send Invitations": "Enviar Invitaciones" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Case.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Case.json index a332e4b571..4d38dbd557 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Case.json @@ -1,38 +1,38 @@ { - "fields": { - "name": "Nombre", - "number": "Número", - "status": "Estado", - "account": "Cuenta", - "contact": "Contacto", - "priority": "Prioridad", - "type": "Tipo", - "description": "Descripción" - }, - "links": { - }, - "options": { - "status": { - "New": "Nuevo", - "Assigned": "Asignado", - "Pending": "Pendiente", - "Closed": "Cerrado", - "Rejected": "Rechazado", - "Duplicate": "Duplicado" - }, - "priority" : { - "Low": "Baja", - "Normal": "Normal", - "High": "Alta", - "Urgent": "Urgente" - }, - "type": { - "Question": "Pregunta", - "Incident": "Incidente", - "Problem": "Problema" - } - }, - "labels": { - "Create Case": "Crear Caso" - } + "fields": { + "name": "Nombre", + "number": "Número", + "status": "Estado", + "account": "Cuenta", + "contact": "Contacto", + "priority": "Prioridad", + "type": "Tipo", + "description": "Descripción" + }, + "links": { + }, + "options": { + "status": { + "New": "Nuevo", + "Assigned": "Asignado", + "Pending": "Pendiente", + "Closed": "Cerrado", + "Rejected": "Rechazado", + "Duplicate": "Duplicado" + }, + "priority" : { + "Low": "Baja", + "Normal": "Normal", + "High": "Alta", + "Urgent": "Urgente" + }, + "type": { + "Question": "Pregunta", + "Incident": "Incidente", + "Problem": "Problema" + } + }, + "labels": { + "Create Case": "Crear Caso" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Contact.json index 3c93a7c113..34d81899ed 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Contact.json @@ -1,22 +1,22 @@ { - "fields": { - "name": "Nombre", - "emailAddress": "Correo electrónico", - "title": "Título", - "account": "Cuenta", - "phone": "Teléfono", - "phoneOffice": "Phone (Office)", - "fax": "Fax", - "accountType": "Cuenta Tipo", - "doNotCall": "No Llamar", - "address": "Dirección", - "description": "Descripción" - }, - "links": { - "opportunities": "Oportunidades", - "cases": "Casos" - }, - "labels": { - "Create Contact": "Crear Contacto" - } + "fields": { + "name": "Nombre", + "emailAddress": "Correo electrónico", + "title": "Título", + "account": "Cuenta", + "phone": "Teléfono", + "phoneOffice": "Phone (Office)", + "fax": "Fax", + "accountType": "Cuenta Tipo", + "doNotCall": "No Llamar", + "address": "Dirección", + "description": "Descripción" + }, + "links": { + "opportunities": "Oportunidades", + "cases": "Casos" + }, + "labels": { + "Create Contact": "Crear Contacto" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Global.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Global.json index 8e73801a59..a200375153 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Global.json @@ -1,79 +1,79 @@ { - "scopeNames": { - "Account": "Cuenta", - "Contact": "Contacto", - "Lead": "Potenciales", - "Target": "Prospecto", - "Opportunity": "Opportunidad", - "Meeting": "Reunión", - "Calendar": "Calendario", - "Call": "Llamada", - "Task": "Tarea", - "Case": "Caso", - "InboundEmail": "Correo Entrante" - }, - "scopeNamesPlural": { - "Account": "Cuentas", - "Contact": "Contactos", - "Lead": "Potenciales", - "Targets": "Prospectos", - "Opportunity": "Oportunidades", - "Meeting": "Reuniones", - "Calendar": "Calendario", - "Call": "Llamadas", - "Task": "Tareas", - "Case": "Casos", - "InboundEmail": "Correos Entrantes" - }, - "dashlets": { - "Leads": "Mis potenciales", - "Opportunities": "Mis Opportunidades", - "Tasks": "Mis Tareas", - "Cases": "Mis Casos", - "Calendar": "Calendario", - "OpportunitiesByStage": "Oportunidades por Etapa", - "OpportunitiesByLeadSource": "Oportunidades de origen de cliente potencial", - "SalesByMonth": "Ventas por Mes", - "SalesPipeline": "Canalización de ventas" - }, - "labels": { - "Create InboundEmail": "Crear Correo Entrante", - "Activities": "Actividades", - "History": "Historia", - "Attendees": "Los asistentes", - "Schedule Meeting": "Reunión Programada", - "Schedule Call": "Llamada Programada", - "Compose Email": "Componer Correo", - "Log Meeting": "Log de Reunión", - "Log Call": "Log de Llamada", - "Archive Email": "Archivar Correo", - "Create Task": "Crear Tarea", - "Tasks": "Tareas" - }, - "fields": { - "billingAddressCity": "Ciudad", - "billingAddressCountry": "país", - "billingAddressPostalCode": "Código Postal", - "billingAddressState": "Estado/Distrito", - "billingAddressStreet": "Calle", - "addressCity": "Ciudad", - "addressStreet": "Calle", - "addressCountry": "país", - "addressState": "Estado/Distrito", - "addressPostalCode": "Código Postal", - "shippingAddressCity": "City (Shipping)", - "shippingAddressStreet": "Street (Shipping)", - "shippingAddressCountry": "Country (Shipping)", - "shippingAddressState": "State (Shipping)", - "shippingAddressPostalCode": "Postal Code (Shipping)" - }, - "links": { - "contacts": "Contactos", - "opportunities": "Oportunidades", - "leads": "Potenciales", - "meetings": "Reuniones", - "calls": "Llamadas", - "tasks": "Tareas", - "emails": "Correos" - } + "scopeNames": { + "Account": "Cuenta", + "Contact": "Contacto", + "Lead": "Potenciales", + "Target": "Prospecto", + "Opportunity": "Opportunidad", + "Meeting": "Reunión", + "Calendar": "Calendario", + "Call": "Llamada", + "Task": "Tarea", + "Case": "Caso", + "InboundEmail": "Correo Entrante" + }, + "scopeNamesPlural": { + "Account": "Cuentas", + "Contact": "Contactos", + "Lead": "Potenciales", + "Targets": "Prospectos", + "Opportunity": "Oportunidades", + "Meeting": "Reuniones", + "Calendar": "Calendario", + "Call": "Llamadas", + "Task": "Tareas", + "Case": "Casos", + "InboundEmail": "Correos Entrantes" + }, + "dashlets": { + "Leads": "Mis potenciales", + "Opportunities": "Mis Opportunidades", + "Tasks": "Mis Tareas", + "Cases": "Mis Casos", + "Calendar": "Calendario", + "OpportunitiesByStage": "Oportunidades por Etapa", + "OpportunitiesByLeadSource": "Oportunidades de origen de cliente potencial", + "SalesByMonth": "Ventas por Mes", + "SalesPipeline": "Canalización de ventas" + }, + "labels": { + "Create InboundEmail": "Crear Correo Entrante", + "Activities": "Actividades", + "History": "Historia", + "Attendees": "Los asistentes", + "Schedule Meeting": "Reunión Programada", + "Schedule Call": "Llamada Programada", + "Compose Email": "Componer Correo", + "Log Meeting": "Log de Reunión", + "Log Call": "Log de Llamada", + "Archive Email": "Archivar Correo", + "Create Task": "Crear Tarea", + "Tasks": "Tareas" + }, + "fields": { + "billingAddressCity": "Ciudad", + "billingAddressCountry": "país", + "billingAddressPostalCode": "Código Postal", + "billingAddressState": "Estado/Distrito", + "billingAddressStreet": "Calle", + "addressCity": "Ciudad", + "addressStreet": "Calle", + "addressCountry": "país", + "addressState": "Estado/Distrito", + "addressPostalCode": "Código Postal", + "shippingAddressCity": "City (Shipping)", + "shippingAddressStreet": "Street (Shipping)", + "shippingAddressCountry": "Country (Shipping)", + "shippingAddressState": "State (Shipping)", + "shippingAddressPostalCode": "Postal Code (Shipping)" + }, + "links": { + "contacts": "Contactos", + "opportunities": "Oportunidades", + "leads": "Potenciales", + "meetings": "Reuniones", + "calls": "Llamadas", + "tasks": "Tareas", + "emails": "Correos" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/InboundEmail.json index 7c97cb4c23..471086c018 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/InboundEmail.json @@ -1,43 +1,43 @@ { - "fields": { - "name": "Nombre", - "team": "Equipo", - "status": "Estado", - "assignToUser": "Asignado a Usuario", - "host": "Host", - "username": "Nombre de Usuario", - "password": "Contraseña", - "port": "Puerto", - "monitoredFolders": "Carpetas supervisadas", - "trashFolder": "Carpeta Basura", - "ssl": "SSL", - "createCase": "Crear Caso", - "reply": "Responder", - "caseDistribution": "Caso Distribución", - "replyEmailTemplate": "Responder De Plantilla", - "replyFromAddress": "Responder De Dirección", - "replyFromName": "Responder De Nombre" - }, - "links": { - }, - "options": { - "status": { - "Active": "Activo", - "Inactive": "Inactivo" - }, - "caseDistribution": { - "Direct-Assignment": "Asignación-Directa", - "Round-Robin": "Round-Robin", - "Least-Busy": "Least-Busy" - } - }, - "labels": { - "Create InboundEmail": "Crear Correo Entrante", - "IMAP": "IMAP", - "Actions": "Acciones", - "Main": "Principal" - }, - "messages": { - "couldNotConnectToImap": "No se pudo conectar con el servidor IMAP" - } + "fields": { + "name": "Nombre", + "team": "Equipo", + "status": "Estado", + "assignToUser": "Asignado a Usuario", + "host": "Host", + "username": "Nombre de Usuario", + "password": "Contraseña", + "port": "Puerto", + "monitoredFolders": "Carpetas supervisadas", + "trashFolder": "Carpeta Basura", + "ssl": "SSL", + "createCase": "Crear Caso", + "reply": "Responder", + "caseDistribution": "Caso Distribución", + "replyEmailTemplate": "Responder De Plantilla", + "replyFromAddress": "Responder De Dirección", + "replyFromName": "Responder De Nombre" + }, + "links": { + }, + "options": { + "status": { + "Active": "Activo", + "Inactive": "Inactivo" + }, + "caseDistribution": { + "Direct-Assignment": "Asignación-Directa", + "Round-Robin": "Round-Robin", + "Least-Busy": "Least-Busy" + } + }, + "labels": { + "Create InboundEmail": "Crear Correo Entrante", + "IMAP": "IMAP", + "Actions": "Acciones", + "Main": "Principal" + }, + "messages": { + "couldNotConnectToImap": "No se pudo conectar con el servidor IMAP" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Lead.json index 49af26dd68..82221a0194 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Lead.json @@ -1,48 +1,48 @@ { - "labels": { - "Converted To": "Convertido a", - "Create Lead": "Crear Principal", - "Convert": "Convertir" - }, - "fields": { - "name": "Nombre", - "emailAddress": "Correo electrónico", - "title": "Título", - "website": "Sito Web", - "phone": "Teléfono", - "phoneOffice": "Phone (Office)", - "fax": "Fax", - "accountName": "Nombre de Cuenta", - "doNotCall": "No Llamar", - "address": "Dirección", - "status": "Estado", - "source": "Fuente", - "opportunityAmount": "Oportunidad Cantidad", - "description": "Descripción", - "createdAccount": "Cuenta", - "createdContact": "Contacto", - "createdOpportunity": "Opportunidad" - }, - "links": { - }, - "options": { - "status": { - "New": "Nuevo", - "Assigned": "Asignado", - "In Process": "En Proceso", - "Converted": "Convertido", - "Recycled": "Reciclado", - "Dead": "Muerto" - }, - "source": { - "Call": "Llamada", - "Email": "Correo electrónico", - "Existing Customer": "Cliente Existente", - "Partner": "Partner", - "Public Relations": "Relaciones Públicas", - "Web Site": "Sitio Web", - "Campaign": "Campaña", - "Other": "Otro" - } - } + "labels": { + "Converted To": "Convertido a", + "Create Lead": "Crear Principal", + "Convert": "Convertir" + }, + "fields": { + "name": "Nombre", + "emailAddress": "Correo electrónico", + "title": "Título", + "website": "Sito Web", + "phone": "Teléfono", + "phoneOffice": "Phone (Office)", + "fax": "Fax", + "accountName": "Nombre de Cuenta", + "doNotCall": "No Llamar", + "address": "Dirección", + "status": "Estado", + "source": "Fuente", + "opportunityAmount": "Oportunidad Cantidad", + "description": "Descripción", + "createdAccount": "Cuenta", + "createdContact": "Contacto", + "createdOpportunity": "Opportunidad" + }, + "links": { + }, + "options": { + "status": { + "New": "Nuevo", + "Assigned": "Asignado", + "In Process": "En Proceso", + "Converted": "Convertido", + "Recycled": "Reciclado", + "Dead": "Muerto" + }, + "source": { + "Call": "Llamada", + "Email": "Correo electrónico", + "Existing Customer": "Cliente Existente", + "Partner": "Partner", + "Public Relations": "Relaciones Públicas", + "Web Site": "Sitio Web", + "Campaign": "Campaña", + "Other": "Otro" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Meeting.json index 9397c8d72f..6d1204be16 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Meeting.json @@ -1,29 +1,29 @@ { - "fields": { - "name": "Nombre", - "parent": "Padre", - "status": "Estado", - "dateStart": "Fecha de Comienzo", - "dateEnd": "Fecha de Finalización", - "duration": "Duración", - "description": "Descripción", - "users": "Usuarios", - "contacts": "Contactos", - "leads": "Potenciales" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planeada", - "Held": "Celebrada", - "Not Held": "Sin Celebrar" - } - }, - "labels": { - "Create Meeting": "Crear Reunión", - "Set Held": "Establecer Celebrada", - "Set Not Held": "Establecer no Celebrada", - "Send Invitations": "Enviar Invitaciones" - } + "fields": { + "name": "Nombre", + "parent": "Padre", + "status": "Estado", + "dateStart": "Fecha de Comienzo", + "dateEnd": "Fecha de Finalización", + "duration": "Duración", + "description": "Descripción", + "users": "Usuarios", + "contacts": "Contactos", + "leads": "Potenciales" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planeada", + "Held": "Celebrada", + "Not Held": "Sin Celebrar" + } + }, + "labels": { + "Create Meeting": "Crear Reunión", + "Set Held": "Establecer Celebrada", + "Set Not Held": "Establecer no Celebrada", + "Send Invitations": "Enviar Invitaciones" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Opportunity.json index ebb095ff66..d832aec93c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Opportunity.json @@ -1,43 +1,43 @@ { - "fields": { - "name": "Nombre", - "account": "Cuenta", - "stage": "Etapa", - "amount": "Cantidad", - "probability": "Probabilidad, %", - "leadSource": "Fuente Principal", - "doNotCall": "No Llamar", - "closeDate": "Fecha de cierre", - "description": "Descripción" - }, - "links": { - "contacts": "Contactos" - }, - "options": { - "stage": { - "Prospecting": "Prospección", - "Qualification": "Calificación", - "Needs Analysis": "Análisis de Necesidades", - "Value Proposition": "Valor de la Propuesta", - "Id. Decision Makers": "Id. Tomadores de Decisiones", - "Perception Analysis": "Análisis de la Percepción", - "Proposal/Price Quote": "Propuesta/precio Presupuesto", - "Negotiation/Review": "Negociación/Revisión", - "Closed Won": "Cerrado Ganado", - "Closed Lost": "Cerrado Perdido" - }, - "leadSource": { - "Call": "Llamada", - "Email": "Correo electrónico", - "Existing Customer": "Cliente Existente", - "Partner": "Partner", - "Public Relations": "Relaciones Públicas", - "Web Site": "Sitio Web", - "Campaign": "Campaña", - "Other": "Otro" - } - }, - "labels": { - "Create Opportunity": "Crear Oportunidad" - } + "fields": { + "name": "Nombre", + "account": "Cuenta", + "stage": "Etapa", + "amount": "Cantidad", + "probability": "Probabilidad, %", + "leadSource": "Fuente Principal", + "doNotCall": "No Llamar", + "closeDate": "Fecha de cierre", + "description": "Descripción" + }, + "links": { + "contacts": "Contactos" + }, + "options": { + "stage": { + "Prospecting": "Prospección", + "Qualification": "Calificación", + "Needs Analysis": "Análisis de Necesidades", + "Value Proposition": "Valor de la Propuesta", + "Id. Decision Makers": "Id. Tomadores de Decisiones", + "Perception Analysis": "Análisis de la Percepción", + "Proposal/Price Quote": "Propuesta/precio Presupuesto", + "Negotiation/Review": "Negociación/Revisión", + "Closed Won": "Cerrado Ganado", + "Closed Lost": "Cerrado Perdido" + }, + "leadSource": { + "Call": "Llamada", + "Email": "Correo electrónico", + "Existing Customer": "Cliente Existente", + "Partner": "Partner", + "Public Relations": "Relaciones Públicas", + "Web Site": "Sitio Web", + "Campaign": "Campaña", + "Other": "Otro" + } + }, + "labels": { + "Create Opportunity": "Crear Oportunidad" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Target.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Target.json index dcb08ce94f..557ce5e21d 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Target.json @@ -1,21 +1,21 @@ { - "fields": { - "name": "Nombre", - "emailAddress": "Correo electrónico", - "title": "Título", - "website": "Sito Web", - "accountName": "Nombre de Cuenta", - "phone": "Teléfono", - "phoneOffice": "Phone (Office)", - "fax": "Fax", - "doNotCall": "No Llamar", - "address": "Dirección", - "description": "Descripción" - }, - "links": { - }, - "labels": { - "Create Target": "Crear Prospecto", - "Convert to Lead": "Convertir en Lider" - } + "fields": { + "name": "Nombre", + "emailAddress": "Correo electrónico", + "title": "Título", + "website": "Sito Web", + "accountName": "Nombre de Cuenta", + "phone": "Teléfono", + "phoneOffice": "Phone (Office)", + "fax": "Fax", + "doNotCall": "No Llamar", + "address": "Dirección", + "description": "Descripción" + }, + "links": { + }, + "labels": { + "Create Target": "Crear Prospecto", + "Convert to Lead": "Convertir en Lider" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Task.json b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Task.json index a481c926a5..3f9afdfb7e 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/es_ES/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/es_ES/Task.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Nombre", - "parent": "Padre", - "status": "Estado", - "dateStart": "Fecha de Comienzo", - "dateEnd": "Fecha de vencimiento", - "priority": "Prioridad", - "description": "Descripción", - "isOverdue": "Atrasado" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Sin Empezar", - "Started": "Comenzado", - "Completed": "Completado", - "Canceled": "Cancelado" - }, - "priority" : { - "Low": "Baja", - "Normal": "Normal", - "High": "Alta", - "Urgent": "Urgente" - } - }, - "labels": { - "Create Task": "Crear Tarea" - } + "fields": { + "name": "Nombre", + "parent": "Padre", + "status": "Estado", + "dateStart": "Fecha de Comienzo", + "dateEnd": "Fecha de vencimiento", + "priority": "Prioridad", + "description": "Descripción", + "isOverdue": "Atrasado" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Sin Empezar", + "Started": "Comenzado", + "Completed": "Completado", + "Canceled": "Cancelado" + }, + "priority" : { + "Low": "Baja", + "Normal": "Normal", + "High": "Alta", + "Urgent": "Urgente" + } + }, + "labels": { + "Create Task": "Crear Tarea" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Account.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Account.json index e0d38388fc..bf3561fa3a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Nom", - "emailAddress": "Email", - "website": "Site Web", - "phoneNumber": "Téléphone", - "billingAddress": "Adresse de Facturation", - "shippingAddress": "Adresse de Livraison", - "description": "Description", - "sicCode": "Code SIC", - "industry": "Industrie", - "type": "Type", - "contactRole": "Rôle" - }, - "links": { - "contacts": "Contacts", - "opportunities": "Opportunités", - "cases": "Tickets" - }, - "options": { - "type": { - "Customer": "Clients", - "Investor": "Investisseur", - "Partner": "Partenaire", - "Reseller": "Revendeur" - }, - "industry": { - "Apparel": "Vêtements", - "Banking": "Banque", - "Computer Software": "Logiciel Informatique", - "Education": "Education", - "Electronics": "Electronique", - "Finance": "Finance", - "Insurance": "Assurance" - } - }, - "labels": { - "Create Account": "Nouveau Compte" - } + "fields": { + "name": "Nom", + "emailAddress": "Email", + "website": "Site Web", + "phoneNumber": "Téléphone", + "billingAddress": "Adresse de Facturation", + "shippingAddress": "Adresse de Livraison", + "description": "Description", + "sicCode": "Code SIC", + "industry": "Industrie", + "type": "Type", + "contactRole": "Rôle" + }, + "links": { + "contacts": "Contacts", + "opportunities": "Opportunités", + "cases": "Tickets" + }, + "options": { + "type": { + "Customer": "Clients", + "Investor": "Investisseur", + "Partner": "Partenaire", + "Reseller": "Revendeur" + }, + "industry": { + "Apparel": "Vêtements", + "Banking": "Banque", + "Computer Software": "Logiciel Informatique", + "Education": "Education", + "Electronics": "Electronique", + "Finance": "Finance", + "Insurance": "Assurance" + } + }, + "labels": { + "Create Account": "Nouveau Compte" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Calendar.json index 3d6af35b3c..54944d13d6 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Mois", - "week": "Semaine", - "day": "Jour", - "agendaWeek": "Semaine", - "agendaDay": "Jour" - }, - "labels": { - "Today": "Aujourd'hui", - "Create": "Créer" - } + "modes": { + "month": "Mois", + "week": "Semaine", + "day": "Jour", + "agendaWeek": "Semaine", + "agendaDay": "Jour" + }, + "labels": { + "Today": "Aujourd'hui", + "Create": "Créer" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Call.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Call.json index 5723890e67..2a51043bd2 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Call.json @@ -1,34 +1,34 @@ { - "fields": { - "name": "Nom", - "parent": "Parent", - "status": "Statut", - "dateStart": "Date de Début", - "dateEnd": "Date de Fin", - "direction": "Direction", - "duration": "Durée", - "description": "Description", - "users": "Utilisateurs", - "contacts": "Contacts", - "leads": "Leads" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Plannifié", - "Held": "Fait", - "Not Held": "Pas Fait" - }, - "direction": { - "Outbound": "Sortie", - "Inbound": "Entrée" - } - }, - "labels": { - "Create Call": "Générer l'appel", - "Set Held": "Marquer Fait", - "Set Not Held": "Marquer Pas Fait", - "Send Invitations": "Envoi d'Invitations" - } + "fields": { + "name": "Nom", + "parent": "Parent", + "status": "Statut", + "dateStart": "Date de Début", + "dateEnd": "Date de Fin", + "direction": "Direction", + "duration": "Durée", + "description": "Description", + "users": "Utilisateurs", + "contacts": "Contacts", + "leads": "Leads" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Plannifié", + "Held": "Fait", + "Not Held": "Pas Fait" + }, + "direction": { + "Outbound": "Sortie", + "Inbound": "Entrée" + } + }, + "labels": { + "Create Call": "Générer l'appel", + "Set Held": "Marquer Fait", + "Set Not Held": "Marquer Pas Fait", + "Send Invitations": "Envoi d'Invitations" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Case.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Case.json index b010a6cf39..23cb86a43b 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Case.json @@ -1,38 +1,38 @@ { - "fields": { - "name": "Nom", - "number": "Numéro", - "status": "Statut", - "account": "Compte", - "contact": "Contact", - "priority": "Priorité", - "type": "Type", - "description": "Description" - }, - "links": { - }, - "options": { - "status": { - "New": "Nouveau", - "Assigned": "Assigné", - "Pending": "En attente", - "Closed": "Fermé", - "Rejected": "Rejeté", - "Duplicate": "Doublon" - }, - "priority" : { - "Low": "Bas", - "Normal": "Normal", - "High": "Haut", - "Urgent": "Urgent" - }, - "type": { - "Question": "Question", - "Incident": "Incident", - "Problem": "Problème" - } - }, - "labels": { - "Create Case": "Créer un Ticket" - } + "fields": { + "name": "Nom", + "number": "Numéro", + "status": "Statut", + "account": "Compte", + "contact": "Contact", + "priority": "Priorité", + "type": "Type", + "description": "Description" + }, + "links": { + }, + "options": { + "status": { + "New": "Nouveau", + "Assigned": "Assigné", + "Pending": "En attente", + "Closed": "Fermé", + "Rejected": "Rejeté", + "Duplicate": "Doublon" + }, + "priority" : { + "Low": "Bas", + "Normal": "Normal", + "High": "Haut", + "Urgent": "Urgent" + }, + "type": { + "Question": "Question", + "Incident": "Incident", + "Problem": "Problème" + } + }, + "labels": { + "Create Case": "Créer un Ticket" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Contact.json index 1dd7606a00..2e3b71af71 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Contact.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Nom", - "emailAddress": "Email", - "title": "Titre", - "account": "Compte", - "accounts": "Comptes", - "phoneNumber": "Téléphone", - "accountType": "Type de Compte", - "doNotCall": "Ne Pas Appeler", - "address": "Adresse", - "opportunityRole": "Rôle de Challenge", - "accountRole": "Rôle", - "description": "Description" - }, - "links": { - "opportunities": "Opportunités", - "cases": "Tickets" - }, - "labels": { - "Create Contact": "Créer un contact" - }, - "options": { - "opportunityRole": { - "": "--Aucun--", - "Decision Maker": "Décisionnaire", - "Evaluator": "*Evaluator", - "Influencer": "Prescripteur" - } - } + "fields": { + "name": "Nom", + "emailAddress": "Email", + "title": "Titre", + "account": "Compte", + "accounts": "Comptes", + "phoneNumber": "Téléphone", + "accountType": "Type de Compte", + "doNotCall": "Ne Pas Appeler", + "address": "Adresse", + "opportunityRole": "Rôle de Challenge", + "accountRole": "Rôle", + "description": "Description" + }, + "links": { + "opportunities": "Opportunités", + "cases": "Tickets" + }, + "labels": { + "Create Contact": "Créer un contact" + }, + "options": { + "opportunityRole": { + "": "--Aucun--", + "Decision Maker": "Décisionnaire", + "Evaluator": "*Evaluator", + "Influencer": "Prescripteur" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Global.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Global.json index 390662d866..aca873937a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Global.json @@ -1,79 +1,79 @@ { - "scopeNames": { - "Account": "Compte", - "Contact": "Contact", - "Lead": "Lead", - "Target": "Cible", - "Opportunity": "Challenge", - "Meeting": "Rendez-vous", - "Calendar": "Calendrier", - "Call": "Appel", - "Task": "Tâche", - "Case": "Ticket", - "InboundEmail": "Email Entrant" - }, - "scopeNamesPlural": { - "Account": "Comptes", - "Contact": "Contacts", - "Lead": "Leads", - "Target": "Cibles", - "Opportunity": "Opportunités", - "Meeting": "Rendez-vous", - "Calendar": "Calendrier", - "Call": "Appels", - "Task": "Tâches", - "Case": "Tickets", - "InboundEmail": "Emails Entrants" - }, - "dashlets": { - "Leads": "My Leads", - "Opportunities": "Mes Challenges", - "Tasks": "Mes Tâches", - "Cases": "Mes Tickets", - "Calendar": "Calendrier", - "OpportunitiesByStage": "*Challenges par étages", - "OpportunitiesByLeadSource": "Challenges par Lead Source", - "SalesByMonth": "Ventes par Mois", - "SalesPipeline": "Tuyaux des ventes" - }, - "labels": { - "Create InboundEmail": "Créer une boîte email", - "Activities": "Activités", - "History": "Historique", - "Attendees": "Participants", - "Schedule Meeting": "Rendez-vous Planifiés", - "Schedule Call": "Appels Planifiés", - "Compose Email": "Créer un Email", - "Log Meeting": "Journal des Rendez-vous", - "Log Call": "Journal d'appels", - "Archive Email": "Archiver les Emails", - "Create Task": "Créer une tâche", - "Tasks": "Tâches" - }, - "fields": { - "billingAddressCity": "Ville", - "billingAddressCountry": "Pays", - "billingAddressPostalCode": "Code Postal", - "billingAddressState": "Département", - "billingAddressStreet": "Rue", - "addressCity": "Ville", - "addressStreet": "Rue", - "addressCountry": "Pays", - "addressState": "Département", - "addressPostalCode": "Code Postal", - "shippingAddressCity": "City (Shipping)", - "shippingAddressStreet": "Street (Shipping)", - "shippingAddressCountry": "Country (Shipping)", - "shippingAddressState": "State (Shipping)", - "shippingAddressPostalCode": "Postal Code (Shipping)" - }, - "links": { - "contacts": "Contacts", - "opportunities": "Opportunités", - "leads": "Leads", - "meetings": "Rendez-vous", - "calls": "Appels", - "tasks": "Tâches", - "emails": "Courriers" - } + "scopeNames": { + "Account": "Compte", + "Contact": "Contact", + "Lead": "Lead", + "Target": "Cible", + "Opportunity": "Challenge", + "Meeting": "Rendez-vous", + "Calendar": "Calendrier", + "Call": "Appel", + "Task": "Tâche", + "Case": "Ticket", + "InboundEmail": "Email Entrant" + }, + "scopeNamesPlural": { + "Account": "Comptes", + "Contact": "Contacts", + "Lead": "Leads", + "Target": "Cibles", + "Opportunity": "Opportunités", + "Meeting": "Rendez-vous", + "Calendar": "Calendrier", + "Call": "Appels", + "Task": "Tâches", + "Case": "Tickets", + "InboundEmail": "Emails Entrants" + }, + "dashlets": { + "Leads": "My Leads", + "Opportunities": "Mes Challenges", + "Tasks": "Mes Tâches", + "Cases": "Mes Tickets", + "Calendar": "Calendrier", + "OpportunitiesByStage": "*Challenges par étages", + "OpportunitiesByLeadSource": "Challenges par Lead Source", + "SalesByMonth": "Ventes par Mois", + "SalesPipeline": "Tuyaux des ventes" + }, + "labels": { + "Create InboundEmail": "Créer une boîte email", + "Activities": "Activités", + "History": "Historique", + "Attendees": "Participants", + "Schedule Meeting": "Rendez-vous Planifiés", + "Schedule Call": "Appels Planifiés", + "Compose Email": "Créer un Email", + "Log Meeting": "Journal des Rendez-vous", + "Log Call": "Journal d'appels", + "Archive Email": "Archiver les Emails", + "Create Task": "Créer une tâche", + "Tasks": "Tâches" + }, + "fields": { + "billingAddressCity": "Ville", + "billingAddressCountry": "Pays", + "billingAddressPostalCode": "Code Postal", + "billingAddressState": "Département", + "billingAddressStreet": "Rue", + "addressCity": "Ville", + "addressStreet": "Rue", + "addressCountry": "Pays", + "addressState": "Département", + "addressPostalCode": "Code Postal", + "shippingAddressCity": "City (Shipping)", + "shippingAddressStreet": "Street (Shipping)", + "shippingAddressCountry": "Country (Shipping)", + "shippingAddressState": "State (Shipping)", + "shippingAddressPostalCode": "Postal Code (Shipping)" + }, + "links": { + "contacts": "Contacts", + "opportunities": "Opportunités", + "leads": "Leads", + "meetings": "Rendez-vous", + "calls": "Appels", + "tasks": "Tâches", + "emails": "Courriers" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/InboundEmail.json index caadedc5cd..ee4b4472f1 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/InboundEmail.json @@ -1,43 +1,43 @@ { - "fields": { - "name": "Nom", - "team": "Equipe", - "status": "Statut", - "assignToUser": "Assigné à l'Utilisateur", - "host": "Hôte", - "username": "Nom d'utilisateur", - "password": "Mot de Passe", - "port": "Porte", - "monitoredFolders": "Dossiers Surveillés", - "trashFolder": "Corbeille", - "ssl": "SSL", - "createCase": "Créer un Ticket", - "reply": "Répondre", - "caseDistribution": "Distribution de tickets", - "replyEmailTemplate": "Modèle de Réponse par Email", - "replyFromAddress": "Répondre Depuis l'Adresse", - "replyFromName": "Répondre Depuis le Nom" - }, - "links": { - }, - "options": { - "status": { - "Active": "Activer", - "Inactive": "Désactiver" - }, - "caseDistribution": { - "Direct-Assignment": "Assignation Directe", - "Round-Robin": "Round-Robin", - "Least-Busy": "Least-Busy" - } - }, - "labels": { - "Create InboundEmail": "Créer une boîte email", - "IMAP": "IMAP", - "Actions": "Actions", - "Main": "Principal" - }, - "messages": { - "couldNotConnectToImap": "Impossible de se connecter au serveur IMAP" - } + "fields": { + "name": "Nom", + "team": "Equipe", + "status": "Statut", + "assignToUser": "Assigné à l'Utilisateur", + "host": "Hôte", + "username": "Nom d'utilisateur", + "password": "Mot de Passe", + "port": "Porte", + "monitoredFolders": "Dossiers Surveillés", + "trashFolder": "Corbeille", + "ssl": "SSL", + "createCase": "Créer un Ticket", + "reply": "Répondre", + "caseDistribution": "Distribution de tickets", + "replyEmailTemplate": "Modèle de Réponse par Email", + "replyFromAddress": "Répondre Depuis l'Adresse", + "replyFromName": "Répondre Depuis le Nom" + }, + "links": { + }, + "options": { + "status": { + "Active": "Activer", + "Inactive": "Désactiver" + }, + "caseDistribution": { + "Direct-Assignment": "Assignation Directe", + "Round-Robin": "Round-Robin", + "Least-Busy": "Least-Busy" + } + }, + "labels": { + "Create InboundEmail": "Créer une boîte email", + "IMAP": "IMAP", + "Actions": "Actions", + "Main": "Principal" + }, + "messages": { + "couldNotConnectToImap": "Impossible de se connecter au serveur IMAP" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Lead.json index 38f97b05f2..a01f0d5a04 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Lead.json @@ -1,46 +1,46 @@ { - "labels": { - "Converted To": "Convertir Vers", - "Create Lead": "Créer Lead", - "Convert": "Convertir" - }, - "fields": { - "name": "Nom", - "emailAddress": "Email", - "title": "Titre", - "website": "Site Web", - "phoneNumber": "Téléphone", - "accountName": "Nom du Compte", - "doNotCall": "Ne Pas Appeler", - "address": "Adresse", - "status": "Statut", - "source": "Source", - "opportunityAmount": "Montant du Challenge", - "description": "Description", - "createdAccount": "Compte", - "createdContact": "Contact", - "createdOpportunity": "Challenge" - }, - "links": { - }, - "options": { - "status": { - "New": "Nouveau", - "Assigned": "Assigné", - "In Process": "En Cours de Traitement", - "Converted": "Converti", - "Recycled": "Supprimé", - "Dead": "Mort" - }, - "source": { - "Call": "Appel", - "Email": "Email", - "Existing Customer": "Client Existant", - "Partner": "Partenaire", - "Public Relations": "Relations publiques", - "Web Site": "Site Web", - "Campaign": "Campagne", - "Other": "Autre" - } - } + "labels": { + "Converted To": "Convertir Vers", + "Create Lead": "Créer Lead", + "Convert": "Convertir" + }, + "fields": { + "name": "Nom", + "emailAddress": "Email", + "title": "Titre", + "website": "Site Web", + "phoneNumber": "Téléphone", + "accountName": "Nom du Compte", + "doNotCall": "Ne Pas Appeler", + "address": "Adresse", + "status": "Statut", + "source": "Source", + "opportunityAmount": "Montant du Challenge", + "description": "Description", + "createdAccount": "Compte", + "createdContact": "Contact", + "createdOpportunity": "Challenge" + }, + "links": { + }, + "options": { + "status": { + "New": "Nouveau", + "Assigned": "Assigné", + "In Process": "En Cours de Traitement", + "Converted": "Converti", + "Recycled": "Supprimé", + "Dead": "Mort" + }, + "source": { + "Call": "Appel", + "Email": "Email", + "Existing Customer": "Client Existant", + "Partner": "Partenaire", + "Public Relations": "Relations publiques", + "Web Site": "Site Web", + "Campaign": "Campagne", + "Other": "Autre" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Meeting.json index e8f2684935..75ead64b60 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Meeting.json @@ -1,29 +1,29 @@ { - "fields": { - "name": "Nom", - "parent": "Parent", - "status": "Statut", - "dateStart": "Date de Début", - "dateEnd": "Date de Fin", - "duration": "Durée", - "description": "Description", - "users": "Utilisateurs", - "contacts": "Contacts", - "leads": "Leads" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Plannifié", - "Held": "Fait", - "Not Held": "Pas Fait" - } - }, - "labels": { - "Create Meeting": "Créer un Rendez-vous", - "Set Held": "Marquer Fait", - "Set Not Held": "Marquer Pas Fait", - "Send Invitations": "Envoi d'Invitations" - } + "fields": { + "name": "Nom", + "parent": "Parent", + "status": "Statut", + "dateStart": "Date de Début", + "dateEnd": "Date de Fin", + "duration": "Durée", + "description": "Description", + "users": "Utilisateurs", + "contacts": "Contacts", + "leads": "Leads" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Plannifié", + "Held": "Fait", + "Not Held": "Pas Fait" + } + }, + "labels": { + "Create Meeting": "Créer un Rendez-vous", + "Set Held": "Marquer Fait", + "Set Not Held": "Marquer Pas Fait", + "Send Invitations": "Envoi d'Invitations" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Opportunity.json index 97d5dabe9f..2f9a1c9bcf 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Opportunity.json @@ -1,34 +1,34 @@ { - "fields": { - "name": "Nom", - "account": "Compte", - "stage": "Etage", - "amount": "Montant", - "probability": "Probabilité, %", - "leadSource": "Lead Source", - "doNotCall": "Ne Pas Appeler", - "closeDate": "Date de fermeture", - "contacts": "Contacts", - "description": "Description" - }, - "links": { - "contacts": "Contacts" - }, - "options": { - "stage": { - "Prospecting": "En Prospection", - "Qualification": "Qualification", - "Needs Analysis": "Analyse des besoins", - "Value Proposition": "Montant de la Proposition", - "Id. Decision Makers": "Id. Décisionnaire", - "Perception Analysis": "Analyse de la perception", - "Proposal/Price Quote": "Proposition/Devis", - "Negotiation/Review": "Négociation/avis", - "Closed Won": "Closed Won", - "Closed Lost": "Closed Lost" - } - }, - "labels": { - "Create Opportunity": "Créer un Challenge" - } + "fields": { + "name": "Nom", + "account": "Compte", + "stage": "Etage", + "amount": "Montant", + "probability": "Probabilité, %", + "leadSource": "Lead Source", + "doNotCall": "Ne Pas Appeler", + "closeDate": "Date de fermeture", + "contacts": "Contacts", + "description": "Description" + }, + "links": { + "contacts": "Contacts" + }, + "options": { + "stage": { + "Prospecting": "En Prospection", + "Qualification": "Qualification", + "Needs Analysis": "Analyse des besoins", + "Value Proposition": "Montant de la Proposition", + "Id. Decision Makers": "Id. Décisionnaire", + "Perception Analysis": "Analyse de la perception", + "Proposal/Price Quote": "Proposition/Devis", + "Negotiation/Review": "Négociation/avis", + "Closed Won": "Closed Won", + "Closed Lost": "Closed Lost" + } + }, + "labels": { + "Create Opportunity": "Créer un Challenge" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Target.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Target.json index d9239ee90b..4f1a262d52 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Target.json @@ -1,19 +1,19 @@ { - "fields": { - "name": "Nom", - "emailAddress": "Email", - "title": "Titre", - "website": "Site Web", - "accountName": "Nom du Compte", - "phoneNumber": "Téléphone", - "doNotCall": "Ne Pas Appeler", - "address": "Adresse", - "description": "Description" - }, - "links": { - }, - "labels": { - "Create Target": "Créer une Cible", - "Convert to Lead": "Convertir en Lead" - } + "fields": { + "name": "Nom", + "emailAddress": "Email", + "title": "Titre", + "website": "Site Web", + "accountName": "Nom du Compte", + "phoneNumber": "Téléphone", + "doNotCall": "Ne Pas Appeler", + "address": "Adresse", + "description": "Description" + }, + "links": { + }, + "labels": { + "Create Target": "Créer une Cible", + "Convert to Lead": "Convertir en Lead" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Task.json b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Task.json index 494c0fc9d0..5aee05bb20 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/fr_FR/Task.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Nom", - "parent": "Parent", - "status": "Statut", - "dateStart": "Date de Début", - "dateEnd": "Date d'échéance", - "priority": "Priorité", - "description": "Description", - "isOverdue": "Est en Retard" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Pas Commencé", - "Started": "Commencé", - "Completed": "Terminé", - "Canceled": "Annulé" - }, - "priority" : { - "Low": "Bas", - "Normal": "Normal", - "High": "Haut", - "Urgent": "Urgent" - } - }, - "labels": { - "Create Task": "Créer une tâche" - } + "fields": { + "name": "Nom", + "parent": "Parent", + "status": "Statut", + "dateStart": "Date de Début", + "dateEnd": "Date d'échéance", + "priority": "Priorité", + "description": "Description", + "isOverdue": "Est en Retard" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Pas Commencé", + "Started": "Commencé", + "Completed": "Terminé", + "Canceled": "Annulé" + }, + "priority" : { + "Low": "Bas", + "Normal": "Normal", + "High": "Haut", + "Urgent": "Urgent" + } + }, + "labels": { + "Create Task": "Créer une tâche" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Account.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Account.json index ea0cc1bfae..565692c8b0 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Record Naam", - "emailAddress": "Email", - "website": "Website", - "phoneNumber": "Telefoon", - "billingAddress": "Factuur Adres", - "shippingAddress": "Bezoek adres", - "description": "Beschrijving", - "sicCode": "Sic Code", - "industry": "Industrie", - "type": "Type", - "contactRole": "Voorwaarde" - }, - "links": { - "contacts": "Contactpersoon", - "opportunities": "Kansen", - "cases": "Zaken" - }, - "options": { - "type": { - "Customer": "Klant", - "Investor": "Investeerder", - "Partner": "Partner", - "Reseller": "Reseller" - }, - "industry": { - "Apparel": "Apparel", - "Banking": "Banking", - "Computer Software": "Computer Software", - "Education": "Educatie", - "Electronics": "Electronica", - "Finance": "Finance", - "Insurance": "Verzekeringen" - } - }, - "labels": { - "Create Account": "Maak Relatie" - } + "fields": { + "name": "Record Naam", + "emailAddress": "Email", + "website": "Website", + "phoneNumber": "Telefoon", + "billingAddress": "Factuur Adres", + "shippingAddress": "Bezoek adres", + "description": "Beschrijving", + "sicCode": "Sic Code", + "industry": "Industrie", + "type": "Type", + "contactRole": "Voorwaarde" + }, + "links": { + "contacts": "Contactpersoon", + "opportunities": "Kansen", + "cases": "Zaken" + }, + "options": { + "type": { + "Customer": "Klant", + "Investor": "Investeerder", + "Partner": "Partner", + "Reseller": "Reseller" + }, + "industry": { + "Apparel": "Apparel", + "Banking": "Banking", + "Computer Software": "Computer Software", + "Education": "Educatie", + "Electronics": "Electronica", + "Finance": "Finance", + "Insurance": "Verzekeringen" + } + }, + "labels": { + "Create Account": "Maak Relatie" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Calendar.json index 23ed5c0708..cc612779b6 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Maand", - "week": "Week", - "day": "Dag", - "agendaWeek": "Week", - "agendaDay": "Dag" - }, - "labels": { - "Today": "Vandaag", - "Create": "Maak" - } + "modes": { + "month": "Maand", + "week": "Week", + "day": "Dag", + "agendaWeek": "Week", + "agendaDay": "Dag" + }, + "labels": { + "Today": "Vandaag", + "Create": "Maak" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Call.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Call.json index f566efcbb1..32d4cdb4b1 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Call.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Record Naam", - "parent": "Behorende bij", - "status": "Status", - "dateStart": "Start Datum", - "dateEnd": "Eind Datum", - "direction": "Richting", - "duration": "Gedurende", - "description": "Beschrijving", - "users": "Gebruikers", - "contacts": "Contactpersoon", - "leads": "Leads" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Plannen", - "Held": "Volgen", - "Not Held": "Niet volgen" - }, - "direction": { - "Outbound": "Uitgaande", - "Inbound": "Binnenkomende" - } - }, - "labels": { - "Create Call": "Maak Call", - "Set Held": "Vasthouden", - "Set Not Held": "Niet Vasthouden", - "Send Invitations": "Uitnodiging versturen" - }, - "presetFilters": { - "planned": "Plannen", - "held": "Volgen", - "todays": "Vandaag" - } + "fields": { + "name": "Record Naam", + "parent": "Behorende bij", + "status": "Status", + "dateStart": "Start Datum", + "dateEnd": "Eind Datum", + "direction": "Richting", + "duration": "Gedurende", + "description": "Beschrijving", + "users": "Gebruikers", + "contacts": "Contactpersoon", + "leads": "Leads" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Plannen", + "Held": "Volgen", + "Not Held": "Niet volgen" + }, + "direction": { + "Outbound": "Uitgaande", + "Inbound": "Binnenkomende" + } + }, + "labels": { + "Create Call": "Maak Call", + "Set Held": "Vasthouden", + "Set Not Held": "Niet Vasthouden", + "Send Invitations": "Uitnodiging versturen" + }, + "presetFilters": { + "planned": "Plannen", + "held": "Volgen", + "todays": "Vandaag" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Case.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Case.json index b8134a0f7b..bee586dc3c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Case.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Record Naam", - "number": "Nummer", - "status": "Status", - "account": "Relatie", - "contact": "Contact", - "priority": "Prioriteit", - "type": "Type", - "description": "Beschrijving" - }, - "links": { - }, - "options": { - "status": { - "New": "Nieuw", - "Assigned": "Toegewezen", - "Pending": "Pending", - "Closed": "Gesloten", - "Rejected": "Geweigerd", - "Duplicate": "Dupliceer" - }, - "priority" : { - "Low": "Laag", - "Normal": "Normaal", - "High": "Hoog", - "Urgent": "Urgent" - }, - "type": { - "Question": "Vraag", - "Incident": "Incident", - "Problem": "Probleem" - } - }, - "labels": { - "Create Case": "Maak Case" - }, - "presetFilters": { - "open": "Open", - "closed": "Gesloten" - } + "fields": { + "name": "Record Naam", + "number": "Nummer", + "status": "Status", + "account": "Relatie", + "contact": "Contact", + "priority": "Prioriteit", + "type": "Type", + "description": "Beschrijving" + }, + "links": { + }, + "options": { + "status": { + "New": "Nieuw", + "Assigned": "Toegewezen", + "Pending": "Pending", + "Closed": "Gesloten", + "Rejected": "Geweigerd", + "Duplicate": "Dupliceer" + }, + "priority" : { + "Low": "Laag", + "Normal": "Normaal", + "High": "Hoog", + "Urgent": "Urgent" + }, + "type": { + "Question": "Vraag", + "Incident": "Incident", + "Problem": "Probleem" + } + }, + "labels": { + "Create Case": "Maak Case" + }, + "presetFilters": { + "open": "Open", + "closed": "Gesloten" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Contact.json index 933ea953ef..916db9d778 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Contact.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Record Naam", - "emailAddress": "Email", - "title": "Titel", - "account": "Relatie", - "accounts": "Relaties", - "phoneNumber": "Telefoon", - "accountType": "Relatie Type", - "doNotCall": "Niet Bellen", - "address": "Adres", - "opportunityRole": "Opportunity Role", - "accountRole": "Voorwaarde", - "description": "Beschrijving" - }, - "links": { - "opportunities": "Kansen", - "cases": "Zaken" - }, - "labels": { - "Create Contact": "Maak Contact" - }, - "options": { - "opportunityRole": { - "": "--Geen--", - "Decision Maker": "Beslisser", - "Evaluator": "Evaluator", - "Influencer": "Beinvloeder" - } - } + "fields": { + "name": "Record Naam", + "emailAddress": "Email", + "title": "Titel", + "account": "Relatie", + "accounts": "Relaties", + "phoneNumber": "Telefoon", + "accountType": "Relatie Type", + "doNotCall": "Niet Bellen", + "address": "Adres", + "opportunityRole": "Opportunity Role", + "accountRole": "Voorwaarde", + "description": "Beschrijving" + }, + "links": { + "opportunities": "Kansen", + "cases": "Zaken" + }, + "labels": { + "Create Contact": "Maak Contact" + }, + "options": { + "opportunityRole": { + "": "--Geen--", + "Decision Maker": "Beslisser", + "Evaluator": "Evaluator", + "Influencer": "Beinvloeder" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Global.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Global.json index 25544be147..7a3dacaf18 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Global.json @@ -1,81 +1,81 @@ { - "scopeNames": { - "Account": "Relatie", - "Contact": "Contact", - "Lead": "Lead", - "Target": "Doel", - "Opportunity": "Kans", - "Meeting": "Vergadering", - "Calendar": "Kalender", - "Call": "Oproep", - "Task": "Taak", - "Case": "Zaak", - "InboundEmail": "Binnenkomende Email" - }, - "scopeNamesPlural": { - "Account": "Relaties", - "Contact": "Contactpersoon", - "Lead": "Leads", - "Target": "Doel", - "Opportunity": "Kansen", - "Meeting": "Afspraken", - "Calendar": "Kalender", - "Call": "Tel.gesprekken", - "Task": "Taken", - "Case": "Zaken", - "InboundEmail": "Inkomende Emails" - }, - "dashlets": { - "Leads": "Mijn Leads", - "Opportunities": "Mijn Kansen", - "Tasks": "Mijn Taken", - "Cases": "Mijn Zaken", - "Calendar": "Kalender", - "Calls": "Mijn Tel.gesprekken", - "Meetings": "Mijn Afspraken", - "OpportunitiesByStage": "Status van Kansen", - "OpportunitiesByLeadSource": "Kans van Lead bron", - "SalesByMonth": "Verkopen per maand", - "SalesPipeline": "Verkoop mogelijkheden" - }, - "labels": { - "Create InboundEmail": "Instellen Email Gebruiker", - "Activities": "Activiteiten", - "History": "Historie", - "Attendees": "Genodigden", - "Schedule Meeting": "Plan Afspraak", - "Schedule Call": "Geplande Oproep", - "Compose Email": "Maak een Email", - "Log Meeting": "Leg afspraak vast", - "Log Call": "Leg tel.afspraak vast", - "Archive Email": "Archiveer Email", - "Create Task": "Maak een Taak", - "Tasks": "Taken" - }, - "fields": { - "billingAddressCity": "Plaats", - "billingAddressCountry": "Land", - "billingAddressPostalCode": "Postcode", - "billingAddressState": "Deelstaat", - "billingAddressStreet": "Straat", - "addressCity": "Plaats", - "addressStreet": "Straat", - "addressCountry": "Land", - "addressState": "Deelstaat", - "addressPostalCode": "Postcode", - "shippingAddressCity": "City (Shipping)", - "shippingAddressStreet": "Street (Shipping)", - "shippingAddressCountry": "Country (Shipping)", - "shippingAddressState": "State (Shipping)", - "shippingAddressPostalCode": "Postal Code (Shipping)" - }, - "links": { - "contacts": "Contactpersoon", - "opportunities": "Kansen", - "leads": "Leads", - "meetings": "Afspraken", - "calls": "Tel.gesprekken", - "tasks": "Taken", - "emails": "Emails" - } + "scopeNames": { + "Account": "Relatie", + "Contact": "Contact", + "Lead": "Lead", + "Target": "Doel", + "Opportunity": "Kans", + "Meeting": "Vergadering", + "Calendar": "Kalender", + "Call": "Oproep", + "Task": "Taak", + "Case": "Zaak", + "InboundEmail": "Binnenkomende Email" + }, + "scopeNamesPlural": { + "Account": "Relaties", + "Contact": "Contactpersoon", + "Lead": "Leads", + "Target": "Doel", + "Opportunity": "Kansen", + "Meeting": "Afspraken", + "Calendar": "Kalender", + "Call": "Tel.gesprekken", + "Task": "Taken", + "Case": "Zaken", + "InboundEmail": "Inkomende Emails" + }, + "dashlets": { + "Leads": "Mijn Leads", + "Opportunities": "Mijn Kansen", + "Tasks": "Mijn Taken", + "Cases": "Mijn Zaken", + "Calendar": "Kalender", + "Calls": "Mijn Tel.gesprekken", + "Meetings": "Mijn Afspraken", + "OpportunitiesByStage": "Status van Kansen", + "OpportunitiesByLeadSource": "Kans van Lead bron", + "SalesByMonth": "Verkopen per maand", + "SalesPipeline": "Verkoop mogelijkheden" + }, + "labels": { + "Create InboundEmail": "Instellen Email Gebruiker", + "Activities": "Activiteiten", + "History": "Historie", + "Attendees": "Genodigden", + "Schedule Meeting": "Plan Afspraak", + "Schedule Call": "Geplande Oproep", + "Compose Email": "Maak een Email", + "Log Meeting": "Leg afspraak vast", + "Log Call": "Leg tel.afspraak vast", + "Archive Email": "Archiveer Email", + "Create Task": "Maak een Taak", + "Tasks": "Taken" + }, + "fields": { + "billingAddressCity": "Plaats", + "billingAddressCountry": "Land", + "billingAddressPostalCode": "Postcode", + "billingAddressState": "Deelstaat", + "billingAddressStreet": "Straat", + "addressCity": "Plaats", + "addressStreet": "Straat", + "addressCountry": "Land", + "addressState": "Deelstaat", + "addressPostalCode": "Postcode", + "shippingAddressCity": "City (Shipping)", + "shippingAddressStreet": "Street (Shipping)", + "shippingAddressCountry": "Country (Shipping)", + "shippingAddressState": "State (Shipping)", + "shippingAddressPostalCode": "Postal Code (Shipping)" + }, + "links": { + "contacts": "Contactpersoon", + "opportunities": "Kansen", + "leads": "Leads", + "meetings": "Afspraken", + "calls": "Tel.gesprekken", + "tasks": "Taken", + "emails": "Emails" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/InboundEmail.json index 49b55511f4..7ce2cc27f2 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/InboundEmail.json @@ -1,52 +1,52 @@ { - "fields": { - "name": "Record Naam", - "team": "Team", - "status": "Status", - "assignToUser": "Toegewezen aan gebruiker", - "host": "Host", - "username": "Gebruikersnaam", - "password": "Wachtwoord", - "port": "Poort", - "monitoredFolders": "Gecontroleerde Folders", - "trashFolder": "Prullenbak Folder", - "ssl": "SSL", - "createCase": "Maak Case", - "reply": "Antw.", - "caseDistribution": "Zaak Verdelen", - "replyEmailTemplate": "Antw. Email Template", - "replyFromAddress": "Antw. van Adres", - "replyToAddress": "Reply To Address", - "replyFromName": "Antw. van Naam" - }, - "tooltips": { - "reply": "Notify email senders that their emails has been received.", - "createCase": "Automatically create case from incoming emails.", - "replyToAddress": "Specify email address of this mailbox to make response come here.", - "caseDistribution": "How cases will be assigned to. Assigned directly to the user or among the team.", - "assignToUser": "User emails/cases will be assigned to.", - "team": "Team emails/cases will be related to." - }, - "links": { - }, - "options": { - "status": { - "Active": "Active", - "Inactive": "Inactive" - }, - "caseDistribution": { - "Direct-Assignment": "Directe-Toewijzing", - "Round-Robin": "Round-Robin", - "Least-Busy": "Minst-Bezet" - } - }, - "labels": { - "Create InboundEmail": "Instellen Email Gebruiker", - "IMAP": "IMAP", - "Actions": "Acties", - "Main": "Hoofd" - }, - "messages": { - "couldNotConnectToImap": "Kan geen verbinding maken met IMAP server" - } + "fields": { + "name": "Record Naam", + "team": "Team", + "status": "Status", + "assignToUser": "Toegewezen aan gebruiker", + "host": "Host", + "username": "Gebruikersnaam", + "password": "Wachtwoord", + "port": "Poort", + "monitoredFolders": "Gecontroleerde Folders", + "trashFolder": "Prullenbak Folder", + "ssl": "SSL", + "createCase": "Maak Case", + "reply": "Antw.", + "caseDistribution": "Zaak Verdelen", + "replyEmailTemplate": "Antw. Email Template", + "replyFromAddress": "Antw. van Adres", + "replyToAddress": "Reply To Address", + "replyFromName": "Antw. van Naam" + }, + "tooltips": { + "reply": "Notify email senders that their emails has been received.", + "createCase": "Automatically create case from incoming emails.", + "replyToAddress": "Specify email address of this mailbox to make response come here.", + "caseDistribution": "How cases will be assigned to. Assigned directly to the user or among the team.", + "assignToUser": "User emails/cases will be assigned to.", + "team": "Team emails/cases will be related to." + }, + "links": { + }, + "options": { + "status": { + "Active": "Active", + "Inactive": "Inactive" + }, + "caseDistribution": { + "Direct-Assignment": "Directe-Toewijzing", + "Round-Robin": "Round-Robin", + "Least-Busy": "Minst-Bezet" + } + }, + "labels": { + "Create InboundEmail": "Instellen Email Gebruiker", + "IMAP": "IMAP", + "Actions": "Acties", + "Main": "Hoofd" + }, + "messages": { + "couldNotConnectToImap": "Kan geen verbinding maken met IMAP server" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Lead.json index 3b029cd72b..dd735c7709 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Lead.json @@ -1,50 +1,50 @@ { - "labels": { - "Converted To": "Vertaald naar", - "Create Lead": "Grote Lead", - "Convert": "Converteer" - }, - "fields": { - "name": "Record Naam", - "emailAddress": "Email", - "title": "Titel", - "website": "Website", - "phoneNumber": "Telefoon", - "accountName": "Relatie Naam", - "doNotCall": "Niet Bellen", - "address": "Adres", - "status": "Status", - "source": "Bron", - "opportunityAmount": "Aantal uitdagingen", - "opportunityAmountConverted": "Opportunity Amount (converted)", - "description": "Beschrijving", - "createdAccount": "Relatie", - "createdContact": "Contact", - "createdOpportunity": "Kans" - }, - "links": { - }, - "options": { - "status": { - "New": "Nieuw", - "Assigned": "Toegewezen", - "In Process": "In Behandeling", - "Converted": "Converteren", - "Recycled": "Opnieuw verwerkt", - "Dead": "Dood" - }, - "source": { - "Call": "Oproep", - "Email": "Email", - "Existing Customer": "Bestaande Klant", - "Partner": "Partner", - "Public Relations": "Public Relations", - "Web Site": "Web Pagina", - "Campaign": "Campagne", - "Other": "Ander" - } - }, - "presetFilters": { - "active": "Active" - } + "labels": { + "Converted To": "Vertaald naar", + "Create Lead": "Grote Lead", + "Convert": "Converteer" + }, + "fields": { + "name": "Record Naam", + "emailAddress": "Email", + "title": "Titel", + "website": "Website", + "phoneNumber": "Telefoon", + "accountName": "Relatie Naam", + "doNotCall": "Niet Bellen", + "address": "Adres", + "status": "Status", + "source": "Bron", + "opportunityAmount": "Aantal uitdagingen", + "opportunityAmountConverted": "Opportunity Amount (converted)", + "description": "Beschrijving", + "createdAccount": "Relatie", + "createdContact": "Contact", + "createdOpportunity": "Kans" + }, + "links": { + }, + "options": { + "status": { + "New": "Nieuw", + "Assigned": "Toegewezen", + "In Process": "In Behandeling", + "Converted": "Converteren", + "Recycled": "Opnieuw verwerkt", + "Dead": "Dood" + }, + "source": { + "Call": "Oproep", + "Email": "Email", + "Existing Customer": "Bestaande Klant", + "Partner": "Partner", + "Public Relations": "Public Relations", + "Web Site": "Web Pagina", + "Campaign": "Campagne", + "Other": "Ander" + } + }, + "presetFilters": { + "active": "Active" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Meeting.json index a40b377220..f8dbca38b8 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Meeting.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Record Naam", - "parent": "Behorende bij", - "status": "Status", - "dateStart": "Start Datum", - "dateEnd": "Eind Datum", - "duration": "Gedurende", - "description": "Beschrijving", - "users": "Gebruikers", - "contacts": "Contactpersoon", - "leads": "Leads" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Plannen", - "Held": "Volgen", - "Not Held": "Niet volgen" - } - }, - "labels": { - "Create Meeting": "Plan Vergadering", - "Set Held": "Vasthouden", - "Set Not Held": "Niet Vasthouden", - "Send Invitations": "Uitnodiging versturen", - "Saved as Held": "Opslaan Bewaren", - "Saved as Not Held": "Opslaan niet Bewaren" - }, - "presetFilters": { - "planned": "Plannen", - "held": "Volgen", - "todays": "Vandaag" - } + "fields": { + "name": "Record Naam", + "parent": "Behorende bij", + "status": "Status", + "dateStart": "Start Datum", + "dateEnd": "Eind Datum", + "duration": "Gedurende", + "description": "Beschrijving", + "users": "Gebruikers", + "contacts": "Contactpersoon", + "leads": "Leads" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Plannen", + "Held": "Volgen", + "Not Held": "Niet volgen" + } + }, + "labels": { + "Create Meeting": "Plan Vergadering", + "Set Held": "Vasthouden", + "Set Not Held": "Niet Vasthouden", + "Send Invitations": "Uitnodiging versturen", + "Saved as Held": "Opslaan Bewaren", + "Saved as Not Held": "Opslaan niet Bewaren" + }, + "presetFilters": { + "planned": "Plannen", + "held": "Volgen", + "todays": "Vandaag" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Opportunity.json index 759770efb5..e7fae9bbea 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Opportunity.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Record Naam", - "account": "Relatie", - "stage": "Status", - "amount": "Aantal", - "probability": "Naar waarschijnlijkheid, %", - "leadSource": "Lead Bron", - "doNotCall": "Niet Bellen", - "closeDate": "Datum gesloten", - "contacts": "Contactpersoon", - "description": "Beschrijving", - "amountConverted": "Amount (converted)" - }, - "links": { - "contacts": "Contactpersoon" - }, - "options": { - "stage": { - "Prospecting": "Prospecting", - "Qualification": "Kwalificeren", - "Needs Analysis": "Benodigde Analyse", - "Value Proposition": "Waarde Schatting", - "Id. Decision Makers": "Id. Beslissiers", - "Perception Analysis": "Perceptie Analyse", - "Proposal/Price Quote": "Prijs/Voorstel", - "Negotiation/Review": "Onderhandeling/Herziening", - "Closed Won": "Gesloten Gewonnen", - "Closed Lost": "Gesloten Verloren" - } - }, - "labels": { - "Create Opportunity": "Grote Uitdaging" - }, - "presetFilters": { - "open": "Open", - "won": "Gewonnen" - } + "fields": { + "name": "Record Naam", + "account": "Relatie", + "stage": "Status", + "amount": "Aantal", + "probability": "Naar waarschijnlijkheid, %", + "leadSource": "Lead Bron", + "doNotCall": "Niet Bellen", + "closeDate": "Datum gesloten", + "contacts": "Contactpersoon", + "description": "Beschrijving", + "amountConverted": "Amount (converted)" + }, + "links": { + "contacts": "Contactpersoon" + }, + "options": { + "stage": { + "Prospecting": "Prospecting", + "Qualification": "Kwalificeren", + "Needs Analysis": "Benodigde Analyse", + "Value Proposition": "Waarde Schatting", + "Id. Decision Makers": "Id. Beslissiers", + "Perception Analysis": "Perceptie Analyse", + "Proposal/Price Quote": "Prijs/Voorstel", + "Negotiation/Review": "Onderhandeling/Herziening", + "Closed Won": "Gesloten Gewonnen", + "Closed Lost": "Gesloten Verloren" + } + }, + "labels": { + "Create Opportunity": "Grote Uitdaging" + }, + "presetFilters": { + "open": "Open", + "won": "Gewonnen" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Target.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Target.json index 40255a1666..03d77be20a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Target.json @@ -1,19 +1,19 @@ { - "fields": { - "name": "Record Naam", - "emailAddress": "Email", - "title": "Titel", - "website": "Website", - "accountName": "Relatie Naam", - "phoneNumber": "Telefoon", - "doNotCall": "Niet Bellen", - "address": "Adres", - "description": "Beschrijving" - }, - "links": { - }, - "labels": { - "Create Target": "Maak een doel", - "Convert to Lead": "Naar Lead omzetten" - } + "fields": { + "name": "Record Naam", + "emailAddress": "Email", + "title": "Titel", + "website": "Website", + "accountName": "Relatie Naam", + "phoneNumber": "Telefoon", + "doNotCall": "Niet Bellen", + "address": "Adres", + "description": "Beschrijving" + }, + "links": { + }, + "labels": { + "Create Target": "Maak een doel", + "Convert to Lead": "Naar Lead omzetten" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Task.json b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Task.json index 758dfb711b..41d1b19846 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Task.json @@ -1,37 +1,37 @@ { - "fields": { - "name": "Record Naam", - "parent": "Behorende bij", - "status": "Status", - "dateStart": "Start Datum", - "dateEnd": "Vervaldatum", - "priority": "Prioriteit", - "description": "Beschrijving", - "isOverdue": "Te Laat" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Niet Gestart", - "Started": "Gestart", - "Completed": "Beeindigd", - "Canceled": "Geannuleerd" - }, - "priority" : { - "Low": "Laag", - "Normal": "Normaal", - "High": "Hoog", - "Urgent": "Urgent" - } - }, - "labels": { - "Create Task": "Maak een Taak" - }, - "presetFilters": { - "active": "Active", - "completed": "Beeindigd", - "todays": "Vandaag", - "overdue": "Laat" - } + "fields": { + "name": "Record Naam", + "parent": "Behorende bij", + "status": "Status", + "dateStart": "Start Datum", + "dateEnd": "Vervaldatum", + "priority": "Prioriteit", + "description": "Beschrijving", + "isOverdue": "Te Laat" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Niet Gestart", + "Started": "Gestart", + "Completed": "Beeindigd", + "Canceled": "Geannuleerd" + }, + "priority" : { + "Low": "Laag", + "Normal": "Normaal", + "High": "Hoog", + "Urgent": "Urgent" + } + }, + "labels": { + "Create Task": "Maak een Taak" + }, + "presetFilters": { + "active": "Active", + "completed": "Beeindigd", + "todays": "Vandaag", + "overdue": "Laat" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Account.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Account.json index bbf862ede4..b8bb78a45c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Imię", - "emailAddress": "E-mail", - "website": "Strona Internetowa", - "phoneNumber": "Telefon", - "billingAddress": "Adres Firmy", - "shippingAddress": "Adres Dostawy", - "description": "Opis ", - "sicCode": "PKD", - "industry": "Branża", - "type": "Rodzaj", - "contactRole": "Rola" - }, - "links": { - "contacts": "Kontakty", - "opportunities": "Szanse Sprzedaży", - "cases": "Zlecenia" - }, - "options": { - "type": { - "Customer": "Klient", - "Investor": "Inwestor", - "Partner": "Partner", - "Reseller": "Sprzedawca" - }, - "industry": { - "Apparel": "Odzież", - "Banking": "Bankowość", - "Computer Software": "Oprogramowanie Komputerowe", - "Education": "Edukacja", - "Electronics": "Elektronika", - "Finance": "Finanse", - "Insurance": "Ubezpieczenia" - } - }, - "labels": { - "Create Account": "Utwórz Konto" - } + "fields": { + "name": "Imię", + "emailAddress": "E-mail", + "website": "Strona Internetowa", + "phoneNumber": "Telefon", + "billingAddress": "Adres Firmy", + "shippingAddress": "Adres Dostawy", + "description": "Opis ", + "sicCode": "PKD", + "industry": "Branża", + "type": "Rodzaj", + "contactRole": "Rola" + }, + "links": { + "contacts": "Kontakty", + "opportunities": "Szanse Sprzedaży", + "cases": "Zlecenia" + }, + "options": { + "type": { + "Customer": "Klient", + "Investor": "Inwestor", + "Partner": "Partner", + "Reseller": "Sprzedawca" + }, + "industry": { + "Apparel": "Odzież", + "Banking": "Bankowość", + "Computer Software": "Oprogramowanie Komputerowe", + "Education": "Edukacja", + "Electronics": "Elektronika", + "Finance": "Finanse", + "Insurance": "Ubezpieczenia" + } + }, + "labels": { + "Create Account": "Utwórz Konto" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Calendar.json index 01f567da28..857ffb9508 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Miesiąc", - "week": "Tydzień", - "day": "Dzień", - "agendaWeek": "Tydzień", - "agendaDay": "Dzień" - }, - "labels": { - "Today": "Dziś", - "Create": "Utwórz" - } + "modes": { + "month": "Miesiąc", + "week": "Tydzień", + "day": "Dzień", + "agendaWeek": "Tydzień", + "agendaDay": "Dzień" + }, + "labels": { + "Today": "Dziś", + "Create": "Utwórz" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Call.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Call.json index 92e071ea8f..6398d7952b 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Call.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Imię", - "parent": "Konto", - "status": "Status", - "dateStart": "Data Startu", - "dateEnd": "Data Zakończenia", - "direction": "Kierunek", - "duration": "Czas", - "description": "Opis ", - "users": "Użytkownik", - "contacts": "Kontakty", - "leads": "Potencjalne Kontakty" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planowane", - "Held": "Zatrzymany", - "Not Held": "Nie zatrzymany" - }, - "direction": { - "Outbound": "Wychodzący", - "Inbound": "Przychodzący" - } - }, - "labels": { - "Create Call": "Utwórz Telefon", - "Set Held": "Ustaw Zatrzymanie", - "Set Not Held": "Ustaw nie Zatrzymany", - "Send Invitations": "Wyślij Powiadomienie" - }, - "presetFilters": { - "planned": "Planowane", - "held": "Zatrzymany", - "todays": "Dzisiaj" - } + "fields": { + "name": "Imię", + "parent": "Konto", + "status": "Status", + "dateStart": "Data Startu", + "dateEnd": "Data Zakończenia", + "direction": "Kierunek", + "duration": "Czas", + "description": "Opis ", + "users": "Użytkownik", + "contacts": "Kontakty", + "leads": "Potencjalne Kontakty" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planowane", + "Held": "Zatrzymany", + "Not Held": "Nie zatrzymany" + }, + "direction": { + "Outbound": "Wychodzący", + "Inbound": "Przychodzący" + } + }, + "labels": { + "Create Call": "Utwórz Telefon", + "Set Held": "Ustaw Zatrzymanie", + "Set Not Held": "Ustaw nie Zatrzymany", + "Send Invitations": "Wyślij Powiadomienie" + }, + "presetFilters": { + "planned": "Planowane", + "held": "Zatrzymany", + "todays": "Dzisiaj" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Case.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Case.json index 0996b7460f..2110bd1bc7 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Case.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Imię", - "number": "Numer", - "status": "Status", - "account": "Konto", - "contact": "Kontakty", - "priority": "Pryjorytet", - "type": "Rodzaj", - "description": "Opis " - }, - "links": { - }, - "options": { - "status": { - "New": "Nowy", - "Assigned": "Przypisany", - "Pending": "Oczekuje", - "Closed": "Zamknięty", - "Rejected": "Odrzucony", - "Duplicate": "Powielony" - }, - "priority" : { - "Low": "Niski", - "Normal": "Normalny", - "High": "Wysoki", - "Urgent": "Pilne" - }, - "type": { - "Question": "Pytanie", - "Incident": "Zdarzenie", - "Problem": "Problem" - } - }, - "labels": { - "Create Case": "Utwórz Sprawę" - }, - "presetFilters": { - "open": "Otwórz", - "closed": "Zamknięty" - } + "fields": { + "name": "Imię", + "number": "Numer", + "status": "Status", + "account": "Konto", + "contact": "Kontakty", + "priority": "Pryjorytet", + "type": "Rodzaj", + "description": "Opis " + }, + "links": { + }, + "options": { + "status": { + "New": "Nowy", + "Assigned": "Przypisany", + "Pending": "Oczekuje", + "Closed": "Zamknięty", + "Rejected": "Odrzucony", + "Duplicate": "Powielony" + }, + "priority" : { + "Low": "Niski", + "Normal": "Normalny", + "High": "Wysoki", + "Urgent": "Pilne" + }, + "type": { + "Question": "Pytanie", + "Incident": "Zdarzenie", + "Problem": "Problem" + } + }, + "labels": { + "Create Case": "Utwórz Sprawę" + }, + "presetFilters": { + "open": "Otwórz", + "closed": "Zamknięty" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Contact.json index e77e2ed136..54d9818cd0 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Contact.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Imię", - "emailAddress": "E-mail", - "title": "Tytuł", - "account": "Konto", - "accounts": "Klienci", - "phoneNumber": "Telefon", - "accountType": "Typ Klienta", - "doNotCall": "Nie Dzwoń", - "address": "Adres", - "opportunityRole": "Rola Szansy Sprzedaży", - "accountRole": "Rola", - "description": "Opis " - }, - "links": { - "opportunities": "Szanse Sprzedaży", - "cases": "Zlecenia" - }, - "labels": { - "Create Contact": "Utwórz Kontakt" - }, - "options": { - "opportunityRole": { - "": "--NIC--", - "Decision Maker": "Osoba Decyzyjna", - "Evaluator": "Oceniający", - "Influencer": "Wpływający" - } - } + "fields": { + "name": "Imię", + "emailAddress": "E-mail", + "title": "Tytuł", + "account": "Konto", + "accounts": "Klienci", + "phoneNumber": "Telefon", + "accountType": "Typ Klienta", + "doNotCall": "Nie Dzwoń", + "address": "Adres", + "opportunityRole": "Rola Szansy Sprzedaży", + "accountRole": "Rola", + "description": "Opis " + }, + "links": { + "opportunities": "Szanse Sprzedaży", + "cases": "Zlecenia" + }, + "labels": { + "Create Contact": "Utwórz Kontakt" + }, + "options": { + "opportunityRole": { + "": "--NIC--", + "Decision Maker": "Osoba Decyzyjna", + "Evaluator": "Oceniający", + "Influencer": "Wpływający" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Global.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Global.json index e25da86e1f..82209b234f 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Global.json @@ -1,81 +1,81 @@ { - "scopeNames": { - "Account": "Konto", - "Contact": "Kontakty", - "Lead": "Potencjalny Kontakt", - "Target": "Cel", - "Opportunity": "Szansa Sprzedaży", - "Meeting": "Spotkanie", - "Calendar": "Kalendarz", - "Call": "Telefon", - "Task": "Zadanie", - "Case": "Sprawa", - "InboundEmail": "Poczta Przychodząca" - }, - "scopeNamesPlural": { - "Account": "Klienci", - "Contact": "Kontakty", - "Lead": "Potencjalne Kontakty", - "Target": "Cele", - "Opportunity": "Szanse Sprzedaży", - "Meeting": "Spotkania", - "Calendar": "Kalendarz", - "Call": "Telefony", - "Task": "Zadania", - "Case": "Zlecenia", - "InboundEmail": "Poczta Przychodząca" - }, - "dashlets": { - "Leads": "Moje Potencjalne Kontakty", - "Opportunities": "Moje Szanse Sprzedaży", - "Tasks": "Moje Zadania", - "Cases": "Moje Zlecenia", - "Calendar": "Kalendarz", - "Calls": "Moje Telefony", - "Meetings": "Moje Spotkania", - "OpportunitiesByStage": "Szansa Sprzedaży/Etap/", - "OpportunitiesByLeadSource": "Szansa Sprzedaży/Potencjalny kontakt/", - "SalesByMonth": "Sprzedaż Miesięczna", - "SalesPipeline": "Lejek Sprzedaży" - }, - "labels": { - "Create InboundEmail": "Utwórz Pocztę Przychodzącą", - "Activities": "Aktywności", - "History": "Historia", - "Attendees": "Uczestnicy", - "Schedule Meeting": "Zaplanuj Spotkanie", - "Schedule Call": "Zaplanuj Telefon", - "Compose Email": "Utwórz Wiadomość", - "Log Meeting": "Zarejestruj Spotkanie", - "Log Call": "Zarejestruj Telefon", - "Archive Email": "Archiwizuj e-mail", - "Create Task": "Utwórz Zadanie", - "Tasks": "Zadania" - }, - "fields": { - "billingAddressCity": "Miasto", - "billingAddressCountry": "Kraj", - "billingAddressPostalCode": "Kod Pocztowy", - "billingAddressState": "Województwo", - "billingAddressStreet": "Ulica", - "addressCity": "Miasto", - "addressStreet": "Ulica", - "addressCountry": "Kraj", - "addressState": "Województwo", - "addressPostalCode": "Kod Pocztowy", - "shippingAddressCity": "City (Shipping)", - "shippingAddressStreet": "Street (Shipping)", - "shippingAddressCountry": "Country (Shipping)", - "shippingAddressState": "State (Shipping)", - "shippingAddressPostalCode": "Postal Code (Shipping)" - }, - "links": { - "contacts": "Kontakty", - "opportunities": "Szanse Sprzedaży", - "leads": "Potencjalne Kontakty", - "meetings": "Spotkania", - "calls": "Telefony", - "tasks": "Zadania", - "emails": "Emails" - } + "scopeNames": { + "Account": "Konto", + "Contact": "Kontakty", + "Lead": "Potencjalny Kontakt", + "Target": "Cel", + "Opportunity": "Szansa Sprzedaży", + "Meeting": "Spotkanie", + "Calendar": "Kalendarz", + "Call": "Telefon", + "Task": "Zadanie", + "Case": "Sprawa", + "InboundEmail": "Poczta Przychodząca" + }, + "scopeNamesPlural": { + "Account": "Klienci", + "Contact": "Kontakty", + "Lead": "Potencjalne Kontakty", + "Target": "Cele", + "Opportunity": "Szanse Sprzedaży", + "Meeting": "Spotkania", + "Calendar": "Kalendarz", + "Call": "Telefony", + "Task": "Zadania", + "Case": "Zlecenia", + "InboundEmail": "Poczta Przychodząca" + }, + "dashlets": { + "Leads": "Moje Potencjalne Kontakty", + "Opportunities": "Moje Szanse Sprzedaży", + "Tasks": "Moje Zadania", + "Cases": "Moje Zlecenia", + "Calendar": "Kalendarz", + "Calls": "Moje Telefony", + "Meetings": "Moje Spotkania", + "OpportunitiesByStage": "Szansa Sprzedaży/Etap/", + "OpportunitiesByLeadSource": "Szansa Sprzedaży/Potencjalny kontakt/", + "SalesByMonth": "Sprzedaż Miesięczna", + "SalesPipeline": "Lejek Sprzedaży" + }, + "labels": { + "Create InboundEmail": "Utwórz Pocztę Przychodzącą", + "Activities": "Aktywności", + "History": "Historia", + "Attendees": "Uczestnicy", + "Schedule Meeting": "Zaplanuj Spotkanie", + "Schedule Call": "Zaplanuj Telefon", + "Compose Email": "Utwórz Wiadomość", + "Log Meeting": "Zarejestruj Spotkanie", + "Log Call": "Zarejestruj Telefon", + "Archive Email": "Archiwizuj e-mail", + "Create Task": "Utwórz Zadanie", + "Tasks": "Zadania" + }, + "fields": { + "billingAddressCity": "Miasto", + "billingAddressCountry": "Kraj", + "billingAddressPostalCode": "Kod Pocztowy", + "billingAddressState": "Województwo", + "billingAddressStreet": "Ulica", + "addressCity": "Miasto", + "addressStreet": "Ulica", + "addressCountry": "Kraj", + "addressState": "Województwo", + "addressPostalCode": "Kod Pocztowy", + "shippingAddressCity": "City (Shipping)", + "shippingAddressStreet": "Street (Shipping)", + "shippingAddressCountry": "Country (Shipping)", + "shippingAddressState": "State (Shipping)", + "shippingAddressPostalCode": "Postal Code (Shipping)" + }, + "links": { + "contacts": "Kontakty", + "opportunities": "Szanse Sprzedaży", + "leads": "Potencjalne Kontakty", + "meetings": "Spotkania", + "calls": "Telefony", + "tasks": "Zadania", + "emails": "Emails" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/InboundEmail.json index c5baa624f4..8b10eb7e99 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/InboundEmail.json @@ -1,52 +1,52 @@ { - "fields": { - "name": "Imię", - "team": "Zespół", - "status": "Status", - "assignToUser": "Przypisz do Użytkonika", - "host": "Host", - "username": "Użytkownik", - "password": "Hasło", - "port": "Port", - "monitoredFolders": "Monitorowane Foldery", - "trashFolder": "Elementy Usunięte", - "ssl": "SSL", - "createCase": "Utwórz Sprawę", - "reply": "Odpowiedz", - "caseDistribution": "Dystrybucja Spraw", - "replyEmailTemplate": "Szablon Odpowiedzi", - "replyFromAddress": "Odpowiedz z Adresu", - "replyToAddress": "Odpowiedz na Adres", - "replyFromName": "Odpowiedz z Nazwy" - }, - "tooltips": { - "reply": "Potwierdzenie otrzymania wiadomości.", - "createCase": "Automatycznie utwórz sprawę z przychodzącej wiadomości.", - "replyToAddress": "Podaj adres e-mail z tej skrzynki pocztowej, aby tu odpowiedź.", - "caseDistribution": "Jak zlecenie zostanie przypisane do. Przypisane bezpośrednio do użytkownika lub między zespołem", - "assignToUser": "E-mail użytkownika/zlecenia zostanie przypisany do.", - "team": "E-mail do zespołu/zlecenia zostaną związane z." - }, - "links": { - }, - "options": { - "status": { - "Active": "Aktywny", - "Inactive": "Nie Aktywny" - }, - "caseDistribution": { - "Direct-Assignment": "Przypisanie bezpośrednio", - "Round-Robin": "Przypisanie Karuzelowe", - "Least-Busy": "Least-Busy" - } - }, - "labels": { - "Create InboundEmail": "Utwórz Pocztę Przychodzącą", - "IMAP": "IMAP", - "Actions": "Akcja", - "Main": "Główny" - }, - "messages": { - "couldNotConnectToImap": "Nie mogę połączyć się z serwerem IMAP" - } + "fields": { + "name": "Imię", + "team": "Zespół", + "status": "Status", + "assignToUser": "Przypisz do Użytkonika", + "host": "Host", + "username": "Użytkownik", + "password": "Hasło", + "port": "Port", + "monitoredFolders": "Monitorowane Foldery", + "trashFolder": "Elementy Usunięte", + "ssl": "SSL", + "createCase": "Utwórz Sprawę", + "reply": "Odpowiedz", + "caseDistribution": "Dystrybucja Spraw", + "replyEmailTemplate": "Szablon Odpowiedzi", + "replyFromAddress": "Odpowiedz z Adresu", + "replyToAddress": "Odpowiedz na Adres", + "replyFromName": "Odpowiedz z Nazwy" + }, + "tooltips": { + "reply": "Potwierdzenie otrzymania wiadomości.", + "createCase": "Automatycznie utwórz sprawę z przychodzącej wiadomości.", + "replyToAddress": "Podaj adres e-mail z tej skrzynki pocztowej, aby tu odpowiedź.", + "caseDistribution": "Jak zlecenie zostanie przypisane do. Przypisane bezpośrednio do użytkownika lub między zespołem", + "assignToUser": "E-mail użytkownika/zlecenia zostanie przypisany do.", + "team": "E-mail do zespołu/zlecenia zostaną związane z." + }, + "links": { + }, + "options": { + "status": { + "Active": "Aktywny", + "Inactive": "Nie Aktywny" + }, + "caseDistribution": { + "Direct-Assignment": "Przypisanie bezpośrednio", + "Round-Robin": "Przypisanie Karuzelowe", + "Least-Busy": "Least-Busy" + } + }, + "labels": { + "Create InboundEmail": "Utwórz Pocztę Przychodzącą", + "IMAP": "IMAP", + "Actions": "Akcja", + "Main": "Główny" + }, + "messages": { + "couldNotConnectToImap": "Nie mogę połączyć się z serwerem IMAP" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Lead.json index 70a692ca35..29a703833b 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Lead.json @@ -1,50 +1,50 @@ { - "labels": { - "Converted To": "Przekształcony w ", - "Create Lead": "Utwórz Potencjalny Kontakt", - "Convert": "Przekształć" - }, - "fields": { - "name": "Imię", - "emailAddress": "E-mail", - "title": "Tytuł", - "website": "Strona Internetowa", - "phoneNumber": "Telefon", - "accountName": "Nazwa Konta", - "doNotCall": "Nie Dzwoń", - "address": "Adres", - "status": "Status", - "source": "Źródło", - "opportunityAmount": "Wartość Szansy Sprzewdaży", - "opportunityAmountConverted": "Opportunity Amount (converted)", - "description": "Opis ", - "createdAccount": "Konto", - "createdContact": "Kontakty", - "createdOpportunity": "Szansa Sprzedaży" - }, - "links": { - }, - "options": { - "status": { - "New": "Nowy", - "Assigned": "Przypisany", - "In Process": "W trakcie", - "Converted": "Przekształcony", - "Recycled": "Usunięty", - "Dead": "Martwy" - }, - "source": { - "Call": "Telefon", - "Email": "E-mail", - "Existing Customer": "Istniejący klient", - "Partner": "Partner", - "Public Relations": "Relacje", - "Web Site": "Stwona Internetowa", - "Campaign": "Kampania", - "Other": "Inny" - } - }, - "presetFilters": { - "active": "Aktywny" - } + "labels": { + "Converted To": "Przekształcony w ", + "Create Lead": "Utwórz Potencjalny Kontakt", + "Convert": "Przekształć" + }, + "fields": { + "name": "Imię", + "emailAddress": "E-mail", + "title": "Tytuł", + "website": "Strona Internetowa", + "phoneNumber": "Telefon", + "accountName": "Nazwa Konta", + "doNotCall": "Nie Dzwoń", + "address": "Adres", + "status": "Status", + "source": "Źródło", + "opportunityAmount": "Wartość Szansy Sprzewdaży", + "opportunityAmountConverted": "Opportunity Amount (converted)", + "description": "Opis ", + "createdAccount": "Konto", + "createdContact": "Kontakty", + "createdOpportunity": "Szansa Sprzedaży" + }, + "links": { + }, + "options": { + "status": { + "New": "Nowy", + "Assigned": "Przypisany", + "In Process": "W trakcie", + "Converted": "Przekształcony", + "Recycled": "Usunięty", + "Dead": "Martwy" + }, + "source": { + "Call": "Telefon", + "Email": "E-mail", + "Existing Customer": "Istniejący klient", + "Partner": "Partner", + "Public Relations": "Relacje", + "Web Site": "Stwona Internetowa", + "Campaign": "Kampania", + "Other": "Inny" + } + }, + "presetFilters": { + "active": "Aktywny" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Meeting.json index fe144d8b3c..56f1418f70 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Meeting.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Imię", - "parent": "Konto", - "status": "Status", - "dateStart": "Data Startu", - "dateEnd": "Data Zakończenia", - "duration": "Czas", - "description": "Opis ", - "users": "Użytkownik", - "contacts": "Kontakty", - "leads": "Potencjalne Kontakty" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planowane", - "Held": "Zatrzymany", - "Not Held": "Nie zatrzymany" - } - }, - "labels": { - "Create Meeting": "Utwórz Spotkanie", - "Set Held": "Ustaw Zatrzymanie", - "Set Not Held": "Ustaw nie Zatrzymany", - "Send Invitations": "Wyślij Powiadomienie", - "Saved as Held": "Zapisz jako zatrzymany", - "Saved as Not Held": "Zapisz jako nie utrzymany" - }, - "presetFilters": { - "planned": "Planowane", - "held": "Zatrzymany", - "todays": "Dzisiaj" - } + "fields": { + "name": "Imię", + "parent": "Konto", + "status": "Status", + "dateStart": "Data Startu", + "dateEnd": "Data Zakończenia", + "duration": "Czas", + "description": "Opis ", + "users": "Użytkownik", + "contacts": "Kontakty", + "leads": "Potencjalne Kontakty" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planowane", + "Held": "Zatrzymany", + "Not Held": "Nie zatrzymany" + } + }, + "labels": { + "Create Meeting": "Utwórz Spotkanie", + "Set Held": "Ustaw Zatrzymanie", + "Set Not Held": "Ustaw nie Zatrzymany", + "Send Invitations": "Wyślij Powiadomienie", + "Saved as Held": "Zapisz jako zatrzymany", + "Saved as Not Held": "Zapisz jako nie utrzymany" + }, + "presetFilters": { + "planned": "Planowane", + "held": "Zatrzymany", + "todays": "Dzisiaj" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Opportunity.json index 175d4aef64..676a14d600 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Opportunity.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Imię", - "account": "Konto", - "stage": "Estap", - "amount": "Wartość", - "probability": "Prawdopodobieństwo, %", - "leadSource": "Zródło Potencjalnego Kontaktu", - "doNotCall": "Nie Dzwoń", - "closeDate": "Data Zamknięcia", - "contacts": "Kontakty", - "description": "Opis ", - "amountConverted": "Amount (converted)" - }, - "links": { - "contacts": "Kontakty" - }, - "options": { - "stage": { - "Prospecting": "I Spotkanie", - "Qualification": "Kwalifikacja", - "Needs Analysis": "Dodatkowa Analiza", - "Value Proposition": "Oferta Produktowa", - "Id. Decision Makers": "Oferta przekazna do osoby decyzyjnej", - "Perception Analysis": "Perception Analysis", - "Proposal/Price Quote": "Oferta Cenowa", - "Negotiation/Review": "Negocjacje ", - "Closed Won": "Zakończone Wygrane", - "Closed Lost": "Zakończone Przegrane" - } - }, - "labels": { - "Create Opportunity": "Utwórz Szanse" - }, - "presetFilters": { - "open": "Otwórz", - "won": "Wygrane" - } + "fields": { + "name": "Imię", + "account": "Konto", + "stage": "Estap", + "amount": "Wartość", + "probability": "Prawdopodobieństwo, %", + "leadSource": "Zródło Potencjalnego Kontaktu", + "doNotCall": "Nie Dzwoń", + "closeDate": "Data Zamknięcia", + "contacts": "Kontakty", + "description": "Opis ", + "amountConverted": "Amount (converted)" + }, + "links": { + "contacts": "Kontakty" + }, + "options": { + "stage": { + "Prospecting": "I Spotkanie", + "Qualification": "Kwalifikacja", + "Needs Analysis": "Dodatkowa Analiza", + "Value Proposition": "Oferta Produktowa", + "Id. Decision Makers": "Oferta przekazna do osoby decyzyjnej", + "Perception Analysis": "Perception Analysis", + "Proposal/Price Quote": "Oferta Cenowa", + "Negotiation/Review": "Negocjacje ", + "Closed Won": "Zakończone Wygrane", + "Closed Lost": "Zakończone Przegrane" + } + }, + "labels": { + "Create Opportunity": "Utwórz Szanse" + }, + "presetFilters": { + "open": "Otwórz", + "won": "Wygrane" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Target.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Target.json index 41459111c2..946c3f05d8 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Target.json @@ -1,19 +1,19 @@ { - "fields": { - "name": "Imię", - "emailAddress": "E-mail", - "title": "Tytuł", - "website": "Strona Internetowa", - "accountName": "Nazwa Konta", - "phoneNumber": "Telefon", - "doNotCall": "Nie Dzwoń", - "address": "Adres", - "description": "Opis " - }, - "links": { - }, - "labels": { - "Create Target": "Utwórz Cel", - "Convert to Lead": "Przekształć w Potencjalny Kontakt" - } + "fields": { + "name": "Imię", + "emailAddress": "E-mail", + "title": "Tytuł", + "website": "Strona Internetowa", + "accountName": "Nazwa Konta", + "phoneNumber": "Telefon", + "doNotCall": "Nie Dzwoń", + "address": "Adres", + "description": "Opis " + }, + "links": { + }, + "labels": { + "Create Target": "Utwórz Cel", + "Convert to Lead": "Przekształć w Potencjalny Kontakt" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Task.json b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Task.json index 339bf82d5e..f0ed0e4c2f 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pl_PL/Task.json @@ -1,37 +1,37 @@ { - "fields": { - "name": "Imię", - "parent": "Konto", - "status": "Status", - "dateStart": "Data Startu", - "dateEnd": "Data Zwrotu", - "priority": "Pryjorytet", - "description": "Opis ", - "isOverdue": "Przegrzany" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Nie Rozpoczęte", - "Started": "Rozpoczęte", - "Completed": "Ukończone", - "Canceled": "Anulowane" - }, - "priority" : { - "Low": "Niski", - "Normal": "Normalny", - "High": "Wysoki", - "Urgent": "Pilne" - } - }, - "labels": { - "Create Task": "Utwórz Zadanie" - }, - "presetFilters": { - "active": "Aktywny", - "completed": "Ukończone", - "todays": "Dzisiaj", - "overdue": "Przegrzane" - } + "fields": { + "name": "Imię", + "parent": "Konto", + "status": "Status", + "dateStart": "Data Startu", + "dateEnd": "Data Zwrotu", + "priority": "Pryjorytet", + "description": "Opis ", + "isOverdue": "Przegrzany" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Nie Rozpoczęte", + "Started": "Rozpoczęte", + "Completed": "Ukończone", + "Canceled": "Anulowane" + }, + "priority" : { + "Low": "Niski", + "Normal": "Normalny", + "High": "Wysoki", + "Urgent": "Pilne" + } + }, + "labels": { + "Create Task": "Utwórz Zadanie" + }, + "presetFilters": { + "active": "Aktywny", + "completed": "Ukończone", + "todays": "Dzisiaj", + "overdue": "Przegrzane" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Account.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Account.json index 9da5b0ce94..e98a6c7d1c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Nome", - "emailAddress": "E-mail", - "website": "Website", - "phoneNumber": "Telefone", - "billingAddress": "Endereço de Cobrança", - "shippingAddress": "Endereço de Entrega", - "description": "Descrição", - "sicCode": "CNPJ", - "industry": "Indústria", - "type": "Tipo", - "contactRole": "Regra" - }, - "links": { - "contacts": "Contatos", - "opportunities": "Oportunidades", - "cases": "Atendimentos" - }, - "options": { - "type": { - "Customer": "Cliente", - "Investor": "Investidor", - "Partner": "Parceiro", - "Reseller": "Revendedor" - }, - "industry": { - "Apparel": "Vestuário", - "Banking": "Banco", - "Computer Software": "Software", - "Education": "Educação", - "Electronics": "Eletrônicos", - "Finance": "Finanças", - "Insurance": "Seguros" - } - }, - "labels": { - "Create Account": "Criar Conta" - } + "fields": { + "name": "Nome", + "emailAddress": "E-mail", + "website": "Website", + "phoneNumber": "Telefone", + "billingAddress": "Endereço de Cobrança", + "shippingAddress": "Endereço de Entrega", + "description": "Descrição", + "sicCode": "CNPJ", + "industry": "Indústria", + "type": "Tipo", + "contactRole": "Regra" + }, + "links": { + "contacts": "Contatos", + "opportunities": "Oportunidades", + "cases": "Atendimentos" + }, + "options": { + "type": { + "Customer": "Cliente", + "Investor": "Investidor", + "Partner": "Parceiro", + "Reseller": "Revendedor" + }, + "industry": { + "Apparel": "Vestuário", + "Banking": "Banco", + "Computer Software": "Software", + "Education": "Educação", + "Electronics": "Eletrônicos", + "Finance": "Finanças", + "Insurance": "Seguros" + } + }, + "labels": { + "Create Account": "Criar Conta" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Calendar.json index 0a6b9d1323..5b5abfc8cd 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Mês", - "week": "Semana", - "day": "Dia", - "agendaWeek": "Semana", - "agendaDay": "Dia" - }, - "labels": { - "Today": "Hoje", - "Create": "Criar" - } + "modes": { + "month": "Mês", + "week": "Semana", + "day": "Dia", + "agendaWeek": "Semana", + "agendaDay": "Dia" + }, + "labels": { + "Today": "Hoje", + "Create": "Criar" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Call.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Call.json index 38384d30cc..76b136773a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Call.json @@ -24,11 +24,11 @@ "Outbound": "Saída", "Inbound": "Entrada" }, - "acceptanceStatus": { - "None": "Nenhum", - "Accepted": "Aceita", - "Declined": "Rejeitada" - } + "acceptanceStatus": { + "None": "Nenhum", + "Accepted": "Aceita", + "Declined": "Rejeitada" + } }, "labels": { "Create Call": "Criar Ligação", @@ -36,9 +36,9 @@ "Set Not Held": "Marcar como não realizada", "Send Invitations": "Enviar Convites" }, - "presetFilters": { - "planned": "Planejado", - "held": "Realizado", - "todays": "Hoje" - } + "presetFilters": { + "planned": "Planejado", + "held": "Realizado", + "todays": "Hoje" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Case.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Case.json index afa5b5605f..a95bb5955a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Case.json @@ -35,8 +35,8 @@ "labels": { "Create Case": "Criar Atendimento" }, - "presetFilters": { - "open": "Aberto", - "closed": "Fechado" - } + "presetFilters": { + "open": "Aberto", + "closed": "Fechado" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Contact.json index 2308d284be..b9c373e969 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Contact.json @@ -4,13 +4,13 @@ "emailAddress": "E-mail", "title": "Cargo", "account": "Conta", - "accounts": "Contas", + "accounts": "Contas", "phoneNumber": "Telefone", - "accountType": "Tipo de Conta", + "accountType": "Tipo de Conta", "doNotCall": "Não Ligar", "address": "Endereço", "opportunityRole": "Regra de Oportunidade", - "accountRole": "Regra", + "accountRole": "Regra", "description": "Descrição" }, "links": { @@ -20,12 +20,12 @@ "labels": { "Create Contact": "Criar Contato" }, - "options": { - "opportunityRole": { - "": "--Nenhum--", - "Decision Maker": "Tomador de Decisão", - "Evaluator": "Avaliador", - "Influencer": "Influenciador" - } - } + "options": { + "opportunityRole": { + "": "--Nenhum--", + "Decision Maker": "Tomador de Decisão", + "Evaluator": "Avaliador", + "Influencer": "Influenciador" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Global.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Global.json index d4046b53e3..9de96be9cf 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Global.json @@ -31,8 +31,8 @@ "Tasks": "Minhas Tarefas", "Cases": "Meus Atendimentos", "Calendar": "Calendário", - "Calls": "Minhas Ligações", - "Meetings": "Minhas Reuniões", + "Calls": "Minhas Ligações", + "Meetings": "Minhas Reuniões", "OpportunitiesByStage": "Oportunidades por Estágio", "OpportunitiesByLeadSource": "Oportunities por Origem do Lead", "SalesByMonth": "Vendas Por Mês", diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/InboundEmail.json index dd357fbd7d..5e9eab5d59 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/InboundEmail.json @@ -15,18 +15,18 @@ "reply": "Responder", "caseDistribution": "Distribuição do Atendimento", "replyEmailTemplate": "Template do E-mail de Resposta", - "replyFromAddress": "E-mail de Resposta (From)", - "replyToAddress": "Responder para o Endereço", + "replyFromAddress": "E-mail de Resposta (From)", + "replyToAddress": "Responder para o Endereço", "replyFromName": "Nome de Resposta (FromName)" }, - "tooltips": { - "reply": "Notificar rementente que seus e-mails foram recebidos.", - "createCase": "Criar automaticamente um atendimento para os e-mais recebidos.", - "replyToAddress": "Especifique o endereço de e-mail desta caixa postal para que as respostas cheguem aqui.", - "caseDistribution": "Como os atendimentos serão distribuídos. Assinados diretamente ao usuário ou entregues ao time.", - "assignToUser": "Usuário responsável pelos e-mails/atendimentos.", - "team": "Time que será relacionado aos e-mails/atendimentos." - }, + "tooltips": { + "reply": "Notificar rementente que seus e-mails foram recebidos.", + "createCase": "Criar automaticamente um atendimento para os e-mais recebidos.", + "replyToAddress": "Especifique o endereço de e-mail desta caixa postal para que as respostas cheguem aqui.", + "caseDistribution": "Como os atendimentos serão distribuídos. Assinados diretamente ao usuário ou entregues ao time.", + "assignToUser": "Usuário responsável pelos e-mails/atendimentos.", + "team": "Time que será relacionado aos e-mails/atendimentos." + }, "links": { }, "options": { diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Lead.json index 1faf15dd74..def3c33bc8 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Lead.json @@ -16,7 +16,7 @@ "status": "Status", "source": "Origem", "opportunityAmount": "Valor da Oportunidade", - "opportunityAmountConverted": "Valor da Oportunidade (convertido)", + "opportunityAmountConverted": "Valor da Oportunidade (convertido)", "description": "Descrição", "createdAccount": "Conta", "createdContact": "Contato", @@ -44,7 +44,7 @@ "Other": "Outro" } }, - "presetFilters": { - "active": "Ativo" - } + "presetFilters": { + "active": "Ativo" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Meeting.json index 06a12c49a9..e28161e995 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Meeting.json @@ -19,23 +19,23 @@ "Held": "Realizada", "Not Held": "Não Realizada" }, - "acceptanceStatus": { - "None": "Nenhum", - "Accepted": "Aceita", - "Declined": "Rejeitada" - } + "acceptanceStatus": { + "None": "Nenhum", + "Accepted": "Aceita", + "Declined": "Rejeitada" + } }, "labels": { "Create Meeting": "Criar Reunião", "Set Held": "Marcar como realizada", "Set Not Held": "Marcar como não realizada", "Send Invitations": "Enviar convites", - "Saved as Held": "Salvo como realizada", - "Saved as Not Held": "Salvo como não realizada" - }, - "presetFilters": { - "planned": "Planejada", - "held": "Realizada", - "todays": "Hoje" - } + "Saved as Held": "Salvo como realizada", + "Saved as Not Held": "Salvo como não realizada" + }, + "presetFilters": { + "planned": "Planejada", + "held": "Realizada", + "todays": "Hoje" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Opportunity.json index 9052afe26d..afc2537294 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Opportunity.json @@ -8,9 +8,9 @@ "leadSource": "Lead de Origem", "doNotCall": "Não ligar", "closeDate": "Data de Fechamento", - "contacts": "Contatos", + "contacts": "Contatos", "description": "Descrição", - "amountConverted": "Valor (convertido)" + "amountConverted": "Valor (convertido)" }, "links": { "contacts": "Contatos" @@ -32,8 +32,8 @@ "labels": { "Create Opportunity": "Criar Oportunidade" }, - "presetFilters": { - "open": "Aberta", - "won": "Ganha" - } + "presetFilters": { + "open": "Aberta", + "won": "Ganha" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Task.json b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Task.json index 5e85477939..b24555b233 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/pt_BR/Task.json @@ -28,10 +28,10 @@ "labels": { "Create Task": "Criar Tarefa" }, - "presetFilters": { - "active": "Ativa", - "completed": "Completa", - "todays": "Hoje", - "overdue": "Atrasada" - } + "presetFilters": { + "active": "Ativa", + "completed": "Completa", + "todays": "Hoje", + "overdue": "Atrasada" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Account.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Account.json index 6dd184c42a..5850b4b2f4 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Nume", - "emailAddress": "Email", - "website": "Site Web", - "phoneNumber": "Telefon", - "billingAddress": "Adresa de Facturare", - "shippingAddress": "Adresa de Transport", - "description": "Descriere", - "sicCode": "Cod Sic", - "industry": "Industrie", - "type": "Tip", - "contactRole": "Rol" - }, - "links": { - "contacts": "Contacte", - "opportunities": "Oportunitati", - "cases": "Cazuri" - }, - "options": { - "type": { - "Customer": "Client", - "Investor": "Investitor", - "Partner": "Partener", - "Reseller": "Reseller" - }, - "industry": { - "Apparel": "Haine", - "Banking": "Banking", - "Computer Software": "Software Computer", - "Education": "Educatie", - "Electronics": "Electronice", - "Finance": "Finante", - "Insurance": "Asigurari" - } - }, - "labels": { - "Create Account": "Creare cont" - } + "fields": { + "name": "Nume", + "emailAddress": "Email", + "website": "Site Web", + "phoneNumber": "Telefon", + "billingAddress": "Adresa de Facturare", + "shippingAddress": "Adresa de Transport", + "description": "Descriere", + "sicCode": "Cod Sic", + "industry": "Industrie", + "type": "Tip", + "contactRole": "Rol" + }, + "links": { + "contacts": "Contacte", + "opportunities": "Oportunitati", + "cases": "Cazuri" + }, + "options": { + "type": { + "Customer": "Client", + "Investor": "Investitor", + "Partner": "Partener", + "Reseller": "Reseller" + }, + "industry": { + "Apparel": "Haine", + "Banking": "Banking", + "Computer Software": "Software Computer", + "Education": "Educatie", + "Electronics": "Electronice", + "Finance": "Finante", + "Insurance": "Asigurari" + } + }, + "labels": { + "Create Account": "Creare cont" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Calendar.json index 4a3d4bbc30..f74ca24ff8 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Luna", - "week": "Saptamana", - "day": "Zi", - "agendaWeek": "Saptamana", - "agendaDay": "Zi" - }, - "labels": { - "Today": "Astazi", - "Create": "Creaza" - } + "modes": { + "month": "Luna", + "week": "Saptamana", + "day": "Zi", + "agendaWeek": "Saptamana", + "agendaDay": "Zi" + }, + "labels": { + "Today": "Astazi", + "Create": "Creaza" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Call.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Call.json index e30d4fa865..ecfd7b181c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Call.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Nume", - "parent": "Parinte", - "status": "Status", - "dateStart": "Data inceput", - "dateEnd": "Data terminare", - "direction": "Directie", - "duration": "Durata", - "description": "Descriere", - "users": "Utilizatori", - "contacts": "Contacte", - "leads": "Lead-uri" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planificat", - "Held": "Detinut", - "Not Held": "Nedetinut" - }, - "direction": { - "Outbound": "Iesire", - "Inbound": "Intrare" - } - }, - "labels": { - "Create Call": "Creare Apelare", - "Set Held": "Setare detinere", - "Set Not Held": "Setare nedetinere", - "Send Invitations": "Trimite invitatii" - }, - "presetFilters": { - "planned": "Planificat", - "held": "Detinut", - "todays": "Today's" - } + "fields": { + "name": "Nume", + "parent": "Parinte", + "status": "Status", + "dateStart": "Data inceput", + "dateEnd": "Data terminare", + "direction": "Directie", + "duration": "Durata", + "description": "Descriere", + "users": "Utilizatori", + "contacts": "Contacte", + "leads": "Lead-uri" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planificat", + "Held": "Detinut", + "Not Held": "Nedetinut" + }, + "direction": { + "Outbound": "Iesire", + "Inbound": "Intrare" + } + }, + "labels": { + "Create Call": "Creare Apelare", + "Set Held": "Setare detinere", + "Set Not Held": "Setare nedetinere", + "Send Invitations": "Trimite invitatii" + }, + "presetFilters": { + "planned": "Planificat", + "held": "Detinut", + "todays": "Today's" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Case.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Case.json index a1211b4b8f..c473559e5b 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Case.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Nume", - "number": "Numar", - "status": "Status", - "account": "Cont", - "contact": "Contact", - "priority": "Prioritate", - "type": "Tip", - "description": "Descriere" - }, - "links": { - }, - "options": { - "status": { - "New": "Nou", - "Assigned": "Alocat", - "Pending": "In asteptare", - "Closed": "Inchis", - "Rejected": "Respins", - "Duplicate": "Duplicat" - }, - "priority" : { - "Low": "Scazut", - "Normal": "Normal", - "High": "Inalt", - "Urgent": "Urgent" - }, - "type": { - "Question": "Intrebare", - "Incident": "Incident", - "Problem": "Problema" - } - }, - "labels": { - "Create Case": "Creare Caz" - }, - "presetFilters": { - "open": "Deschide", - "closed": "Inchis" - } + "fields": { + "name": "Nume", + "number": "Numar", + "status": "Status", + "account": "Cont", + "contact": "Contact", + "priority": "Prioritate", + "type": "Tip", + "description": "Descriere" + }, + "links": { + }, + "options": { + "status": { + "New": "Nou", + "Assigned": "Alocat", + "Pending": "In asteptare", + "Closed": "Inchis", + "Rejected": "Respins", + "Duplicate": "Duplicat" + }, + "priority" : { + "Low": "Scazut", + "Normal": "Normal", + "High": "Inalt", + "Urgent": "Urgent" + }, + "type": { + "Question": "Intrebare", + "Incident": "Incident", + "Problem": "Problema" + } + }, + "labels": { + "Create Case": "Creare Caz" + }, + "presetFilters": { + "open": "Deschide", + "closed": "Inchis" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Contact.json index d85af57b9b..2efe08045c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Contact.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Nume", - "emailAddress": "Email", - "title": "Titlu", - "account": "Cont", - "accounts": "Conturi", - "phoneNumber": "Telefon", - "accountType": "Tip cont", - "doNotCall": "Nu sunati", - "address": "Adresa", - "opportunityRole": "Opportunity Role", - "accountRole": "Rol", - "description": "Descriere" - }, - "links": { - "opportunities": "Oportunitati", - "cases": "Cazuri" - }, - "labels": { - "Create Contact": "Creare Contact" - }, - "options": { - "opportunityRole": { - "": "--None--", - "Decision Maker": "Decision Maker", - "Evaluator": "Evaluator", - "Influencer": "Influencer" - } - } + "fields": { + "name": "Nume", + "emailAddress": "Email", + "title": "Titlu", + "account": "Cont", + "accounts": "Conturi", + "phoneNumber": "Telefon", + "accountType": "Tip cont", + "doNotCall": "Nu sunati", + "address": "Adresa", + "opportunityRole": "Opportunity Role", + "accountRole": "Rol", + "description": "Descriere" + }, + "links": { + "opportunities": "Oportunitati", + "cases": "Cazuri" + }, + "labels": { + "Create Contact": "Creare Contact" + }, + "options": { + "opportunityRole": { + "": "--None--", + "Decision Maker": "Decision Maker", + "Evaluator": "Evaluator", + "Influencer": "Influencer" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Global.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Global.json index f81448c4af..184b730026 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Global.json @@ -1,79 +1,79 @@ { - "scopeNames": { - "Account": "Cont", - "Contact": "Contact", - "Lead": "Lead", - "Target": "Tinta", - "Opportunity": "Oportunitate", - "Meeting": "Intalnire", - "Calendar": "Calendar", - "Call": "Apel", - "Task": "Activitate", - "Case": "Caz", - "InboundEmail": "Intrari Email" - }, - "scopeNamesPlural": { - "Account": "Conturi", - "Contact": "Contacte", - "Lead": "Lead-uri", - "Target": "Tinte", - "Opportunity": "Oportunitati", - "Meeting": "Intalniri", - "Calendar": "Calendar", - "Call": "Apeluri", - "Task": "Activitati", - "Case": "Cazuri", - "InboundEmail": "Email-uri intrate" - }, - "dashlets": { - "Leads": "Lead-urile mele", - "Opportunities": "Oportunitatile mele", - "Tasks": "Activitatile mele", - "Cases": "Cazurile mele", - "Calendar": "Calendar", - "OpportunitiesByStage": "Oportunitati in functie de stadiu", - "OpportunitiesByLeadSource": "Oportunitati in functie de Sursal Lead-ului", - "SalesByMonth": "Vanzari pe luna", - "SalesPipeline": "Flux Vanzari" - }, - "labels": { - "Create InboundEmail": "Creare Email intrare", - "Activities": "Activitati", - "History": "Istoric", - "Attendees": "Participanti", - "Schedule Meeting": "Programeaza Intalnire", - "Schedule Call": "Programeaza Apel", - "Compose Email": "Compune Email", - "Log Meeting": "Log Intalnire", - "Log Call": "Log Apel", - "Archive Email": "Arhiveaza Email", - "Create Task": "Creaza Activitate", - "Tasks": "Activitati" - }, - "fields": { - "billingAddressCity": "Oras", - "billingAddressCountry": "Tara", - "billingAddressPostalCode": "Code Postal ", - "billingAddressState": "Stat", - "billingAddressStreet": "Strada", - "addressCity": "Oras", - "addressStreet": "Strada", - "addressCountry": "Tara", - "addressState": "Stat", - "addressPostalCode": "Code Postal ", - "shippingAddressCity": "City (Shipping)", - "shippingAddressStreet": "Street (Shipping)", - "shippingAddressCountry": "Country (Shipping)", - "shippingAddressState": "State (Shipping)", - "shippingAddressPostalCode": "Postal Code (Shipping)" - }, - "links": { - "contacts": "Contacte", - "opportunities": "Oportunitati", - "leads": "Lead-uri", - "meetings": "Intalniri", - "calls": "Apeluri", - "tasks": "Activitati", - "emails": "Email-uri" - } + "scopeNames": { + "Account": "Cont", + "Contact": "Contact", + "Lead": "Lead", + "Target": "Tinta", + "Opportunity": "Oportunitate", + "Meeting": "Intalnire", + "Calendar": "Calendar", + "Call": "Apel", + "Task": "Activitate", + "Case": "Caz", + "InboundEmail": "Intrari Email" + }, + "scopeNamesPlural": { + "Account": "Conturi", + "Contact": "Contacte", + "Lead": "Lead-uri", + "Target": "Tinte", + "Opportunity": "Oportunitati", + "Meeting": "Intalniri", + "Calendar": "Calendar", + "Call": "Apeluri", + "Task": "Activitati", + "Case": "Cazuri", + "InboundEmail": "Email-uri intrate" + }, + "dashlets": { + "Leads": "Lead-urile mele", + "Opportunities": "Oportunitatile mele", + "Tasks": "Activitatile mele", + "Cases": "Cazurile mele", + "Calendar": "Calendar", + "OpportunitiesByStage": "Oportunitati in functie de stadiu", + "OpportunitiesByLeadSource": "Oportunitati in functie de Sursal Lead-ului", + "SalesByMonth": "Vanzari pe luna", + "SalesPipeline": "Flux Vanzari" + }, + "labels": { + "Create InboundEmail": "Creare Email intrare", + "Activities": "Activitati", + "History": "Istoric", + "Attendees": "Participanti", + "Schedule Meeting": "Programeaza Intalnire", + "Schedule Call": "Programeaza Apel", + "Compose Email": "Compune Email", + "Log Meeting": "Log Intalnire", + "Log Call": "Log Apel", + "Archive Email": "Arhiveaza Email", + "Create Task": "Creaza Activitate", + "Tasks": "Activitati" + }, + "fields": { + "billingAddressCity": "Oras", + "billingAddressCountry": "Tara", + "billingAddressPostalCode": "Code Postal ", + "billingAddressState": "Stat", + "billingAddressStreet": "Strada", + "addressCity": "Oras", + "addressStreet": "Strada", + "addressCountry": "Tara", + "addressState": "Stat", + "addressPostalCode": "Code Postal ", + "shippingAddressCity": "City (Shipping)", + "shippingAddressStreet": "Street (Shipping)", + "shippingAddressCountry": "Country (Shipping)", + "shippingAddressState": "State (Shipping)", + "shippingAddressPostalCode": "Postal Code (Shipping)" + }, + "links": { + "contacts": "Contacte", + "opportunities": "Oportunitati", + "leads": "Lead-uri", + "meetings": "Intalniri", + "calls": "Apeluri", + "tasks": "Activitati", + "emails": "Email-uri" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/InboundEmail.json index c4585fdf4c..62fb09e410 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/InboundEmail.json @@ -1,43 +1,43 @@ { - "fields": { - "name": "Nume", - "team": "Echipa", - "status": "Status", - "assignToUser": "Atribuie utilizatorului", - "host": "Gazda", - "username": "Nume Utilizator", - "password": "Parola", - "port": "Port", - "monitoredFolders": "Directoare Monitorizate", - "trashFolder": "Gunoi", - "ssl": "SSL", - "createCase": "Creare Caz", - "reply": "Raspunde", - "caseDistribution": "Distribuire Caz", - "replyEmailTemplate": "Template Raspuns Email ", - "replyFromAddress": "Raspunde cu Adresa", - "replyFromName": "Raspunde cu Numele" - }, - "links": { - }, - "options": { - "status": { - "Active": "Activ", - "Inactive": "Inactiv" - }, - "caseDistribution": { - "Direct-Assignment": "Atribuire directa", - "Round-Robin": "Round-Robin", - "Least-Busy": "Cel putin, Ocupat" - } - }, - "labels": { - "Create InboundEmail": "Creare Email intrare", - "IMAP": "IMAP", - "Actions": "Actiuni", - "Main": "Principal" - }, - "messages": { - "couldNotConnectToImap": "Could neconectat la server-ul IMAP" - } + "fields": { + "name": "Nume", + "team": "Echipa", + "status": "Status", + "assignToUser": "Atribuie utilizatorului", + "host": "Gazda", + "username": "Nume Utilizator", + "password": "Parola", + "port": "Port", + "monitoredFolders": "Directoare Monitorizate", + "trashFolder": "Gunoi", + "ssl": "SSL", + "createCase": "Creare Caz", + "reply": "Raspunde", + "caseDistribution": "Distribuire Caz", + "replyEmailTemplate": "Template Raspuns Email ", + "replyFromAddress": "Raspunde cu Adresa", + "replyFromName": "Raspunde cu Numele" + }, + "links": { + }, + "options": { + "status": { + "Active": "Activ", + "Inactive": "Inactiv" + }, + "caseDistribution": { + "Direct-Assignment": "Atribuire directa", + "Round-Robin": "Round-Robin", + "Least-Busy": "Cel putin, Ocupat" + } + }, + "labels": { + "Create InboundEmail": "Creare Email intrare", + "IMAP": "IMAP", + "Actions": "Actiuni", + "Main": "Principal" + }, + "messages": { + "couldNotConnectToImap": "Could neconectat la server-ul IMAP" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Lead.json index 5ccb05d062..fb52fa87f9 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Lead.json @@ -1,49 +1,49 @@ { - "labels": { - "Converted To": "Convertit la", - "Create Lead": "Creare Lead", - "Convert": "Converteste" - }, - "fields": { - "name": "Nume", - "emailAddress": "Email", - "title": "Titlu", - "website": "Site Web", - "phoneNumber": "Telefon", - "accountName": "Nume Cont", - "doNotCall": "Nu sunati", - "address": "Adresa", - "status": "Status", - "source": "Sursa", - "opportunityAmount": "Suma Oportunitate", - "description": "Descriere", - "createdAccount": "Cont", - "createdContact": "Contact", - "createdOpportunity": "Oportunitate" - }, - "links": { - }, - "options": { - "status": { - "New": "Nou", - "Assigned": "Alocat", - "In Process": "In Proces", - "Converted": "Convertit", - "Recycled": "Reciclat", - "Dead": "Inactiv" - }, - "source": { - "Call": "Apel", - "Email": "Email", - "Existing Customer": "Client Existent", - "Partner": "Partener", - "Public Relations": "Relatii Publice", - "Web Site": "Site Web", - "Campaign": "Campanie", - "Other": "Altele" - } - }, - "presetFilters": { - "active": "Activ" - } + "labels": { + "Converted To": "Convertit la", + "Create Lead": "Creare Lead", + "Convert": "Converteste" + }, + "fields": { + "name": "Nume", + "emailAddress": "Email", + "title": "Titlu", + "website": "Site Web", + "phoneNumber": "Telefon", + "accountName": "Nume Cont", + "doNotCall": "Nu sunati", + "address": "Adresa", + "status": "Status", + "source": "Sursa", + "opportunityAmount": "Suma Oportunitate", + "description": "Descriere", + "createdAccount": "Cont", + "createdContact": "Contact", + "createdOpportunity": "Oportunitate" + }, + "links": { + }, + "options": { + "status": { + "New": "Nou", + "Assigned": "Alocat", + "In Process": "In Proces", + "Converted": "Convertit", + "Recycled": "Reciclat", + "Dead": "Inactiv" + }, + "source": { + "Call": "Apel", + "Email": "Email", + "Existing Customer": "Client Existent", + "Partner": "Partener", + "Public Relations": "Relatii Publice", + "Web Site": "Site Web", + "Campaign": "Campanie", + "Other": "Altele" + } + }, + "presetFilters": { + "active": "Activ" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Meeting.json index 905b7b0bf8..18d81cea14 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Meeting.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Nume", - "parent": "Parinte", - "status": "Status", - "dateStart": "Data inceput", - "dateEnd": "Data terminare", - "duration": "Durata", - "description": "Descriere", - "users": "Utilizatori", - "contacts": "Contacte", - "leads": "Lead-uri" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planificat", - "Held": "Detinut", - "Not Held": "Nedetinut" - } - }, - "labels": { - "Create Meeting": "Creare Intalnire", - "Set Held": "Setare detinere", - "Set Not Held": "Setare nedetinere", - "Send Invitations": "Trimite invitatii", - "Saved as Held": "Saved as Held", - "Saved as Not Held": "Saved as Not Held" - }, - "presetFilters": { - "planned": "Planificat", - "held": "Detinut", - "todays": "Today's" - } + "fields": { + "name": "Nume", + "parent": "Parinte", + "status": "Status", + "dateStart": "Data inceput", + "dateEnd": "Data terminare", + "duration": "Durata", + "description": "Descriere", + "users": "Utilizatori", + "contacts": "Contacte", + "leads": "Lead-uri" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planificat", + "Held": "Detinut", + "Not Held": "Nedetinut" + } + }, + "labels": { + "Create Meeting": "Creare Intalnire", + "Set Held": "Setare detinere", + "Set Not Held": "Setare nedetinere", + "Send Invitations": "Trimite invitatii", + "Saved as Held": "Saved as Held", + "Saved as Not Held": "Saved as Not Held" + }, + "presetFilters": { + "planned": "Planificat", + "held": "Detinut", + "todays": "Today's" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Opportunity.json index e53988201b..815c033392 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Opportunity.json @@ -1,38 +1,38 @@ { - "fields": { - "name": "Nume", - "account": "Cont", - "stage": "Stadiu", - "amount": "Suma", - "probability": "Probabilitate, %", - "leadSource": "Sursa Lead", - "doNotCall": "Nu sunati", - "closeDate": "Data Inchiderii", - "contacts": "Contacte", - "description": "Descriere" - }, - "links": { - "contacts": "Contacte" - }, - "options": { - "stage": { - "Prospecting": "Prospectare", - "Qualification": "Calificari", - "Needs Analysis": "Necesita Analiza", - "Value Proposition": "Valoare Propunere", - "Id. Decision Makers": "Id. Factori de Decizie", - "Perception Analysis": "Analiza Perceptiei", - "Proposal/Price Quote": "Propunere/Oferta Pret", - "Negotiation/Review": "Negociere/Revizuire", - "Closed Won": "Inchide ca Castigat", - "Closed Lost": "Inchide ca Pierdut" - } - }, - "labels": { - "Create Opportunity": "Creare Oportunitate" - }, - "presetFilters": { - "open": "Deschide", - "won": "Won" - } + "fields": { + "name": "Nume", + "account": "Cont", + "stage": "Stadiu", + "amount": "Suma", + "probability": "Probabilitate, %", + "leadSource": "Sursa Lead", + "doNotCall": "Nu sunati", + "closeDate": "Data Inchiderii", + "contacts": "Contacte", + "description": "Descriere" + }, + "links": { + "contacts": "Contacte" + }, + "options": { + "stage": { + "Prospecting": "Prospectare", + "Qualification": "Calificari", + "Needs Analysis": "Necesita Analiza", + "Value Proposition": "Valoare Propunere", + "Id. Decision Makers": "Id. Factori de Decizie", + "Perception Analysis": "Analiza Perceptiei", + "Proposal/Price Quote": "Propunere/Oferta Pret", + "Negotiation/Review": "Negociere/Revizuire", + "Closed Won": "Inchide ca Castigat", + "Closed Lost": "Inchide ca Pierdut" + } + }, + "labels": { + "Create Opportunity": "Creare Oportunitate" + }, + "presetFilters": { + "open": "Deschide", + "won": "Won" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Target.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Target.json index 00c50560ca..3965c134f2 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Target.json @@ -1,19 +1,19 @@ { - "fields": { - "name": "Nume", - "emailAddress": "Email", - "title": "Titlu", - "website": "Site Web", - "accountName": "Nume Cont", - "phoneNumber": "Telefon", - "doNotCall": "Nu sunati", - "address": "Adresa", - "description": "Descriere" - }, - "links": { - }, - "labels": { - "Create Target": "Creare Tinta", - "Convert to Lead": "Converteste la Lead" - } + "fields": { + "name": "Nume", + "emailAddress": "Email", + "title": "Titlu", + "website": "Site Web", + "accountName": "Nume Cont", + "phoneNumber": "Telefon", + "doNotCall": "Nu sunati", + "address": "Adresa", + "description": "Descriere" + }, + "links": { + }, + "labels": { + "Create Target": "Creare Tinta", + "Convert to Lead": "Converteste la Lead" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Task.json b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Task.json index f59ec99fe8..d477bcf2c6 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ro_RO/Task.json @@ -1,37 +1,37 @@ { - "fields": { - "name": "Nume", - "parent": "Parinte", - "status": "Status", - "dateStart": "Data inceput", - "dateEnd": "Data scadenta", - "priority": "Prioritate", - "description": "Descriere", - "isOverdue": "Este Restant" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Ne inceput", - "Started": "Inceput", - "Completed": "Completat", - "Canceled": "Anulat" - }, - "priority" : { - "Low": "Scazut", - "Normal": "Normal", - "High": "Inalt", - "Urgent": "Urgent" - } - }, - "labels": { - "Create Task": "Creaza Activitate" - }, - "presetFilters": { - "active": "Activ", - "completed": "Completat", - "todays": "Today's", - "overdue": "Overdue" - } + "fields": { + "name": "Nume", + "parent": "Parinte", + "status": "Status", + "dateStart": "Data inceput", + "dateEnd": "Data scadenta", + "priority": "Prioritate", + "description": "Descriere", + "isOverdue": "Este Restant" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Ne inceput", + "Started": "Inceput", + "Completed": "Completat", + "Canceled": "Anulat" + }, + "priority" : { + "Low": "Scazut", + "Normal": "Normal", + "High": "Inalt", + "Urgent": "Urgent" + } + }, + "labels": { + "Create Task": "Creaza Activitate" + }, + "presetFilters": { + "active": "Activ", + "completed": "Completat", + "todays": "Today's", + "overdue": "Overdue" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Account.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Account.json index f1005bd60f..169bd7e37b 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Имя", - "emailAddress": "Почта", - "website": "Интернет сайт", - "phoneNumber": "Телефонный номер", - "billingAddress": "Платежный адрес", - "shippingAddress": "Почтовый адрес", - "description": "Описание", - "sicCode": "SicCode", - "industry": "Промышленность", - "type": "Раздел", - "contactRole": "Роль" - }, - "links": { - "contacts": "Контакты", - "opportunities": "Возможности", - "cases": "Обращения" - }, - "options": { - "type": { - "Customer": "Заказчик", - "Investor": "Вкладчик", - "Partner": "Партнер", - "Reseller": "Посредник" - }, - "industry": { - "Apparel": "Одежда", - "Banking": "Банковское дело", - "Computer Software": "Программное обеспечение", - "Education": "Образование", - "Electronics": "Электроника", - "Finance": "Финансы", - "Insurance": "Страхование" - } - }, - "labels": { - "Create Account": "Создать новую организацию" - } + "fields": { + "name": "Имя", + "emailAddress": "Почта", + "website": "Интернет сайт", + "phoneNumber": "Телефонный номер", + "billingAddress": "Платежный адрес", + "shippingAddress": "Почтовый адрес", + "description": "Описание", + "sicCode": "SicCode", + "industry": "Промышленность", + "type": "Раздел", + "contactRole": "Роль" + }, + "links": { + "contacts": "Контакты", + "opportunities": "Возможности", + "cases": "Обращения" + }, + "options": { + "type": { + "Customer": "Заказчик", + "Investor": "Вкладчик", + "Partner": "Партнер", + "Reseller": "Посредник" + }, + "industry": { + "Apparel": "Одежда", + "Banking": "Банковское дело", + "Computer Software": "Программное обеспечение", + "Education": "Образование", + "Electronics": "Электроника", + "Finance": "Финансы", + "Insurance": "Страхование" + } + }, + "labels": { + "Create Account": "Создать новую организацию" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Calendar.json index bc45c401b2..04e1bdb472 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "месяц", - "week": "неделя", - "day": "день", - "agendaWeek": "На неделю", - "agendaDay": "На день" - }, - "labels": { - "Today": "Сегодня", - "Create": "Создать" - } + "modes": { + "month": "месяц", + "week": "неделя", + "day": "день", + "agendaWeek": "На неделю", + "agendaDay": "На день" + }, + "labels": { + "Today": "Сегодня", + "Create": "Создать" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Call.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Call.json index 2899867959..a75b2e414f 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Call.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Тема", - "parent": "Источник", - "status": "Статус", - "dateStart": "Дата начала", - "dateEnd": "Дата окончания", - "direction": "Категория", - "duration": "Длительность", - "description": "Описание", - "users": "Пользователи", - "contacts": "Контакты", - "leads": "Лиды" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Запланированный", - "Held": "Выполнен", - "Not Held": "Не состоялся" - }, - "direction": { - "Outbound": "Исходящий", - "Inbound": "Входящий" - } - }, - "labels": { - "Create Call": "Новый звонок", - "Set Held": "Был выполнен", - "Set Not Held": "Не состоялся", - "Send Invitations": "Отправить приглашения" - }, - "presetFilters": { - "planned": "Запланированные", - "held": "Отложенные", - "todays": "На сегодня" - } + "fields": { + "name": "Тема", + "parent": "Источник", + "status": "Статус", + "dateStart": "Дата начала", + "dateEnd": "Дата окончания", + "direction": "Категория", + "duration": "Длительность", + "description": "Описание", + "users": "Пользователи", + "contacts": "Контакты", + "leads": "Лиды" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Запланированный", + "Held": "Выполнен", + "Not Held": "Не состоялся" + }, + "direction": { + "Outbound": "Исходящий", + "Inbound": "Входящий" + } + }, + "labels": { + "Create Call": "Новый звонок", + "Set Held": "Был выполнен", + "Set Not Held": "Не состоялся", + "Send Invitations": "Отправить приглашения" + }, + "presetFilters": { + "planned": "Запланированные", + "held": "Отложенные", + "todays": "На сегодня" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Case.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Case.json index 65dd4c10b2..664fd2ac43 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Case.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Имя", - "number": "Номер", - "status": "Статус", - "account": "Организация", - "contact": "Контакт", - "priority": "Приоритет", - "type": "Раздел", - "description": "Описание" - }, - "links": { - }, - "options": { - "status": { - "New": "Новый", - "Assigned": "На рассмотрении", - "Pending": "Текущее", - "Closed": "Закрыто", - "Rejected": "Отказано", - "Duplicate": "Копия" - }, - "priority" : { - "Low": "Низкий", - "Normal": "Нормальный", - "High": "Высокий", - "Urgent": "Срочно" - }, - "type": { - "Question": "Вопрос", - "Incident": "Происшествие", - "Problem": "Проблема" - } - }, - "labels": { - "Create Case": "Создать обращение" - }, - "presetFilters": { - "open": "Открыто", - "closed": "Закрыто" - } + "fields": { + "name": "Имя", + "number": "Номер", + "status": "Статус", + "account": "Организация", + "contact": "Контакт", + "priority": "Приоритет", + "type": "Раздел", + "description": "Описание" + }, + "links": { + }, + "options": { + "status": { + "New": "Новый", + "Assigned": "На рассмотрении", + "Pending": "Текущее", + "Closed": "Закрыто", + "Rejected": "Отказано", + "Duplicate": "Копия" + }, + "priority" : { + "Low": "Низкий", + "Normal": "Нормальный", + "High": "Высокий", + "Urgent": "Срочно" + }, + "type": { + "Question": "Вопрос", + "Incident": "Происшествие", + "Problem": "Проблема" + } + }, + "labels": { + "Create Case": "Создать обращение" + }, + "presetFilters": { + "open": "Открыто", + "closed": "Закрыто" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Contact.json index 97a164f51e..49201d730f 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Contact.json @@ -1,38 +1,38 @@ { - "fields": { - "name": "Полное имя", - "emailAddress": "E-mail", - "title": "Должность", - "account": "Организация", - "accounts": "Организации", - "phoneNumber": "Телефон", - "accountType": "Тип организации", - "doNotCall": "Не звонить", - "address": "Адрес", - "opportunityRole": "Роль в возможности", - "accountRole": "Роль", - "description": "Описание", - "owner":"Пригласивший" - }, - "links": { - "orders": "Заказы", - "cases": "Обращения" - }, - "labels": { - "Create Contact": "Создать контакт" - }, - "options": { - "opportunityRole": { - "": "--Нет--", - "Decision Maker": "Принимающий решение", - "Evaluator": "Оценщик", - "Influencer": "Консультант" - }, - "salutationName": { - "options": { - "Жен": "Жен. ", - "Муж": "Муж. " - } - } - } + "fields": { + "name": "Полное имя", + "emailAddress": "E-mail", + "title": "Должность", + "account": "Организация", + "accounts": "Организации", + "phoneNumber": "Телефон", + "accountType": "Тип организации", + "doNotCall": "Не звонить", + "address": "Адрес", + "opportunityRole": "Роль в возможности", + "accountRole": "Роль", + "description": "Описание", + "owner":"Пригласивший" + }, + "links": { + "orders": "Заказы", + "cases": "Обращения" + }, + "labels": { + "Create Contact": "Создать контакт" + }, + "options": { + "opportunityRole": { + "": "--Нет--", + "Decision Maker": "Принимающий решение", + "Evaluator": "Оценщик", + "Influencer": "Консультант" + }, + "salutationName": { + "options": { + "Жен": "Жен. ", + "Муж": "Муж. " + } + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Global.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Global.json index e49f85d3b3..e2253a0dfa 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Global.json @@ -1,81 +1,81 @@ { - "scopeNames": { - "Account": "Организация", - "Contact": "Контакт", - "Lead": "Лид", - "Target": "Цель", - "Opportunity": "Возможность", - "Meeting": "Встреча", - "Calendar": "Календарь", - "Call": "Вызов", - "Task": "Задача", - "Case": "Обращение", - "InboundEmail": "Входящая почта" - }, - "scopeNamesPlural": { - "Account": "Организации", - "Contact": "Контакты", - "Lead": "Лиды", - "Target": "Цели", - "Opportunity": "Возможности", - "Meeting": "Встречи", - "Calendar": "Календарь", - "Call": "Звонки", - "Task": "Задачи", - "Case": "Обращения", - "InboundEmail": "Входящие письма" - }, - "dashlets": { - "Leads": "Мои Лиды", - "Opportunities": "Мои возможности", - "Tasks": "Мои задачи", - "Cases": "Мои обращения", - "Calendar": "Календарь", - "Calls": "Мои звонки", - "Meetings": "Мои встречи", - "OpportunitiesByStage": "Возможности в ожидании", - "OpportunitiesByLeadSource": "Возможности в разработке", - "SalesByMonth": "Продажи по месяцам", - "SalesPipeline": "Источники продаж" - }, - "labels": { - "Create InboundEmail": "Создать входящую почту", - "Activities": "Мероприятия", - "History": "История", - "Attendees": "Участники", - "Schedule Meeting": "Запланировать встречу", - "Schedule Call": "Запланировать звонок", - "Compose Email": "Создать e-mail", - "Log Meeting": "Записать встречу", - "Log Call": "Записать звонок", - "Archive Email": "Архив e-mail", - "Create Task": "Создать задачу", - "Tasks": "Задачи" - }, - "fields": { - "billingAddressCity": "Город", - "billingAddressCountry": "Страна", - "billingAddressPostalCode": "Почтовый код", - "billingAddressState": "Регион", - "billingAddressStreet": "Улица", - "addressCity": "Город", - "addressStreet": "Улица", - "addressCountry": "Страна", - "addressState": "Регион", - "addressPostalCode": "Почтовый код", - "shippingAddressCity": "Город доставки", - "shippingAddressStreet": "Улица доставки", - "shippingAddressCountry": "Страна доставки", - "shippingAddressState": "Регион доставки", - "shippingAddressPostalCode": "Почтовый код доставки" - }, - "links": { - "contacts": "Контакты", - "opportunities": "Возможности", - "leads": "Лиды", - "meetings": "Встречи", - "calls": "Звонки", - "tasks": "Задачи", - "emails": "E-mail адреса" - } + "scopeNames": { + "Account": "Организация", + "Contact": "Контакт", + "Lead": "Лид", + "Target": "Цель", + "Opportunity": "Возможность", + "Meeting": "Встреча", + "Calendar": "Календарь", + "Call": "Вызов", + "Task": "Задача", + "Case": "Обращение", + "InboundEmail": "Входящая почта" + }, + "scopeNamesPlural": { + "Account": "Организации", + "Contact": "Контакты", + "Lead": "Лиды", + "Target": "Цели", + "Opportunity": "Возможности", + "Meeting": "Встречи", + "Calendar": "Календарь", + "Call": "Звонки", + "Task": "Задачи", + "Case": "Обращения", + "InboundEmail": "Входящие письма" + }, + "dashlets": { + "Leads": "Мои Лиды", + "Opportunities": "Мои возможности", + "Tasks": "Мои задачи", + "Cases": "Мои обращения", + "Calendar": "Календарь", + "Calls": "Мои звонки", + "Meetings": "Мои встречи", + "OpportunitiesByStage": "Возможности в ожидании", + "OpportunitiesByLeadSource": "Возможности в разработке", + "SalesByMonth": "Продажи по месяцам", + "SalesPipeline": "Источники продаж" + }, + "labels": { + "Create InboundEmail": "Создать входящую почту", + "Activities": "Мероприятия", + "History": "История", + "Attendees": "Участники", + "Schedule Meeting": "Запланировать встречу", + "Schedule Call": "Запланировать звонок", + "Compose Email": "Создать e-mail", + "Log Meeting": "Записать встречу", + "Log Call": "Записать звонок", + "Archive Email": "Архив e-mail", + "Create Task": "Создать задачу", + "Tasks": "Задачи" + }, + "fields": { + "billingAddressCity": "Город", + "billingAddressCountry": "Страна", + "billingAddressPostalCode": "Почтовый код", + "billingAddressState": "Регион", + "billingAddressStreet": "Улица", + "addressCity": "Город", + "addressStreet": "Улица", + "addressCountry": "Страна", + "addressState": "Регион", + "addressPostalCode": "Почтовый код", + "shippingAddressCity": "Город доставки", + "shippingAddressStreet": "Улица доставки", + "shippingAddressCountry": "Страна доставки", + "shippingAddressState": "Регион доставки", + "shippingAddressPostalCode": "Почтовый код доставки" + }, + "links": { + "contacts": "Контакты", + "opportunities": "Возможности", + "leads": "Лиды", + "meetings": "Встречи", + "calls": "Звонки", + "tasks": "Задачи", + "emails": "E-mail адреса" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/InboundEmail.json index c101d97c6b..2b2bbdc4b3 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/InboundEmail.json @@ -1,52 +1,52 @@ { - "fields": { - "name": "Имя", - "team": "Команда", - "status": "Состояние", - "assignToUser": "Связаться с пользователем", - "host": "Хост", - "username": "Имя пользователя", - "password": "Пароль", - "port": "Порт", - "monitoredFolders": "Отслеживаемые разделы", - "trashFolder": "Корзина", - "ssl": "SSL", - "createCase": "Создать обращение", - "reply": "Ответ", - "caseDistribution": "Распределение обращений", - "replyEmailTemplate": "Ответить по образцу", - "replyFromAddress": "Ответить с адреса", - "replyToAddress": "Адрес для получения ответа", - "replyFromName": "Ответить от имени" - }, - "tooltips": { - "reply": "Уведомить отправителей, что их письма были получены.", - "createCase": "Автоматически создавать обращение из входящих писем.", - "replyToAddress": "Укажите адрес для этого ящика, чтобы ответы приходили в него.", - "caseDistribution": "Как обращения будут назначаться: на пользователя или среди группы.", - "assignToUser": "Пользователь, на которого письма и обращения будут назначаться.", - "team": "Группа, к которой будут относиться письма и обращения." - }, - "links": { - }, - "options": { - "status": { - "Active": "Активный", - "Inactive": "Неактивный" - }, - "caseDistribution": { - "Direct-Assignment": "Прямая задача", - "Round-Robin": "Циклическая", - "Least-Busy": "Наиболее свободный" - } - }, - "labels": { - "Create InboundEmail": "Создать входящее письмо", - "IMAP": "IMAP", - "Actions": "Действия", - "Main": "Главная" - }, - "messages": { - "couldNotConnectToImap": "Не получается подключиться к серверу IMAP" - } + "fields": { + "name": "Имя", + "team": "Команда", + "status": "Состояние", + "assignToUser": "Связаться с пользователем", + "host": "Хост", + "username": "Имя пользователя", + "password": "Пароль", + "port": "Порт", + "monitoredFolders": "Отслеживаемые разделы", + "trashFolder": "Корзина", + "ssl": "SSL", + "createCase": "Создать обращение", + "reply": "Ответ", + "caseDistribution": "Распределение обращений", + "replyEmailTemplate": "Ответить по образцу", + "replyFromAddress": "Ответить с адреса", + "replyToAddress": "Адрес для получения ответа", + "replyFromName": "Ответить от имени" + }, + "tooltips": { + "reply": "Уведомить отправителей, что их письма были получены.", + "createCase": "Автоматически создавать обращение из входящих писем.", + "replyToAddress": "Укажите адрес для этого ящика, чтобы ответы приходили в него.", + "caseDistribution": "Как обращения будут назначаться: на пользователя или среди группы.", + "assignToUser": "Пользователь, на которого письма и обращения будут назначаться.", + "team": "Группа, к которой будут относиться письма и обращения." + }, + "links": { + }, + "options": { + "status": { + "Active": "Активный", + "Inactive": "Неактивный" + }, + "caseDistribution": { + "Direct-Assignment": "Прямая задача", + "Round-Robin": "Циклическая", + "Least-Busy": "Наиболее свободный" + } + }, + "labels": { + "Create InboundEmail": "Создать входящее письмо", + "IMAP": "IMAP", + "Actions": "Действия", + "Main": "Главная" + }, + "messages": { + "couldNotConnectToImap": "Не получается подключиться к серверу IMAP" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Lead.json index 1c1d244fb6..5801aea211 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Lead.json @@ -1,57 +1,57 @@ { - "labels": { - "Converted To": "Преобразован в", - "Create Lead": "Создать Лид", - "Convert": "Преобразовать" - }, - "fields": { - "name": "Полное имя", - "emailAddress": "E-mail", - "title": "Должность", - "website": "Сайт", - "phoneNumber": "Телефон", - "accountName": "Название организации", - "doNotCall": "Не звонить", - "address": "Адрес", - "status": "Статус", - "source": "Источник", - "opportunityAmount": "Возможный доход", - "opportunityAmountConverted": "Возможный доход (конвертирован)", - "description": "Описание", - "createdAccount": "Созданная организация", - "createdContact": "Созданный контакт", - "createdOpportunity": "Созданная возможность" - }, - "links": { - }, - "options": { - "status": { - "New": "Новый", - "Assigned": "Назначено", - "In Process": "В процессе", - "Converted": "Преобразовано", - "Recycled": "Восстановленный", - "Dead": "Мертв" - }, - "source": { - "Call": "Звонок", - "Email": "E-mail", - "Partner": "Партнеры", - "Other": "Другое", - "friend": "подруга/друг", - "relative": "родственник", - "1happy": "1 happy", - "autopay": "автопей", - "vk": "вконтакт", - "wife": "жена/муж", - "BA": "ба/аба", - "mother": "мама/дочь", - "radio": "сарафанное радио", - "talk": "мое общение", - "magic": "волшебным образом" - } - }, - "presetFilters": { - "active": "Только активные" - } + "labels": { + "Converted To": "Преобразован в", + "Create Lead": "Создать Лид", + "Convert": "Преобразовать" + }, + "fields": { + "name": "Полное имя", + "emailAddress": "E-mail", + "title": "Должность", + "website": "Сайт", + "phoneNumber": "Телефон", + "accountName": "Название организации", + "doNotCall": "Не звонить", + "address": "Адрес", + "status": "Статус", + "source": "Источник", + "opportunityAmount": "Возможный доход", + "opportunityAmountConverted": "Возможный доход (конвертирован)", + "description": "Описание", + "createdAccount": "Созданная организация", + "createdContact": "Созданный контакт", + "createdOpportunity": "Созданная возможность" + }, + "links": { + }, + "options": { + "status": { + "New": "Новый", + "Assigned": "Назначено", + "In Process": "В процессе", + "Converted": "Преобразовано", + "Recycled": "Восстановленный", + "Dead": "Мертв" + }, + "source": { + "Call": "Звонок", + "Email": "E-mail", + "Partner": "Партнеры", + "Other": "Другое", + "friend": "подруга/друг", + "relative": "родственник", + "1happy": "1 happy", + "autopay": "автопей", + "vk": "вконтакт", + "wife": "жена/муж", + "BA": "ба/аба", + "mother": "мама/дочь", + "radio": "сарафанное радио", + "talk": "мое общение", + "magic": "волшебным образом" + } + }, + "presetFilters": { + "active": "Только активные" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Meeting.json index 529f1987f9..0d880a1e0c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Meeting.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Имя", - "parent": "Источник", - "status": "Статус", - "dateStart": "Дата начала", - "dateEnd": "Дата окончания", - "duration": "Продолжительность", - "description": "Описание", - "users": "Пользователи", - "contacts": "Контакты", - "leads": "Лиды" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Запланирована", - "Held": "Проведена", - "Not Held": "Не состоялась" - } - }, - "labels": { - "Create Meeting": "Создать встречу", - "Set Held": "Была проведена", - "Set Not Held": "Не состоялась", - "Send Invitations": "Отправить приглашение", - "Saved as Held": "Сохранено как состоявшееся", - "Saved as Not Held": "Сохранено как несостоявшееся" - }, - "presetFilters": { - "planned": "Запланированные", - "held": "Проведенные", - "todays": "На сегодня" - } + "fields": { + "name": "Имя", + "parent": "Источник", + "status": "Статус", + "dateStart": "Дата начала", + "dateEnd": "Дата окончания", + "duration": "Продолжительность", + "description": "Описание", + "users": "Пользователи", + "contacts": "Контакты", + "leads": "Лиды" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Запланирована", + "Held": "Проведена", + "Not Held": "Не состоялась" + } + }, + "labels": { + "Create Meeting": "Создать встречу", + "Set Held": "Была проведена", + "Set Not Held": "Не состоялась", + "Send Invitations": "Отправить приглашение", + "Saved as Held": "Сохранено как состоявшееся", + "Saved as Not Held": "Сохранено как несостоявшееся" + }, + "presetFilters": { + "planned": "Запланированные", + "held": "Проведенные", + "todays": "На сегодня" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Opportunity.json index 2730d93c70..91cf849f0e 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Opportunity.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Имя", - "account": "Организация", - "stage": "Стадия", - "amount": "Сумма", - "probability": "Вероятность успеха, %", - "leadSource": "Лид", - "doNotCall": "Не звонить", - "closeDate": "Дата закрытия", - "contacts": "Контакты", - "description": "Описание", - "amountConverted": "Сумма (сконвертирована)" - }, - "links": { - "contacts": "Контакты" - }, - "options": { - "stage": { - "Prospecting": "Привлечение клиента", - "Qualification": "Оценка возможности", - "Needs Analysis": "Требует анализа", - "Value Proposition": "Выбор предложения/оферты", - "Id. Decision Makers": "Определение ответственного лица", - "Perception Analysis": "Проведение анализа", - "Proposal/Price Quote": "Отправлено предложение/оферта", - "Negotiation/Review": "Согласование/рассмотрение", - "Closed Won": "Закрыто - Успех", - "Closed Lost": "Закрыто - Провал" - } - }, - "labels": { - "Create Opportunity": "Создать возможность" - }, - "presetFilters": { - "open": "Открытые", - "won": "Успешные" - } + "fields": { + "name": "Имя", + "account": "Организация", + "stage": "Стадия", + "amount": "Сумма", + "probability": "Вероятность успеха, %", + "leadSource": "Лид", + "doNotCall": "Не звонить", + "closeDate": "Дата закрытия", + "contacts": "Контакты", + "description": "Описание", + "amountConverted": "Сумма (сконвертирована)" + }, + "links": { + "contacts": "Контакты" + }, + "options": { + "stage": { + "Prospecting": "Привлечение клиента", + "Qualification": "Оценка возможности", + "Needs Analysis": "Требует анализа", + "Value Proposition": "Выбор предложения/оферты", + "Id. Decision Makers": "Определение ответственного лица", + "Perception Analysis": "Проведение анализа", + "Proposal/Price Quote": "Отправлено предложение/оферта", + "Negotiation/Review": "Согласование/рассмотрение", + "Closed Won": "Закрыто - Успех", + "Closed Lost": "Закрыто - Провал" + } + }, + "labels": { + "Create Opportunity": "Создать возможность" + }, + "presetFilters": { + "open": "Открытые", + "won": "Успешные" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Target.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Target.json index fed3c77433..e894f06067 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Target.json @@ -1,19 +1,19 @@ { - "fields": { - "name": "Имя", - "emailAddress": "E-mail", - "title": "Название", - "website": "Сайт", - "accountName": "Название организации", - "phoneNumber": "Телефон", - "doNotCall": "Не звонить", - "address": "Адрес", - "description": "Описание" - }, - "links": { - }, - "labels": { - "Create Target": "Создать цель", - "Convert to Lead": "Преобразовать в Лид" - } + "fields": { + "name": "Имя", + "emailAddress": "E-mail", + "title": "Название", + "website": "Сайт", + "accountName": "Название организации", + "phoneNumber": "Телефон", + "doNotCall": "Не звонить", + "address": "Адрес", + "description": "Описание" + }, + "links": { + }, + "labels": { + "Create Target": "Создать цель", + "Convert to Lead": "Преобразовать в Лид" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Task.json b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Task.json index ba4215ac4b..6b183102e6 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/ru_RU/Task.json @@ -1,37 +1,37 @@ { - "fields": { - "name": "Имя", - "parent": "Источник", - "status": "Статус", - "dateStart": "Дата начала", - "dateEnd": "Дата окончания", - "priority": "Приоритет", - "description": "Описание", - "isOverdue": "Просрочена" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Не началась", - "Started": "Началась", - "Completed": "Завершена", - "Canceled": "Отменена" - }, - "priority" : { - "Low": "Низкий", - "Normal": "Нормальный", - "High": "Высокий", - "Urgent": "Срочно" - } - }, - "labels": { - "Create Task": "Создать задачу" - }, - "presetFilters": { - "active": "Активные", - "completed": "Завершенные", - "todays": "На сегодня", - "overdue": "Просроченные" - } + "fields": { + "name": "Имя", + "parent": "Источник", + "status": "Статус", + "dateStart": "Дата начала", + "dateEnd": "Дата окончания", + "priority": "Приоритет", + "description": "Описание", + "isOverdue": "Просрочена" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Не началась", + "Started": "Началась", + "Completed": "Завершена", + "Canceled": "Отменена" + }, + "priority" : { + "Low": "Низкий", + "Normal": "Нормальный", + "High": "Высокий", + "Urgent": "Срочно" + } + }, + "labels": { + "Create Task": "Создать задачу" + }, + "presetFilters": { + "active": "Активные", + "completed": "Завершенные", + "todays": "На сегодня", + "overdue": "Просроченные" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Account.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Account.json index e437d2478e..0d501859f4 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "İsim", - "emailAddress": "Eposta", - "website": "Website", - "phone": "Telefon", - "fax": "Faks", - "billingAddress": "Fatura Adresi", - "shippingAddress": "Teslimat Adresi", - "description": "açıklama", - "sicCode": "Firma Kodu", - "industry": "Sektör", - "type": "Tür" - }, - "links": { - "contacts": "Bağlantılar", - "opportunities": "Fırsatlar", - "cases": "Dosyalar" - }, - "options": { - "type": { - "Customer": "Müşteri", - "Investor": "Yatırımcı", - "Partner": "Ortak", - "Reseller": "Satıcı" - }, - "industry": { - "Apparel": "Konfeksiyon", - "Banking": "Bankacılık", - "Computer Software": "Bilgisayar Yazılımı", - "Education": "Eğitim", - "Electronics": "Elektronik", - "Finance": "Finans", - "Insurance": "Sigortacılık" - } - }, - "labels": { - "Create Account": "Hesap Oluştur" - } + "fields": { + "name": "İsim", + "emailAddress": "Eposta", + "website": "Website", + "phone": "Telefon", + "fax": "Faks", + "billingAddress": "Fatura Adresi", + "shippingAddress": "Teslimat Adresi", + "description": "açıklama", + "sicCode": "Firma Kodu", + "industry": "Sektör", + "type": "Tür" + }, + "links": { + "contacts": "Bağlantılar", + "opportunities": "Fırsatlar", + "cases": "Dosyalar" + }, + "options": { + "type": { + "Customer": "Müşteri", + "Investor": "Yatırımcı", + "Partner": "Ortak", + "Reseller": "Satıcı" + }, + "industry": { + "Apparel": "Konfeksiyon", + "Banking": "Bankacılık", + "Computer Software": "Bilgisayar Yazılımı", + "Education": "Eğitim", + "Electronics": "Elektronik", + "Finance": "Finans", + "Insurance": "Sigortacılık" + } + }, + "labels": { + "Create Account": "Hesap Oluştur" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Calendar.json index b25bf11a8b..be79e53815 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Ay", - "week": "hafta", - "day": "Gün", - "agendaWeek": "hafta", - "agendaDay": "Gün" - }, - "labels": { - "Today": "Bugün", - "Create": "Oluştur" - } + "modes": { + "month": "Ay", + "week": "hafta", + "day": "Gün", + "agendaWeek": "hafta", + "agendaDay": "Gün" + }, + "labels": { + "Today": "Bugün", + "Create": "Oluştur" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Call.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Call.json index 6d2162c0a6..9cbdfd430f 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Call.json @@ -1,34 +1,34 @@ { - "fields": { - "name": "İsim", - "parent": "Üst Seçenek", - "status": "Durum", - "dateStart": "Başlangıç Tarihi", - "dateEnd": "Bitiş Tarihi", - "direction": "Yönlendirme", - "duration": "Süre", - "description": "açıklama", - "users": "Kullanıcılar", - "contacts": "Bağlantılar", - "leads": "Müşteri Adayları" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planlanmış", - "Held": "Elde Tutulanlar", - "Not Held": "Elde Tutulmayanlar" - }, - "direction": { - "Outbound": "Giden", - "Inbound": "Gelen" - } - }, - "labels": { - "Create Call": "Arama Oluştur", - "Set Held": "SET HELDXXX", - "Set Not Held": "SET NOT HELD XXXX", - "Send Invitations": "Davetleri Gönder" - } + "fields": { + "name": "İsim", + "parent": "Üst Seçenek", + "status": "Durum", + "dateStart": "Başlangıç Tarihi", + "dateEnd": "Bitiş Tarihi", + "direction": "Yönlendirme", + "duration": "Süre", + "description": "açıklama", + "users": "Kullanıcılar", + "contacts": "Bağlantılar", + "leads": "Müşteri Adayları" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planlanmış", + "Held": "Elde Tutulanlar", + "Not Held": "Elde Tutulmayanlar" + }, + "direction": { + "Outbound": "Giden", + "Inbound": "Gelen" + } + }, + "labels": { + "Create Call": "Arama Oluştur", + "Set Held": "SET HELDXXX", + "Set Not Held": "SET NOT HELD XXXX", + "Send Invitations": "Davetleri Gönder" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Case.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Case.json index 63a1995ef9..a64baabbae 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Case.json @@ -1,38 +1,38 @@ { - "fields": { - "name": "İsim", - "number": "Numara", - "status": "Durum", - "account": "Hesap", - "contact": "Bağlantı", - "priority": "Öncelik", - "type": "Tür", - "description": "açıklama" - }, - "links": { - }, - "options": { - "status": { - "New": "Yeni", - "Assigned": "Atanmış", - "Pending": "Beklemede", - "Closed": "Kapandı", - "Rejected": "Reddedildi", - "Duplicate": "Kopyala" - }, - "priority" : { - "Low": "Düşük", - "Normal": "Normal", - "High": "Yüksek", - "Urgent": "Acil" - }, - "type": { - "Question": "Soru", - "Incident": "Olay", - "Problem": "sorun" - } - }, - "labels": { - "Create Case": "Dosya Oluştur" - } + "fields": { + "name": "İsim", + "number": "Numara", + "status": "Durum", + "account": "Hesap", + "contact": "Bağlantı", + "priority": "Öncelik", + "type": "Tür", + "description": "açıklama" + }, + "links": { + }, + "options": { + "status": { + "New": "Yeni", + "Assigned": "Atanmış", + "Pending": "Beklemede", + "Closed": "Kapandı", + "Rejected": "Reddedildi", + "Duplicate": "Kopyala" + }, + "priority" : { + "Low": "Düşük", + "Normal": "Normal", + "High": "Yüksek", + "Urgent": "Acil" + }, + "type": { + "Question": "Soru", + "Incident": "Olay", + "Problem": "sorun" + } + }, + "labels": { + "Create Case": "Dosya Oluştur" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Contact.json index d4f74ebfdb..27c3f7c948 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Contact.json @@ -1,22 +1,22 @@ { - "fields": { - "name": "İsim", - "emailAddress": "Eposta", - "title": "Başlık", - "account": "Hesap", - "phone": "Telefon", - "phoneOffice": "Phone (Office)", - "fax": "Faks", - "accountType": "Hesap Türü", - "doNotCall": "Arama Yapma", - "address": "Adres", - "description": "açıklama" - }, - "links": { - "opportunities": "Fırsatlar", - "cases": "Dosyalar" - }, - "labels": { - "Create Contact": "Bağlantı Oluştur" - } + "fields": { + "name": "İsim", + "emailAddress": "Eposta", + "title": "Başlık", + "account": "Hesap", + "phone": "Telefon", + "phoneOffice": "Phone (Office)", + "fax": "Faks", + "accountType": "Hesap Türü", + "doNotCall": "Arama Yapma", + "address": "Adres", + "description": "açıklama" + }, + "links": { + "opportunities": "Fırsatlar", + "cases": "Dosyalar" + }, + "labels": { + "Create Contact": "Bağlantı Oluştur" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Global.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Global.json index 2d62f362d2..0573820b13 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Global.json @@ -1,79 +1,79 @@ { - "scopeNames": { - "Account": "Hesap", - "Contact": "Bağlantı", - "Lead": "Müşteri Adayı", - "Prospect": "Beklenti", - "Opportunity": "Fırsat", - "Meeting": "Toplantı", - "Calendar": "Takvim", - "Call": "Arama", - "Task": "Görev", - "Case": "Dosya", - "InboundEmail": "Gelen Eposta" - }, - "scopeNamesPlural": { - "Account": "Hesaplar", - "Contact": "Bağlantılar", - "Lead": "Müşteri Adayları", - "Prospect": "Beklentiler", - "Opportunity": "Fırsatlar", - "Meeting": "Toplantılar", - "Calendar": "Takvim", - "Call": "Aramalar", - "Task": "Görevler", - "Case": "Dosyalar", - "InboundEmail": "Gelen Epostalar" - }, - "dashlets": { - "Leads": "Müşteri Adaylarım", - "Opportunities": "Fırsatlarım", - "Tasks": "Görevleri", - "Cases": "Dosyalarım", - "Calendar": "Takvim", - "OpportunitiesByStage": "Aşamaya Göre Fırstalar", - "OpportunitiesByLeadSource": "Aday Müşterilere Göre Fırsatlar", - "SalesByMonth": "Aylık Satışlar", - "SalesPipeline": "Satış Öngörüleri" - }, - "labels": { - "Create InboundEmail": "Gelen Eposta Oluştur", - "Activities": "Aktiviteler", - "History": "Geçmiş", - "Attendees": "Katılımcılar", - "Schedule Meeting": "Toplantı Ayarla", - "Schedule Call": "Arama Ayarla", - "Compose Email": "Eposta Gönder", - "Log Meeting": "Günlük Toplantı", - "Log Call": "Günlük Arama", - "Archive Email": "Epostayı Arşivle", - "Create Task": "Görev Oluştur", - "Tasks": "Görevler" - }, - "fields": { - "billingAddressCity": "Şehir", - "billingAddressCountry": "Ülke", - "billingAddressPostalCode": "Posta Kodu", - "billingAddressState": "Semt", - "billingAddressStreet": "Sokak", - "addressCity": "Şehir", - "addressStreet": "Sokak", - "addressCountry": "Ülke", - "addressState": "Semt", - "addressPostalCode": "Posta Kodu", - "shippingAddressCity": "City (Shipping)", - "shippingAddressStreet": "Street (Shipping)", - "shippingAddressCountry": "Country (Shipping)", - "shippingAddressState": "State (Shipping)", - "shippingAddressPostalCode": "Postal Code (Shipping)" - }, - "links": { - "contacts": "Bağlantılar", - "opportunities": "Fırsatlar", - "leads": "Müşteri Adayları", - "meetings": "Toplantılar", - "calls": "Aramalar", - "tasks": "Görevler", - "emails": "Epostalar" - } + "scopeNames": { + "Account": "Hesap", + "Contact": "Bağlantı", + "Lead": "Müşteri Adayı", + "Prospect": "Beklenti", + "Opportunity": "Fırsat", + "Meeting": "Toplantı", + "Calendar": "Takvim", + "Call": "Arama", + "Task": "Görev", + "Case": "Dosya", + "InboundEmail": "Gelen Eposta" + }, + "scopeNamesPlural": { + "Account": "Hesaplar", + "Contact": "Bağlantılar", + "Lead": "Müşteri Adayları", + "Prospect": "Beklentiler", + "Opportunity": "Fırsatlar", + "Meeting": "Toplantılar", + "Calendar": "Takvim", + "Call": "Aramalar", + "Task": "Görevler", + "Case": "Dosyalar", + "InboundEmail": "Gelen Epostalar" + }, + "dashlets": { + "Leads": "Müşteri Adaylarım", + "Opportunities": "Fırsatlarım", + "Tasks": "Görevleri", + "Cases": "Dosyalarım", + "Calendar": "Takvim", + "OpportunitiesByStage": "Aşamaya Göre Fırstalar", + "OpportunitiesByLeadSource": "Aday Müşterilere Göre Fırsatlar", + "SalesByMonth": "Aylık Satışlar", + "SalesPipeline": "Satış Öngörüleri" + }, + "labels": { + "Create InboundEmail": "Gelen Eposta Oluştur", + "Activities": "Aktiviteler", + "History": "Geçmiş", + "Attendees": "Katılımcılar", + "Schedule Meeting": "Toplantı Ayarla", + "Schedule Call": "Arama Ayarla", + "Compose Email": "Eposta Gönder", + "Log Meeting": "Günlük Toplantı", + "Log Call": "Günlük Arama", + "Archive Email": "Epostayı Arşivle", + "Create Task": "Görev Oluştur", + "Tasks": "Görevler" + }, + "fields": { + "billingAddressCity": "Şehir", + "billingAddressCountry": "Ülke", + "billingAddressPostalCode": "Posta Kodu", + "billingAddressState": "Semt", + "billingAddressStreet": "Sokak", + "addressCity": "Şehir", + "addressStreet": "Sokak", + "addressCountry": "Ülke", + "addressState": "Semt", + "addressPostalCode": "Posta Kodu", + "shippingAddressCity": "City (Shipping)", + "shippingAddressStreet": "Street (Shipping)", + "shippingAddressCountry": "Country (Shipping)", + "shippingAddressState": "State (Shipping)", + "shippingAddressPostalCode": "Postal Code (Shipping)" + }, + "links": { + "contacts": "Bağlantılar", + "opportunities": "Fırsatlar", + "leads": "Müşteri Adayları", + "meetings": "Toplantılar", + "calls": "Aramalar", + "tasks": "Görevler", + "emails": "Epostalar" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/InboundEmail.json index 17f24377bf..7e716000bf 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/InboundEmail.json @@ -1,43 +1,43 @@ { - "fields": { - "name": "İsim", - "team": "Takım", - "status": "Durum", - "assignToUser": "Kullanıcıya Ata", - "host": "Sunucu", - "username": "Kullanıcı Adı", - "password": "Şifre", - "port": "Bağlantı Noktası", - "monitoredFolders": "İzlenen Klasörler", - "trashFolder": "Çöp Kutusu", - "ssl": "SSL", - "createCase": "Dosya Oluştur", - "reply": "Cevapla", - "caseDistribution": "Dosya Dağılımı", - "replyEmailTemplate": "Cevaplama Eposta Şablonu", - "replyFromAddress": "Adresten Cevapla", - "replyFromName": "İsimden Cevapla" - }, - "links": { - }, - "options": { - "status": { - "Active": "Aktif", - "Inactive": "Pasif" - }, - "caseDistribution": { - "Direct-Assignment": "DIRECT-ASSIGNMENTXXXX", - "Round-Robin": "ROUND-ROBINXXXX", - "Least-Busy": "LEAST-BUSYXXXX" - } - }, - "labels": { - "Create InboundEmail": "Gelen Eposta Oluştur", - "IMAP": "IMAP", - "Actions": "Hareketler", - "Main": "Ana" - }, - "messages": { - "couldNotConnectToImap": "IMAP sunucusuna bağlanamadı" - } + "fields": { + "name": "İsim", + "team": "Takım", + "status": "Durum", + "assignToUser": "Kullanıcıya Ata", + "host": "Sunucu", + "username": "Kullanıcı Adı", + "password": "Şifre", + "port": "Bağlantı Noktası", + "monitoredFolders": "İzlenen Klasörler", + "trashFolder": "Çöp Kutusu", + "ssl": "SSL", + "createCase": "Dosya Oluştur", + "reply": "Cevapla", + "caseDistribution": "Dosya Dağılımı", + "replyEmailTemplate": "Cevaplama Eposta Şablonu", + "replyFromAddress": "Adresten Cevapla", + "replyFromName": "İsimden Cevapla" + }, + "links": { + }, + "options": { + "status": { + "Active": "Aktif", + "Inactive": "Pasif" + }, + "caseDistribution": { + "Direct-Assignment": "DIRECT-ASSIGNMENTXXXX", + "Round-Robin": "ROUND-ROBINXXXX", + "Least-Busy": "LEAST-BUSYXXXX" + } + }, + "labels": { + "Create InboundEmail": "Gelen Eposta Oluştur", + "IMAP": "IMAP", + "Actions": "Hareketler", + "Main": "Ana" + }, + "messages": { + "couldNotConnectToImap": "IMAP sunucusuna bağlanamadı" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Lead.json index 3eb986e150..45f5319bd6 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Lead.json @@ -1,48 +1,48 @@ { - "labels": { - "Converted To": "Çevrildi", - "Create Lead": "Müşteri Adayı Oluştur", - "Convert": "Çevir" - }, - "fields": { - "name": "İsim", - "emailAddress": "Eposta", - "title": "Başlık", - "website": "Website", - "phone": "Telefon", - "phoneOffice": "Phone (Office)", - "fax": "Faks", - "accountName": "Hesap Adı", - "doNotCall": "Arama Yapma", - "address": "Adres", - "status": "Durum", - "source": "Kaynak", - "opportunityAmount": "Fırsat Tutarı", - "description": "açıklama", - "createdAccount": "Hesap", - "createdContact": "Bağlantı", - "createdOpportunity": "Fırsat" - }, - "links": { - }, - "options": { - "status": { - "New": "Yeni", - "Assigned": "Atanmış", - "In Process": "İşlemde", - "Converted": "Çevrildi", - "Recycled": "Geri Dönüştürüldü", - "Dead": "Ölü" - }, - "source": { - "Call": "Arama", - "Email": "Eposta", - "Existing Customer": "Varolan Müşteri", - "Partner": "Ortak", - "Public Relations": "Halkla İlişkiler", - "Web Site": "Web Site", - "Campaign": "Kampanya", - "Other": "Diğer" - } - } + "labels": { + "Converted To": "Çevrildi", + "Create Lead": "Müşteri Adayı Oluştur", + "Convert": "Çevir" + }, + "fields": { + "name": "İsim", + "emailAddress": "Eposta", + "title": "Başlık", + "website": "Website", + "phone": "Telefon", + "phoneOffice": "Phone (Office)", + "fax": "Faks", + "accountName": "Hesap Adı", + "doNotCall": "Arama Yapma", + "address": "Adres", + "status": "Durum", + "source": "Kaynak", + "opportunityAmount": "Fırsat Tutarı", + "description": "açıklama", + "createdAccount": "Hesap", + "createdContact": "Bağlantı", + "createdOpportunity": "Fırsat" + }, + "links": { + }, + "options": { + "status": { + "New": "Yeni", + "Assigned": "Atanmış", + "In Process": "İşlemde", + "Converted": "Çevrildi", + "Recycled": "Geri Dönüştürüldü", + "Dead": "Ölü" + }, + "source": { + "Call": "Arama", + "Email": "Eposta", + "Existing Customer": "Varolan Müşteri", + "Partner": "Ortak", + "Public Relations": "Halkla İlişkiler", + "Web Site": "Web Site", + "Campaign": "Kampanya", + "Other": "Diğer" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Meeting.json index f95d2cf5b7..26854880aa 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Meeting.json @@ -1,29 +1,29 @@ { - "fields": { - "name": "İsim", - "parent": "Üst Seçenek", - "status": "Durum", - "dateStart": "Başlangıç Tarihi", - "dateEnd": "Bitiş Tarihi", - "duration": "Süre", - "description": "açıklama", - "users": "Kullanıcılar", - "contacts": "Bağlantılar", - "leads": "Müşteri Adayları" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Planlanmış", - "Held": "Elde Tutulanlar", - "Not Held": "Elde Tutulmayanlar" - } - }, - "labels": { - "Create Meeting": "Toplantı Oluştur ", - "Set Held": "SET HELDXXX", - "Set Not Held": "SET NOT HELD XXXX", - "Send Invitations": "Davetleri Gönder" - } + "fields": { + "name": "İsim", + "parent": "Üst Seçenek", + "status": "Durum", + "dateStart": "Başlangıç Tarihi", + "dateEnd": "Bitiş Tarihi", + "duration": "Süre", + "description": "açıklama", + "users": "Kullanıcılar", + "contacts": "Bağlantılar", + "leads": "Müşteri Adayları" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Planlanmış", + "Held": "Elde Tutulanlar", + "Not Held": "Elde Tutulmayanlar" + } + }, + "labels": { + "Create Meeting": "Toplantı Oluştur ", + "Set Held": "SET HELDXXX", + "Set Not Held": "SET NOT HELD XXXX", + "Send Invitations": "Davetleri Gönder" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Opportunity.json index cda9a2e408..7661ed0f15 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Opportunity.json @@ -1,43 +1,43 @@ { - "fields": { - "name": "İsim", - "account": "Hesap", - "stage": "Aşama", - "amount": "Tutar", - "probability": "Olasılık, %", - "leadSource": "Aday Müşteri Kaynağı", - "doNotCall": "Arama Yapma", - "closeDate": "Kapanış Tarii", - "description": "açıklama" - }, - "links": { - "contacts": "Bağlantılar" - }, - "options": { - "stage": { - "Prospecting": "Araştırma", - "Qualification": "Yeterlilik", - "Needs Analysis": "Analiz Yapılmalı", - "Value Proposition": "Değer Önerisi", - "Id. Decision Makers": "Id. Karar Vericiler", - "Perception Analysis": "Algı Analizi", - "Proposal/Price Quote": "Proposal/Price Quote", - "Negotiation/Review": "Görüşme/İnceleme", - "Closed Won": "Kapalı Kazanç", - "Closed Lost": "Kapalı Kayıp" - }, - "leadSource": { - "Call": "Arama", - "Email": "Eposta", - "Existing Customer": "Varolan Müşteri", - "Partner": "Ortak", - "Public Relations": "Halkla İlişkiler", - "Web Site": "Web Site", - "Campaign": "Kampanya", - "Other": "Diğer" - } - }, - "labels": { - "Create Opportunity": "Fırsat Oluştur" - } + "fields": { + "name": "İsim", + "account": "Hesap", + "stage": "Aşama", + "amount": "Tutar", + "probability": "Olasılık, %", + "leadSource": "Aday Müşteri Kaynağı", + "doNotCall": "Arama Yapma", + "closeDate": "Kapanış Tarii", + "description": "açıklama" + }, + "links": { + "contacts": "Bağlantılar" + }, + "options": { + "stage": { + "Prospecting": "Araştırma", + "Qualification": "Yeterlilik", + "Needs Analysis": "Analiz Yapılmalı", + "Value Proposition": "Değer Önerisi", + "Id. Decision Makers": "Id. Karar Vericiler", + "Perception Analysis": "Algı Analizi", + "Proposal/Price Quote": "Proposal/Price Quote", + "Negotiation/Review": "Görüşme/İnceleme", + "Closed Won": "Kapalı Kazanç", + "Closed Lost": "Kapalı Kayıp" + }, + "leadSource": { + "Call": "Arama", + "Email": "Eposta", + "Existing Customer": "Varolan Müşteri", + "Partner": "Ortak", + "Public Relations": "Halkla İlişkiler", + "Web Site": "Web Site", + "Campaign": "Kampanya", + "Other": "Diğer" + } + }, + "labels": { + "Create Opportunity": "Fırsat Oluştur" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Prospect.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Prospect.json index 511b019a9b..3be928c1d8 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Prospect.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Prospect.json @@ -1,21 +1,21 @@ { - "fields": { - "name": "İsim", - "emailAddress": "Eposta", - "title": "Başlık", - "website": "Website", - "accountName": "Hesap Adı", - "phone": "Telefon", - "phoneOffice": "Phone (Office)", - "fax": "Faks", - "doNotCall": "Arama Yapma", - "address": "Adres", - "description": "açıklama" - }, - "links": { - }, - "labels": { - "Create Prospect": "Beklenti Oluştur", - "Convert to Lead": "Müşteri Adayına Dönüştür" - } + "fields": { + "name": "İsim", + "emailAddress": "Eposta", + "title": "Başlık", + "website": "Website", + "accountName": "Hesap Adı", + "phone": "Telefon", + "phoneOffice": "Phone (Office)", + "fax": "Faks", + "doNotCall": "Arama Yapma", + "address": "Adres", + "description": "açıklama" + }, + "links": { + }, + "labels": { + "Create Prospect": "Beklenti Oluştur", + "Convert to Lead": "Müşteri Adayına Dönüştür" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Task.json b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Task.json index 1530a9f217..e0fd0ea3c0 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/tr_TR/Task.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "İsim", - "parent": "Üst Seçenek", - "status": "Durum", - "dateStart": "Başlangıç Tarihi", - "dateEnd": "Vade Tarihi", - "priority": "Öncelik", - "description": "açıklama", - "isOverdue": "Vadesi Geçmiş" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "başlamadı", - "Started": "Başladı", - "Completed": "Tamamlandı", - "Canceled": "İptal edildi" - }, - "priority" : { - "Low": "Düşük", - "Normal": "Normal", - "High": "Yüksek", - "Urgent": "Acil" - } - }, - "labels": { - "Create Task": "Görev Oluştur" - } + "fields": { + "name": "İsim", + "parent": "Üst Seçenek", + "status": "Durum", + "dateStart": "Başlangıç Tarihi", + "dateEnd": "Vade Tarihi", + "priority": "Öncelik", + "description": "açıklama", + "isOverdue": "Vadesi Geçmiş" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "başlamadı", + "Started": "Başladı", + "Completed": "Tamamlandı", + "Canceled": "İptal edildi" + }, + "priority" : { + "Low": "Düşük", + "Normal": "Normal", + "High": "Yüksek", + "Urgent": "Acil" + } + }, + "labels": { + "Create Task": "Görev Oluştur" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Account.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Account.json index 89659d96f3..3302a2d07e 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Account.json @@ -1,40 +1,40 @@ { - "fields": { - "name": "Tên", - "emailAddress": "Email", - "website": "Website", - "phoneNumber": "Điện thoại", - "billingAddress": "Địa chủ thanh toán", - "shippingAddress": "Địa chỉ vận chuyển", - "description": "Mô tả", - "sicCode": "Mã Sic", - "industry": "Industry", - "type": "Loại", - "contactRole": "Vai trò" - }, - "links": { - "contacts": "Sổ liên lạc", - "opportunities": "Cơ hội", - "cases": "Trường hợp" - }, - "options": { - "type": { - "Customer": "Khách hàng", - "Investor": "Nhà đầu tư", - "Partner": "Đối tác", - "Reseller": "Đại lý" - }, - "industry": { - "Apparel": "May mặc", - "Banking": "Ngân hàng", - "Computer Software": "Phần mềm", - "Education": "Giáo dục", - "Electronics": "Điện máy", - "Finance": "Tín dụng", - "Insurance": "Bảo hiểm" - } - }, - "labels": { - "Create Account": "Tạo tài khoản" - } + "fields": { + "name": "Tên", + "emailAddress": "Email", + "website": "Website", + "phoneNumber": "Điện thoại", + "billingAddress": "Địa chủ thanh toán", + "shippingAddress": "Địa chỉ vận chuyển", + "description": "Mô tả", + "sicCode": "Mã Sic", + "industry": "Industry", + "type": "Loại", + "contactRole": "Vai trò" + }, + "links": { + "contacts": "Sổ liên lạc", + "opportunities": "Cơ hội", + "cases": "Trường hợp" + }, + "options": { + "type": { + "Customer": "Khách hàng", + "Investor": "Nhà đầu tư", + "Partner": "Đối tác", + "Reseller": "Đại lý" + }, + "industry": { + "Apparel": "May mặc", + "Banking": "Ngân hàng", + "Computer Software": "Phần mềm", + "Education": "Giáo dục", + "Electronics": "Điện máy", + "Finance": "Tín dụng", + "Insurance": "Bảo hiểm" + } + }, + "labels": { + "Create Account": "Tạo tài khoản" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Calendar.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Calendar.json index 8a933a8ae8..0f13cf2d1a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Calendar.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Calendar.json @@ -1,13 +1,13 @@ { - "modes": { - "month": "Tháng", - "week": "Tuần", - "day": "Ngày", - "agendaWeek": "Tuần", - "agendaDay": "Ngày" - }, - "labels": { - "Today": "Today", - "Create": "Tạo" - } + "modes": { + "month": "Tháng", + "week": "Tuần", + "day": "Ngày", + "agendaWeek": "Tuần", + "agendaDay": "Ngày" + }, + "labels": { + "Today": "Today", + "Create": "Tạo" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Call.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Call.json index f9a01bddf3..7f62e0e452 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Call.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Call.json @@ -1,39 +1,39 @@ { - "fields": { - "name": "Tên", - "parent": "Chủ", - "status": "Trạng thái", - "dateStart": "Ngày bắt đầu", - "dateEnd": "Ngày kết thúc", - "direction": "Hướng", - "duration": "Thời gian", - "description": "Mô tả", - "users": "Người dùng", - "contacts": "Sổ liên lạc", - "leads": "Trưởng nhóm" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Đã lên kế hoạch", - "Held": "Đã được tổ chức", - "Not Held": "Chưa được tổ chức" - }, - "direction": { - "Outbound": "Ra ngoài", - "Inbound": "Vào trong" - } - }, - "labels": { - "Create Call": "Tạo cuộc gọi", - "Set Held": "Tổ chức", - "Set Not Held": "Không tổ chức", - "Send Invitations": "Gửi giấy mời" - }, - "presetFilters": { - "planned": "Đã lên kế hoạch", - "held": "Đã được tổ chức", - "todays": "Hôm nay" - } + "fields": { + "name": "Tên", + "parent": "Chủ", + "status": "Trạng thái", + "dateStart": "Ngày bắt đầu", + "dateEnd": "Ngày kết thúc", + "direction": "Hướng", + "duration": "Thời gian", + "description": "Mô tả", + "users": "Người dùng", + "contacts": "Sổ liên lạc", + "leads": "Trưởng nhóm" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Đã lên kế hoạch", + "Held": "Đã được tổ chức", + "Not Held": "Chưa được tổ chức" + }, + "direction": { + "Outbound": "Ra ngoài", + "Inbound": "Vào trong" + } + }, + "labels": { + "Create Call": "Tạo cuộc gọi", + "Set Held": "Tổ chức", + "Set Not Held": "Không tổ chức", + "Send Invitations": "Gửi giấy mời" + }, + "presetFilters": { + "planned": "Đã lên kế hoạch", + "held": "Đã được tổ chức", + "todays": "Hôm nay" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Case.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Case.json index 26a6371ac7..13c91aa5c4 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Case.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Case.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Tên", - "number": "Số", - "status": "Trạng thái", - "account": "Tài khoản", - "contact": "Liên hệ", - "priority": "Ưu tiên", - "type": "Loại", - "description": "Mô tả" - }, - "links": { - }, - "options": { - "status": { - "New": "Mới", - "Assigned": "Chỉ định", - "Pending": "Đang chờ", - "Closed": "Đã đóng", - "Rejected": "Đã từ chối", - "Duplicate": "Trùng" - }, - "priority" : { - "Low": "Thấp", - "Normal": "Bình thường", - "High": "Cao", - "Urgent": "Gấp" - }, - "type": { - "Question": "Câu hỏi", - "Incident": "Sự cố", - "Problem": "Có vấn đề" - } - }, - "labels": { - "Create Case": "Tạo trường hợp" - }, - "presetFilters": { - "open": "Mở", - "closed": "Đã đóng" - } + "fields": { + "name": "Tên", + "number": "Số", + "status": "Trạng thái", + "account": "Tài khoản", + "contact": "Liên hệ", + "priority": "Ưu tiên", + "type": "Loại", + "description": "Mô tả" + }, + "links": { + }, + "options": { + "status": { + "New": "Mới", + "Assigned": "Chỉ định", + "Pending": "Đang chờ", + "Closed": "Đã đóng", + "Rejected": "Đã từ chối", + "Duplicate": "Trùng" + }, + "priority" : { + "Low": "Thấp", + "Normal": "Bình thường", + "High": "Cao", + "Urgent": "Gấp" + }, + "type": { + "Question": "Câu hỏi", + "Incident": "Sự cố", + "Problem": "Có vấn đề" + } + }, + "labels": { + "Create Case": "Tạo trường hợp" + }, + "presetFilters": { + "open": "Mở", + "closed": "Đã đóng" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Contact.json index 9a6f701dfd..4c2e68155f 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Contact.json @@ -1,31 +1,31 @@ { - "fields": { - "name": "Tên", - "emailAddress": "Email", - "title": "Tiêu đề", - "account": "Tài khoản", - "accounts": "Tài khoản", - "phoneNumber": "Điện thoại", - "accountType": "Loại tài khoản", - "doNotCall": "Không gọi", - "address": "Địa chỉ", - "opportunityRole": "Vai trò cơ hội", - "accountRole": "Vai trò", - "description": "Mô tả" - }, - "links": { - "opportunities": "Cơ hội", - "cases": "Trường hợp" - }, - "labels": { - "Create Contact": "Tạo liên hệ" - }, - "options": { - "opportunityRole": { - "": "--Trống--", - "Decision Maker": "Tạo quyết định", - "Evaluator": "Đánh giá", - "Influencer": "Phụ thuộc" - } - } + "fields": { + "name": "Tên", + "emailAddress": "Email", + "title": "Tiêu đề", + "account": "Tài khoản", + "accounts": "Tài khoản", + "phoneNumber": "Điện thoại", + "accountType": "Loại tài khoản", + "doNotCall": "Không gọi", + "address": "Địa chỉ", + "opportunityRole": "Vai trò cơ hội", + "accountRole": "Vai trò", + "description": "Mô tả" + }, + "links": { + "opportunities": "Cơ hội", + "cases": "Trường hợp" + }, + "labels": { + "Create Contact": "Tạo liên hệ" + }, + "options": { + "opportunityRole": { + "": "--Trống--", + "Decision Maker": "Tạo quyết định", + "Evaluator": "Đánh giá", + "Influencer": "Phụ thuộc" + } + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Global.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Global.json index e02d4ff90c..f9e1f2344c 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Global.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Global.json @@ -1,79 +1,79 @@ { - "scopeNames": { - "Account": "Tài khoản", - "Contact": "Liên hệ", - "Lead": "Chỉ dẫn", - "Target": "Mục tiêu", - "Opportunity": "Cơ hội", - "Meeting": "Buổi gặp", - "Calendar": "Lịch", - "Call": "Gọi", - "Task": "Nhiệm vụ", - "Case": "Trường hợp", - "InboundEmail": "Email tới" - }, - "scopeNamesPlural": { - "Account": "Tài khoản", - "Contact": "Sổ liên lạc", - "Lead": "Trưởng nhóm", - "Target": "Mục tiêu", - "Opportunity": "Cơ hội", - "Meeting": "Hẹn gặp", - "Calendar": "Lịch", - "Call": "Cuộc gọi", - "Task": "Nhiệm vụ", - "Case": "Trường hợp", - "InboundEmail": "Email đã nhận" - }, - "dashlets": { - "Leads": "Chỉ dẫn của tôi", - "Opportunities": "Cơ hội của tôi", - "Tasks": "Nhiệm vụ của tôi", - "Cases": "Công việc của tôi", - "Calendar": "Lịch", - "OpportunitiesByStage": "Chia mức cơ hội", - "OpportunitiesByLeadSource": "Phân chia cơ hội theo người chỉ dẫn", - "SalesByMonth": "Doanh thu hàng tháng", - "SalesPipeline": "Doanh thu đường ống" - }, - "labels": { - "Create InboundEmail": "Tạo email đến", - "Activities": "Hành động", - "History": "Lịch sử", - "Attendees": "Người dự", - "Schedule Meeting": "Lên lịch hẹn", - "Schedule Call": "Lên lịch gọi", - "Compose Email": "Tạo email", - "Log Meeting": "Log cuộc hẹn", - "Log Call": "Log cuộc gọi", - "Archive Email": "Email lưu trữ", - "Create Task": "Tạo nhiệm vụ", - "Tasks": "Nhiệm vụ" - }, - "fields": { - "billingAddressCity": "Quận - huyện", - "billingAddressCountry": "Quốc gia", - "billingAddressPostalCode": "Mã bưu điện", - "billingAddressState": "Thành phố", - "billingAddressStreet": "Đường", - "addressCity": "Quận - huyện", - "addressStreet": "Đường", - "addressCountry": "Quốc gia", - "addressState": "Thành phố", - "addressPostalCode": "Mã bưu điện", - "shippingAddressCity": "City (Shipping)", - "shippingAddressStreet": "Street (Shipping)", - "shippingAddressCountry": "Country (Shipping)", - "shippingAddressState": "State (Shipping)", - "shippingAddressPostalCode": "Postal Code (Shipping)" - }, - "links": { - "contacts": "Sổ liên lạc", - "opportunities": "Cơ hội", - "leads": "Trưởng nhóm", - "meetings": "Hẹn gặp", - "calls": "Cuộc gọi", - "tasks": "Nhiệm vụ", - "emails": "Địa chỉ email" - } + "scopeNames": { + "Account": "Tài khoản", + "Contact": "Liên hệ", + "Lead": "Chỉ dẫn", + "Target": "Mục tiêu", + "Opportunity": "Cơ hội", + "Meeting": "Buổi gặp", + "Calendar": "Lịch", + "Call": "Gọi", + "Task": "Nhiệm vụ", + "Case": "Trường hợp", + "InboundEmail": "Email tới" + }, + "scopeNamesPlural": { + "Account": "Tài khoản", + "Contact": "Sổ liên lạc", + "Lead": "Trưởng nhóm", + "Target": "Mục tiêu", + "Opportunity": "Cơ hội", + "Meeting": "Hẹn gặp", + "Calendar": "Lịch", + "Call": "Cuộc gọi", + "Task": "Nhiệm vụ", + "Case": "Trường hợp", + "InboundEmail": "Email đã nhận" + }, + "dashlets": { + "Leads": "Chỉ dẫn của tôi", + "Opportunities": "Cơ hội của tôi", + "Tasks": "Nhiệm vụ của tôi", + "Cases": "Công việc của tôi", + "Calendar": "Lịch", + "OpportunitiesByStage": "Chia mức cơ hội", + "OpportunitiesByLeadSource": "Phân chia cơ hội theo người chỉ dẫn", + "SalesByMonth": "Doanh thu hàng tháng", + "SalesPipeline": "Doanh thu đường ống" + }, + "labels": { + "Create InboundEmail": "Tạo email đến", + "Activities": "Hành động", + "History": "Lịch sử", + "Attendees": "Người dự", + "Schedule Meeting": "Lên lịch hẹn", + "Schedule Call": "Lên lịch gọi", + "Compose Email": "Tạo email", + "Log Meeting": "Log cuộc hẹn", + "Log Call": "Log cuộc gọi", + "Archive Email": "Email lưu trữ", + "Create Task": "Tạo nhiệm vụ", + "Tasks": "Nhiệm vụ" + }, + "fields": { + "billingAddressCity": "Quận - huyện", + "billingAddressCountry": "Quốc gia", + "billingAddressPostalCode": "Mã bưu điện", + "billingAddressState": "Thành phố", + "billingAddressStreet": "Đường", + "addressCity": "Quận - huyện", + "addressStreet": "Đường", + "addressCountry": "Quốc gia", + "addressState": "Thành phố", + "addressPostalCode": "Mã bưu điện", + "shippingAddressCity": "City (Shipping)", + "shippingAddressStreet": "Street (Shipping)", + "shippingAddressCountry": "Country (Shipping)", + "shippingAddressState": "State (Shipping)", + "shippingAddressPostalCode": "Postal Code (Shipping)" + }, + "links": { + "contacts": "Sổ liên lạc", + "opportunities": "Cơ hội", + "leads": "Trưởng nhóm", + "meetings": "Hẹn gặp", + "calls": "Cuộc gọi", + "tasks": "Nhiệm vụ", + "emails": "Địa chỉ email" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/InboundEmail.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/InboundEmail.json index f4d225149b..da3d864bfe 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/InboundEmail.json @@ -1,43 +1,43 @@ { - "fields": { - "name": "Tên", - "team": "Nhóm", - "status": "Trạng thái", - "assignToUser": "Chỉ định", - "host": "Máy chủ", - "username": "Tên đăng nhập", - "password": "Mật khẩu", - "port": "Cổng", - "monitoredFolders": "Thư mục được theo dõi", - "trashFolder": "Thùng rác", - "ssl": "SSL", - "createCase": "Tạo trường hợp", - "reply": "Trả lời", - "caseDistribution": "Trường hợp phân phối", - "replyEmailTemplate": "Mẫu email trả lời", - "replyFromAddress": "Địa chỉ email trả lời", - "replyFromName": "Tên người gửi" - }, - "links": { - }, - "options": { - "status": { - "Active": "Đang hoạt động", - "Inactive": "Chưa hoạt động" - }, - "caseDistribution": { - "Direct-Assignment": "Direct-Assignment", - "Round-Robin": "Round-Robin", - "Least-Busy": "Least-Busy" - } - }, - "labels": { - "Create InboundEmail": "Tạo email đến", - "IMAP": "IMAP", - "Actions": "Hoạt động", - "Main": "Chính" - }, - "messages": { - "couldNotConnectToImap": "Không thể kết nối với máy chủ IMAP" - } + "fields": { + "name": "Tên", + "team": "Nhóm", + "status": "Trạng thái", + "assignToUser": "Chỉ định", + "host": "Máy chủ", + "username": "Tên đăng nhập", + "password": "Mật khẩu", + "port": "Cổng", + "monitoredFolders": "Thư mục được theo dõi", + "trashFolder": "Thùng rác", + "ssl": "SSL", + "createCase": "Tạo trường hợp", + "reply": "Trả lời", + "caseDistribution": "Trường hợp phân phối", + "replyEmailTemplate": "Mẫu email trả lời", + "replyFromAddress": "Địa chỉ email trả lời", + "replyFromName": "Tên người gửi" + }, + "links": { + }, + "options": { + "status": { + "Active": "Đang hoạt động", + "Inactive": "Chưa hoạt động" + }, + "caseDistribution": { + "Direct-Assignment": "Direct-Assignment", + "Round-Robin": "Round-Robin", + "Least-Busy": "Least-Busy" + } + }, + "labels": { + "Create InboundEmail": "Tạo email đến", + "IMAP": "IMAP", + "Actions": "Hoạt động", + "Main": "Chính" + }, + "messages": { + "couldNotConnectToImap": "Không thể kết nối với máy chủ IMAP" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Lead.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Lead.json index 99628058b9..52ccf6fd6e 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Lead.json @@ -1,49 +1,49 @@ { - "labels": { - "Converted To": "Đã chuyển đổi sang", - "Create Lead": "Tạo chỉ dẫn", - "Convert": "Chuyển đổi" - }, - "fields": { - "name": "Tên", - "emailAddress": "Email", - "title": "Tiêu đề", - "website": "Website", - "phoneNumber": "Điện thoại", - "accountName": "Tên tài khoản", - "doNotCall": "Không gọi", - "address": "Địa chỉ", - "status": "Trạng thái", - "source": "Nguồn", - "opportunityAmount": "Trị giá", - "description": "Mô tả", - "createdAccount": "Tài khoản", - "createdContact": "Liên hệ", - "createdOpportunity": "Cơ hội" - }, - "links": { - }, - "options": { - "status": { - "New": "Mới", - "Assigned": "Chỉ định", - "In Process": "Đang tiến hành", - "Converted": "Đã chuyển đổi", - "Recycled": "Thùng rác", - "Dead": "Chết" - }, - "source": { - "Call": "Gọi", - "Email": "Email", - "Existing Customer": "Khách hàng hiện có", - "Partner": "Đối tác", - "Public Relations": "Khách hàng công khai", - "Web Site": "Web Site", - "Campaign": "Chiến dịch", - "Other": "Khác" - } - }, - "presetFilters": { - "active": "Đang hoạt động" - } + "labels": { + "Converted To": "Đã chuyển đổi sang", + "Create Lead": "Tạo chỉ dẫn", + "Convert": "Chuyển đổi" + }, + "fields": { + "name": "Tên", + "emailAddress": "Email", + "title": "Tiêu đề", + "website": "Website", + "phoneNumber": "Điện thoại", + "accountName": "Tên tài khoản", + "doNotCall": "Không gọi", + "address": "Địa chỉ", + "status": "Trạng thái", + "source": "Nguồn", + "opportunityAmount": "Trị giá", + "description": "Mô tả", + "createdAccount": "Tài khoản", + "createdContact": "Liên hệ", + "createdOpportunity": "Cơ hội" + }, + "links": { + }, + "options": { + "status": { + "New": "Mới", + "Assigned": "Chỉ định", + "In Process": "Đang tiến hành", + "Converted": "Đã chuyển đổi", + "Recycled": "Thùng rác", + "Dead": "Chết" + }, + "source": { + "Call": "Gọi", + "Email": "Email", + "Existing Customer": "Khách hàng hiện có", + "Partner": "Đối tác", + "Public Relations": "Khách hàng công khai", + "Web Site": "Web Site", + "Campaign": "Chiến dịch", + "Other": "Khác" + } + }, + "presetFilters": { + "active": "Đang hoạt động" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Meeting.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Meeting.json index 5229a8f824..c1bb810c7a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Meeting.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Tên", - "parent": "Chủ", - "status": "Trạng thái", - "dateStart": "Ngày bắt đầu", - "dateEnd": "Ngày kết thúc", - "duration": "Thời gian", - "description": "Mô tả", - "users": "Người dùng", - "contacts": "Sổ liên lạc", - "leads": "Trưởng nhóm" - }, - "links": { - }, - "options": { - "status": { - "Planned": "Đã lên kế hoạch", - "Held": "Đã được tổ chức", - "Not Held": "Chưa được tổ chức" - } - }, - "labels": { - "Create Meeting": "Tạo buổi hẹn", - "Set Held": "Tổ chức", - "Set Not Held": "Không tổ chức", - "Send Invitations": "Gửi giấy mời", - "Saved as Held": "Lưu là đã tổ chức", - "Saved as Not Held": "Lưu là chưa tổ chức" - }, - "presetFilters": { - "planned": "Đã lên kế hoạch", - "held": "Đã được tổ chức", - "todays": "Hôm nay" - } + "fields": { + "name": "Tên", + "parent": "Chủ", + "status": "Trạng thái", + "dateStart": "Ngày bắt đầu", + "dateEnd": "Ngày kết thúc", + "duration": "Thời gian", + "description": "Mô tả", + "users": "Người dùng", + "contacts": "Sổ liên lạc", + "leads": "Trưởng nhóm" + }, + "links": { + }, + "options": { + "status": { + "Planned": "Đã lên kế hoạch", + "Held": "Đã được tổ chức", + "Not Held": "Chưa được tổ chức" + } + }, + "labels": { + "Create Meeting": "Tạo buổi hẹn", + "Set Held": "Tổ chức", + "Set Not Held": "Không tổ chức", + "Send Invitations": "Gửi giấy mời", + "Saved as Held": "Lưu là đã tổ chức", + "Saved as Not Held": "Lưu là chưa tổ chức" + }, + "presetFilters": { + "planned": "Đã lên kế hoạch", + "held": "Đã được tổ chức", + "todays": "Hôm nay" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Opportunity.json index 30431bb217..6f9380ef01 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Opportunity.json @@ -1,38 +1,38 @@ { - "fields": { - "name": "Tên", - "account": "Tài khoản", - "stage": "Mức", - "amount": "Tổng", - "probability": "Xác suất, %", - "leadSource": "Nguồn dẫn", - "doNotCall": "Không gọi", - "closeDate": "Ngày kết thúc", - "contacts": "Sổ liên lạc", - "description": "Mô tả" - }, - "links": { - "contacts": "Sổ liên lạc" - }, - "options": { - "stage": { - "Prospecting": "Khảo sát", - "Qualification": "Trình độ chuyên môn", - "Needs Analysis": "Phân tích nhu cầu", - "Value Proposition": "Đề xuất giá trị", - "Id. Decision Makers": "Id. Người tạo quyết định", - "Perception Analysis": "Phân tích khả năng", - "Proposal/Price Quote": "Giá đặt ra", - "Negotiation/Review": "Đàm phán / đánh giá", - "Closed Won": "Thắng thầu", - "Closed Lost": "Thua thầu" - } - }, - "labels": { - "Create Opportunity": "Tạo cơ hội" - }, - "presetFilters": { - "open": "Mở", - "won": "Thắng" - } + "fields": { + "name": "Tên", + "account": "Tài khoản", + "stage": "Mức", + "amount": "Tổng", + "probability": "Xác suất, %", + "leadSource": "Nguồn dẫn", + "doNotCall": "Không gọi", + "closeDate": "Ngày kết thúc", + "contacts": "Sổ liên lạc", + "description": "Mô tả" + }, + "links": { + "contacts": "Sổ liên lạc" + }, + "options": { + "stage": { + "Prospecting": "Khảo sát", + "Qualification": "Trình độ chuyên môn", + "Needs Analysis": "Phân tích nhu cầu", + "Value Proposition": "Đề xuất giá trị", + "Id. Decision Makers": "Id. Người tạo quyết định", + "Perception Analysis": "Phân tích khả năng", + "Proposal/Price Quote": "Giá đặt ra", + "Negotiation/Review": "Đàm phán / đánh giá", + "Closed Won": "Thắng thầu", + "Closed Lost": "Thua thầu" + } + }, + "labels": { + "Create Opportunity": "Tạo cơ hội" + }, + "presetFilters": { + "open": "Mở", + "won": "Thắng" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Target.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Target.json index 97cd91cf7f..86a8cba83d 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Target.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Target.json @@ -1,19 +1,19 @@ { - "fields": { - "name": "Tên", - "emailAddress": "Email", - "title": "Tiêu đề", - "website": "Website", - "accountName": "Tên tài khoản", - "phoneNumber": "Điện thoại", - "doNotCall": "Không gọi", - "address": "Địa chỉ", - "description": "Mô tả" - }, - "links": { - }, - "labels": { - "Create Target": "Tạo mục tiêu", - "Convert to Lead": "Chuyển đổi thành chỉ dẫn" - } + "fields": { + "name": "Tên", + "emailAddress": "Email", + "title": "Tiêu đề", + "website": "Website", + "accountName": "Tên tài khoản", + "phoneNumber": "Điện thoại", + "doNotCall": "Không gọi", + "address": "Địa chỉ", + "description": "Mô tả" + }, + "links": { + }, + "labels": { + "Create Target": "Tạo mục tiêu", + "Convert to Lead": "Chuyển đổi thành chỉ dẫn" + } } diff --git a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Task.json b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Task.json index 0417c40e06..b888b642ab 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Task.json +++ b/application/Espo/Modules/Crm/Resources/i18n/vi_VN/Task.json @@ -1,37 +1,37 @@ { - "fields": { - "name": "Tên", - "parent": "Chủ", - "status": "Trạng thái", - "dateStart": "Ngày bắt đầu", - "dateEnd": "Hạn", - "priority": "Ưu tiên", - "description": "Mô tả", - "isOverdue": "Đã quá hạn" - }, - "links": { - }, - "options": { - "status": { - "Not Started": "Chưa bắt đầu", - "Started": "Đã bắt đầu", - "Completed": "Hoàn thành", - "Canceled": "Hủy" - }, - "priority" : { - "Low": "Thấp", - "Normal": "Bình thường", - "High": "Cao", - "Urgent": "Gấp" - } - }, - "labels": { - "Create Task": "Tạo nhiệm vụ" - }, - "presetFilters": { - "active": "Đang hoạt động", - "completed": "Hoàn thành", - "todays": "Hôm nay", - "overdue": "Quá hạn" - } + "fields": { + "name": "Tên", + "parent": "Chủ", + "status": "Trạng thái", + "dateStart": "Ngày bắt đầu", + "dateEnd": "Hạn", + "priority": "Ưu tiên", + "description": "Mô tả", + "isOverdue": "Đã quá hạn" + }, + "links": { + }, + "options": { + "status": { + "Not Started": "Chưa bắt đầu", + "Started": "Đã bắt đầu", + "Completed": "Hoàn thành", + "Canceled": "Hủy" + }, + "priority" : { + "Low": "Thấp", + "Normal": "Bình thường", + "High": "Cao", + "Urgent": "Gấp" + } + }, + "labels": { + "Create Task": "Tạo nhiệm vụ" + }, + "presetFilters": { + "active": "Đang hoạt động", + "completed": "Hoàn thành", + "todays": "Hôm nay", + "overdue": "Quá hạn" + } } diff --git a/application/Espo/Modules/Crm/Resources/layouts/Account/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Account/detail.json index 57eb5aa06a..4e76ff18e1 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Account/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Account/detail.json @@ -1,19 +1,19 @@ [ - { - "label":"Overview", - "rows": [ - [{"name":"name"},false], - [{"name":"emailAddress"},{"name":"phoneNumber"}], - [{"name":"website"},false], - [{"name":"billingAddress"},{"name":"shippingAddress"}], - [{"name":"description", "fullWidth": true}] - ] - }, - { - "label":"Details", - "rows": [ - [{"name":"type"},{"name":"sicCode"}], - [{"name":"industry"},false] - ] - } + { + "label":"Overview", + "rows": [ + [{"name":"name"},false], + [{"name":"emailAddress"},{"name":"phoneNumber"}], + [{"name":"website"},false], + [{"name":"billingAddress"},{"name":"shippingAddress"}], + [{"name":"description", "fullWidth": true}] + ] + }, + { + "label":"Details", + "rows": [ + [{"name":"type"},{"name":"sicCode"}], + [{"name":"industry"},false] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Account/detailConvert.json b/application/Espo/Modules/Crm/Resources/layouts/Account/detailConvert.json index 6c700fef8b..e0d9fe873e 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Account/detailConvert.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Account/detailConvert.json @@ -1,18 +1,18 @@ [ - { - "label":"Overview", - "rows":[ - [{"name":"name"},false], - [{"name":"website"},{"name":"phoneNumber"}], - [{"name":"emailAddress"},false], - [{"name":"billingAddress"},{"name":"shippingAddress"}], - [{"name":"description", "fullWidth": true}] - ] - }, { - "label":"Details", - "rows":[ - [{"name":"type"},{"name":"sicCode"}], - [{"name":"industry"},false] - ] - } + { + "label":"Overview", + "rows":[ + [{"name":"name"},false], + [{"name":"website"},{"name":"phoneNumber"}], + [{"name":"emailAddress"},false], + [{"name":"billingAddress"},{"name":"shippingAddress"}], + [{"name":"description", "fullWidth": true}] + ] + }, { + "label":"Details", + "rows":[ + [{"name":"type"},{"name":"sicCode"}], + [{"name":"industry"},false] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Call/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Call/detail.json index 0d2a22046e..0abf4871f0 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Call/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Call/detail.json @@ -1,13 +1,13 @@ [ - { - "label":"Overview", - "rows": [ - [ - {"name":"name"},{"name":"parent"}], - [{"name":"status"}, {"name":"direction"}], - [{"name":"dateStart"}], - [{"name":"duration"}], - [{"name":"description"},false] - ] - } + { + "label":"Overview", + "rows": [ + [ + {"name":"name"},{"name":"parent"}], + [{"name":"status"}, {"name":"direction"}], + [{"name":"dateStart"}], + [{"name":"duration"}], + [{"name":"description"},false] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Case/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Case/detail.json index b9f80783d3..d7eee59570 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Case/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Case/detail.json @@ -1,12 +1,12 @@ [ - { - "label":"Overview", - "rows":[ - [{"name":"name"},{"name":"number"}], - [{"name":"status"},{"name":"account"}], - [{"name":"priority"},{"name":"contact"}], - [{"name":"type"},false], - [{"name":"description", "fullWidth": true}] - ] - } + { + "label":"Overview", + "rows":[ + [{"name":"name"},{"name":"number"}], + [{"name":"status"},{"name":"account"}], + [{"name":"priority"},{"name":"contact"}], + [{"name":"type"},false], + [{"name":"description", "fullWidth": true}] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Contact/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Contact/detail.json index 8c8c6607f1..6b01f50da4 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Contact/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Contact/detail.json @@ -1,11 +1,11 @@ [ - { - "label":"Overview", - "rows":[ - [{"name":"name"},{"name":"accounts"}], - [{"name":"emailAddress"},{"name":"phoneNumber"}], - [{"name":"address"},{"name":"doNotCall"}], - [{"name":"description", "fullWidth": true}] - ] - } + { + "label":"Overview", + "rows":[ + [{"name":"name"},{"name":"accounts"}], + [{"name":"emailAddress"},{"name":"phoneNumber"}], + [{"name":"address"},{"name":"doNotCall"}], + [{"name":"description", "fullWidth": true}] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Contact/detailConvert.json b/application/Espo/Modules/Crm/Resources/layouts/Contact/detailConvert.json index c561a8161b..65468430ee 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Contact/detailConvert.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Contact/detailConvert.json @@ -1,12 +1,12 @@ [ - { - "label":"Overview", - "rows": [ - [{"name":"name"}], - [{"name":"emailAddress"},{"name":"phoneNumber"}], - [{"name":"title"}, {"name":"doNotCall"}], - [{"name":"address"}, false], - [{"name":"description", "fullWidth": true}] - ] - } + { + "label":"Overview", + "rows": [ + [{"name":"name"}], + [{"name":"emailAddress"},{"name":"phoneNumber"}], + [{"name":"title"}, {"name":"doNotCall"}], + [{"name":"address"}, false], + [{"name":"description", "fullWidth": true}] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Contact/detailSmall.json b/application/Espo/Modules/Crm/Resources/layouts/Contact/detailSmall.json index 7ee66fb94d..68946d5abe 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Contact/detailSmall.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Contact/detailSmall.json @@ -1,11 +1,11 @@ [ - { - "label": "", - "rows": [ - [{"name":"name"}], - [{"name":"accounts"}], - [{"name":"emailAddress"}], - [{"name":"phoneNumber"}] - ] - } + { + "label": "", + "rows": [ + [{"name":"name"}], + [{"name":"accounts"}], + [{"name":"emailAddress"}], + [{"name":"phoneNumber"}] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Contact/listForAccount.json b/application/Espo/Modules/Crm/Resources/layouts/Contact/listForAccount.json index fbc63da227..924e629737 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Contact/listForAccount.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Contact/listForAccount.json @@ -1,6 +1,6 @@ [ - {"name":"name","width":32,"link":"true"}, - {"name":"accountRole", "notSortable": true}, - {"name":"emailAddress"}, - {"name":"phoneNumber"} + {"name":"name","width":32,"link":"true"}, + {"name":"accountRole", "notSortable": true}, + {"name":"emailAddress"}, + {"name":"phoneNumber"} ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Contact/listSmall.json b/application/Espo/Modules/Crm/Resources/layouts/Contact/listSmall.json index 8873704e66..8751974ebd 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Contact/listSmall.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Contact/listSmall.json @@ -1,6 +1,6 @@ [ - {"name":"name","width":32,"link":"true"}, - {"name":"account"}, - {"name":"emailAddress"}, - {"name":"phoneNumber"} + {"name":"name","width":32,"link":"true"}, + {"name":"account"}, + {"name":"emailAddress"}, + {"name":"phoneNumber"} ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Document/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Document/detail.json index e37f9e2a40..e561276349 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Document/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Document/detail.json @@ -1,17 +1,17 @@ [ - { - "label":false, - "rows":[ - [{"name":"file"}, {"name":"source"}], - [{"name":"name"}, {"name":"status"}], - [{"name":"type"}, false] - ] - }, - { - "label": "Details", - "rows": [ - [{"name":"publishDate"}, {"name":"expirationDate"}], - [{"name":"description", "fullWidth": true}] - ] - } + { + "label":false, + "rows":[ + [{"name":"file"}, {"name":"source"}], + [{"name":"name"}, {"name":"status"}], + [{"name":"type"}, false] + ] + }, + { + "label": "Details", + "rows": [ + [{"name":"publishDate"}, {"name":"expirationDate"}], + [{"name":"description", "fullWidth": true}] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Document/detailSmall.json b/application/Espo/Modules/Crm/Resources/layouts/Document/detailSmall.json index b066a21da2..6d8b82e016 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Document/detailSmall.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Document/detailSmall.json @@ -1,12 +1,12 @@ [ - { - "label": false, - "rows": [ - [{"name":"source"}], - [{"name":"file"}], - [{"name":"name"}], - [{"name":"type"}], - [{"name":"status"}] - ] - } + { + "label": false, + "rows": [ + [{"name":"source"}], + [{"name":"file"}], + [{"name":"name"}], + [{"name":"type"}], + [{"name":"status"}] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Document/filters.json b/application/Espo/Modules/Crm/Resources/layouts/Document/filters.json index 9104416f02..09bee68fe6 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Document/filters.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Document/filters.json @@ -1,6 +1,6 @@ [ - "type", - "status", - "publishDate", - "expirationDate" + "type", + "status", + "publishDate", + "expirationDate" ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Document/list.json b/application/Espo/Modules/Crm/Resources/layouts/Document/list.json index f90ca6dc4f..e318384ce3 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Document/list.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Document/list.json @@ -1,7 +1,7 @@ [ - {"name":"name","width":25,"link":true}, - {"name":"file","width":25}, - {"name":"type"}, - {"name":"status"}, - {"name":"createdAt"} + {"name":"name","width":25,"link":true}, + {"name":"file","width":25}, + {"name":"type"}, + {"name":"status"}, + {"name":"createdAt"} ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Document/listSmall.json b/application/Espo/Modules/Crm/Resources/layouts/Document/listSmall.json index 7c4cea0402..08cdb7aec2 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Document/listSmall.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Document/listSmall.json @@ -1,7 +1,7 @@ [ - {"name":"name","width":30,"link":true}, - {"name":"file","width":10, "view": "Crm:Document.Fields.FileShort","notSortable": true}, - {"name":"type"}, - {"name":"status"}, - {"name":"createdAt"} + {"name":"name","width":30,"link":true}, + {"name":"file","width":10, "view": "Crm:Document.Fields.FileShort","notSortable": true}, + {"name":"type"}, + {"name":"status"}, + {"name":"createdAt"} ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/InboundEmail/detail.json b/application/Espo/Modules/Crm/Resources/layouts/InboundEmail/detail.json index 6b2be07cfb..34cb06db0e 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/InboundEmail/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/InboundEmail/detail.json @@ -1,56 +1,56 @@ [ - { - "label":"Main", - "rows":[ - [ - {"name":"name"}, - {"name":"status"} - ], - [ - {"name":"team"} - - ], - [ - {"name":"assignToUser"} - ] - ] - }, - { - "label":"IMAP", - "rows":[ - [ - {"name":"host"},{"name":"ssl"} - ], - [ - {"name":"port"},{"name":"username"} - ], - [ - {"name":"monitoredFolders"},{"name":"password"} - ] - ] - }, - { - "label":"Actions", - "rows": [ - [ - {"name":"createCase"},{"name":"reply"} - ], - [ - {"name":"caseDistribution"}, - {"name":"replyEmailTemplate"} - ], - [ - false, - {"name":"replyToAddress"} - ], - [ - false, - {"name":"replyFromAddress"} - ], - [ - false, - {"name":"replyFromName"} - ] - ] - } + { + "label":"Main", + "rows":[ + [ + {"name":"name"}, + {"name":"status"} + ], + [ + {"name":"team"} + + ], + [ + {"name":"assignToUser"} + ] + ] + }, + { + "label":"IMAP", + "rows":[ + [ + {"name":"host"},{"name":"ssl"} + ], + [ + {"name":"port"},{"name":"username"} + ], + [ + {"name":"monitoredFolders"},{"name":"password"} + ] + ] + }, + { + "label":"Actions", + "rows": [ + [ + {"name":"createCase"},{"name":"reply"} + ], + [ + {"name":"caseDistribution"}, + {"name":"replyEmailTemplate"} + ], + [ + false, + {"name":"replyToAddress"} + ], + [ + false, + {"name":"replyFromAddress"} + ], + [ + false, + {"name":"replyFromName"} + ] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json index 3be44c67f9..a5dfcbff79 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Lead/detail.json @@ -1,19 +1,19 @@ [ - { - "label":"Overview", - "rows": [ - [{"name":"name"},{"name":"accountName"}], - [{"name":"emailAddress"},{"name":"phoneNumber"}], - [{"name":"title"},{"name":"doNotCall"}], - [{"name":"address"},{"name":"website"}], - [{"name":"description", "fullWidth": true}] - ] - }, - { - "label":"Details", - "rows": [ - [{"name":"status"},{"name":"source"}], - [{"name":"opportunityAmount"},false] - ] - } + { + "label":"Overview", + "rows": [ + [{"name":"name"},{"name":"accountName"}], + [{"name":"emailAddress"},{"name":"phoneNumber"}], + [{"name":"title"},{"name":"doNotCall"}], + [{"name":"address"},{"name":"website"}], + [{"name":"description", "fullWidth": true}] + ] + }, + { + "label":"Details", + "rows": [ + [{"name":"status"},{"name":"source"}], + [{"name":"opportunityAmount"},false] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Lead/detailSmall.json b/application/Espo/Modules/Crm/Resources/layouts/Lead/detailSmall.json index 8f122a9dd2..14c707edbe 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Lead/detailSmall.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Lead/detailSmall.json @@ -1,19 +1,19 @@ [ - { - "label":"", - "rows":[ - [ - {"name":"name"} - ], - [ - {"name":"emailAddress"} - ], - [ - {"name":"phoneNumber"} - ], - [ - {"name":"status"} - ] - ] - } + { + "label":"", + "rows":[ + [ + {"name":"name"} + ], + [ + {"name":"emailAddress"} + ], + [ + {"name":"phoneNumber"} + ], + [ + {"name":"status"} + ] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json b/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json index b24ec5b3ae..d7b544e659 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Lead/filters.json @@ -1,7 +1,7 @@ [ - "status", - "source", - "opportunityAmountConverted", - "teams", - "address" + "status", + "source", + "opportunityAmountConverted", + "teams", + "address" ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Lead/listDashlet.json b/application/Espo/Modules/Crm/Resources/layouts/Lead/listDashlet.json index 81023fbc15..b7c7b7296b 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Lead/listDashlet.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Lead/listDashlet.json @@ -1,5 +1,5 @@ [ - {"name":"name"}, - {"name":"emailAddress"}, - {"name":"city"} + {"name":"name"}, + {"name":"emailAddress"}, + {"name":"city"} ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Opportunity/detail.json b/application/Espo/Modules/Crm/Resources/layouts/Opportunity/detail.json index 3467535a5b..edbffa92ec 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Opportunity/detail.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Opportunity/detail.json @@ -1,12 +1,12 @@ [ - { - "label":"Overview", - "rows":[ - [{"name":"name"},{"name":"account"}], - [{"name":"stage"},{"name":"amount"}], - [{"name":"probability"},{"name":"leadSource"}], - [{"name":"contacts"},{"name":"closeDate"}], - [{"name":"description", "fullWidth": true}] - ] - } + { + "label":"Overview", + "rows":[ + [{"name":"name"},{"name":"account"}], + [{"name":"stage"},{"name":"amount"}], + [{"name":"probability"},{"name":"leadSource"}], + [{"name":"contacts"},{"name":"closeDate"}], + [{"name":"description", "fullWidth": true}] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Opportunity/detailConvert.json b/application/Espo/Modules/Crm/Resources/layouts/Opportunity/detailConvert.json index dfb480ebf6..d82bc87b36 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Opportunity/detailConvert.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Opportunity/detailConvert.json @@ -1,12 +1,12 @@ [ - { - "label":"Overview", - "rows":[ - [{"name":"name"}], - [{"name":"stage"},{"name":"amount"}], - [{"name":"probability"}, false], - [{"name":"closeDate"},false], - [{"name":"description", "fullWidth": true}] - ] - } + { + "label":"Overview", + "rows":[ + [{"name":"name"}], + [{"name":"stage"},{"name":"amount"}], + [{"name":"probability"}, false], + [{"name":"closeDate"},false], + [{"name":"description", "fullWidth": true}] + ] + } ] diff --git a/application/Espo/Modules/Crm/Resources/layouts/Opportunity/filters.json b/application/Espo/Modules/Crm/Resources/layouts/Opportunity/filters.json index 9784ff79d0..f7a6628473 100644 --- a/application/Espo/Modules/Crm/Resources/layouts/Opportunity/filters.json +++ b/application/Espo/Modules/Crm/Resources/layouts/Opportunity/filters.json @@ -1,10 +1,10 @@ [ - "teams", - "assignedUser", - "stage", - "probability", - "account", - "amountConverted", - "closeDate", - "leadSource" + "teams", + "assignedUser", + "stage", + "probability", + "account", + "amountConverted", + "closeDate", + "leadSource" ] diff --git a/application/Espo/Modules/Crm/Resources/metadata/app/jsLibs.json b/application/Espo/Modules/Crm/Resources/metadata/app/jsLibs.json index cc5a6f2fce..9e9bea9a05 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/app/jsLibs.json +++ b/application/Espo/Modules/Crm/Resources/metadata/app/jsLibs.json @@ -1,7 +1,7 @@ { - "FullCalendar": { - "path": "client/modules/crm/lib/fullcalendar.min.js", - "exportsTo": "$", - "exportsAs": "fullCalendar" - } + "FullCalendar": { + "path": "client/modules/crm/lib/fullcalendar.min.js", + "exportsTo": "$", + "exportsAs": "fullCalendar" + } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Call.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Call.json index f32bdd883d..92c669487a 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Call.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Call.json @@ -1,85 +1,85 @@ { - "controller": "Controllers.Record", - "views":{ - "detail":"Crm:Call.Detail", - "list": "Crm:Call.List" - }, - "recordViews":{ - "list":"Crm:Call.Record.List" - }, - "menu": { - "detail": { - "dropdown": [ - { - "label": "Duplicate", - "action": "duplicate", - "acl": "edit" - } - ] - } - }, - "sidePanels":{ - "detail":[ - { - "name":"attendees", - "label":"Attendees", - "view":"Record.Panels.Side", - "options":{ - "fields":[ - "users", - "contacts", - "leads" - ], - "mode":"detail" - } - } - ], - "edit":[ - { - "name":"attendees", - "label":"Attendees", - "view":"Record.Panels.Side", - "options":{ - "fields":[ - "users", - "contacts", - "leads" - ], - "mode":"edit" - } - } - ] - }, - "presetFilters": [ - { - "name":"planned", - "style": "primary", - "data": { - "status": { - "type": "in", - "value": ["Planned"] - } - } - }, - { - "name":"held", - "style": "success", - "data": { - "status": { - "type": "in", - "value": ["Held"] - } - } - }, - { - "name":"todays", - "data": { - "dateStart": { - "type": "today", - "dateTime": true - } - } - } - ], - "boolFilters": ["onlyMy"] + "controller": "Controllers.Record", + "views":{ + "detail":"Crm:Call.Detail", + "list": "Crm:Call.List" + }, + "recordViews":{ + "list":"Crm:Call.Record.List" + }, + "menu": { + "detail": { + "dropdown": [ + { + "label": "Duplicate", + "action": "duplicate", + "acl": "edit" + } + ] + } + }, + "sidePanels":{ + "detail":[ + { + "name":"attendees", + "label":"Attendees", + "view":"Record.Panels.Side", + "options":{ + "fields":[ + "users", + "contacts", + "leads" + ], + "mode":"detail" + } + } + ], + "edit":[ + { + "name":"attendees", + "label":"Attendees", + "view":"Record.Panels.Side", + "options":{ + "fields":[ + "users", + "contacts", + "leads" + ], + "mode":"edit" + } + } + ] + }, + "presetFilters": [ + { + "name":"planned", + "style": "primary", + "data": { + "status": { + "type": "in", + "value": ["Planned"] + } + } + }, + { + "name":"held", + "style": "success", + "data": { + "status": { + "type": "in", + "value": ["Held"] + } + } + }, + { + "name":"todays", + "data": { + "dateStart": { + "type": "today", + "dateTime": true + } + } + } + ], + "boolFilters": ["onlyMy"] } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Case.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Case.json index 3bee9b8fe4..837fe3008a 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Case.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Case.json @@ -45,5 +45,5 @@ } } ], - "boolFilters": ["onlyMy"] + "boolFilters": ["onlyMy"] } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Contact.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Contact.json index d3d0214746..2e53aa5d20 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Contact.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Contact.json @@ -22,5 +22,5 @@ } ] }, - "boolFilters": ["onlyMy"] + "boolFilters": ["onlyMy"] } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/InboundEmail.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/InboundEmail.json index c984f52f3e..0aed249337 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/InboundEmail.json @@ -1,48 +1,48 @@ { - "recordViews":{ - "detail":"Crm:InboundEmail.Record.Detail", - "edit":"Crm:InboundEmail.Record.Edit", - "list":"Crm:InboundEmail.Record.List" - }, - "formDependency": { - "createCase": { - "map": { - "true" : [ - { - "action": "show", - "fields": ["caseDistribution"] - } - ] - }, - "default": [ - { - "action": "hide", - "fields": ["caseDistribution"] - } - ] - }, - "reply": { - "map": { - "true" : [ - { - "action": "show", - "fields": ["replyEmailTemplate", "replyFromAddress", "replyFromName", "replyToAddress"] - }, { - "action": "setRequired", - "fields": ["replyEmailTemplate"] - } - ] - }, - "default": [ - { - "action": "hide", - "fields": ["replyEmailTemplate", "replyFromAddress", "replyFromName", "replyToAddress"] - }, { - "action": "setNotRequired", - "fields": ["replyEmailTemplate"] - } - ] - } - }, - "disableSearchPanel": true + "recordViews":{ + "detail":"Crm:InboundEmail.Record.Detail", + "edit":"Crm:InboundEmail.Record.Edit", + "list":"Crm:InboundEmail.Record.List" + }, + "formDependency": { + "createCase": { + "map": { + "true" : [ + { + "action": "show", + "fields": ["caseDistribution"] + } + ] + }, + "default": [ + { + "action": "hide", + "fields": ["caseDistribution"] + } + ] + }, + "reply": { + "map": { + "true" : [ + { + "action": "show", + "fields": ["replyEmailTemplate", "replyFromAddress", "replyFromName", "replyToAddress"] + }, { + "action": "setRequired", + "fields": ["replyEmailTemplate"] + } + ] + }, + "default": [ + { + "action": "hide", + "fields": ["replyEmailTemplate", "replyFromAddress", "replyFromName", "replyToAddress"] + }, { + "action": "setNotRequired", + "fields": ["replyEmailTemplate"] + } + ] + } + }, + "disableSearchPanel": true } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Lead.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Lead.json index 4e278a6bb8..43cb5bb27e 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Lead.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Lead.json @@ -37,5 +37,5 @@ } } ], - "boolFilters": ["onlyMy"] + "boolFilters": ["onlyMy"] } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Meeting.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Meeting.json index 91700d6e53..e525c2eac4 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Meeting.json @@ -1,81 +1,81 @@ { - "controller": "Controllers.Record", - "views":{ - "detail":"Crm:Meeting.Detail" - }, - "menu": { - "detail": { - "dropdown": [ - { - "label": "Duplicate", - "action": "duplicate", - "acl": "edit" - } - ] - } - }, - "sidePanels":{ - "detail":[ - { - "name":"attendees", - "label":"Attendees", - "view":"Record.Panels.Side", - "options":{ - "fields":[ - "users", - "contacts", - "leads" - ], - "mode":"detail" - } - } - ], - "edit":[ - { - "name":"attendees", - "label":"Attendees", - "view":"Record.Panels.Side", - "options":{ - "fields":[ - "users", - "contacts", - "leads" - ], - "mode":"edit" - } - } - ] - }, - "presetFilters": [ - { - "name":"planned", - "style": "primary", - "data": { - "status": { - "type": "in", - "value": ["Planned"] - } - } - }, - { - "name":"held", - "style": "success", - "data": { - "status": { - "type": "in", - "value": ["Held"] - } - } - }, - { - "name":"todays", - "data": { - "dateStart": { - "type": "today", - "dateTime": true - } - } - } - ], - "boolFilters": ["onlyMy"] + "controller": "Controllers.Record", + "views":{ + "detail":"Crm:Meeting.Detail" + }, + "menu": { + "detail": { + "dropdown": [ + { + "label": "Duplicate", + "action": "duplicate", + "acl": "edit" + } + ] + } + }, + "sidePanels":{ + "detail":[ + { + "name":"attendees", + "label":"Attendees", + "view":"Record.Panels.Side", + "options":{ + "fields":[ + "users", + "contacts", + "leads" + ], + "mode":"detail" + } + } + ], + "edit":[ + { + "name":"attendees", + "label":"Attendees", + "view":"Record.Panels.Side", + "options":{ + "fields":[ + "users", + "contacts", + "leads" + ], + "mode":"edit" + } + } + ] + }, + "presetFilters": [ + { + "name":"planned", + "style": "primary", + "data": { + "status": { + "type": "in", + "value": ["Planned"] + } + } + }, + { + "name":"held", + "style": "success", + "data": { + "status": { + "type": "in", + "value": ["Held"] + } + } + }, + { + "name":"todays", + "data": { + "dateStart": { + "type": "today", + "dateTime": true + } + } + } + ], + "boolFilters": ["onlyMy"] } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Opportunity.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Opportunity.json index 56f3f7518d..45a950d0ed 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Opportunity.json @@ -44,5 +44,5 @@ } } ], - "boolFilters": ["onlyMy"] + "boolFilters": ["onlyMy"] } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Target.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Target.json index f92518ec90..84b6263567 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Target.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/Target.json @@ -14,5 +14,5 @@ ] } }, - "boolFilters": ["onlyMy"] + "boolFilters": ["onlyMy"] } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json index 12abe918cf..0fd4e4a863 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json @@ -28,9 +28,9 @@ "maxLength": 40 }, "contactRole": { - "type": "varchar", - "notStorable": true, - "disabled": true + "type": "varchar", + "notStorable": true, + "disabled": true }, "billingAddress": { "type": "address" @@ -160,7 +160,7 @@ } }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json index 47065a61cb..cdc0bd33da 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json @@ -10,7 +10,7 @@ "default": "Planned", "view": "Fields.EnumStyled", "style": { - "Held": "success" + "Held": "success" } }, "dateStart": { @@ -46,17 +46,17 @@ "disabled": true }, "acceptanceStatus": { - "type": "enum", - "notStorable": true, - "disabled": true, - "options": ["None", "Accepted", "Declined"] + "type": "enum", + "notStorable": true, + "disabled": true, + "options": ["None", "Accepted", "Declined"] }, "users": { "type": "linkMultiple", "disabled": true, "view": "Crm:Meeting.Fields.Attendees", "columns": { - "status": "acceptanceStatus" + "status": "acceptanceStatus" } }, "contacts": { @@ -64,7 +64,7 @@ "disabled": true, "view": "Crm:Meeting.Fields.Contacts", "columns": { - "status": "acceptanceStatus" + "status": "acceptanceStatus" } }, "leads": { @@ -72,7 +72,7 @@ "disabled": true, "view": "Crm:Meeting.Fields.Attendees", "columns": { - "status": "acceptanceStatus" + "status": "acceptanceStatus" } }, "createdAt": { @@ -126,11 +126,11 @@ "entity": "User", "foreign": "calls", "additionalColumns": { - "status": { - "type": "varchar", - "len": "36", - "default": "None" - } + "status": { + "type": "varchar", + "len": "36", + "default": "None" + } } }, "contacts": { @@ -138,11 +138,11 @@ "entity": "Contact", "foreign": "calls", "additionalColumns": { - "status": { - "type": "varchar", - "len": "36", - "default": "None" - } + "status": { + "type": "varchar", + "len": "36", + "default": "None" + } } }, "leads": { @@ -150,11 +150,11 @@ "entity": "Lead", "foreign": "calls", "additionalColumns": { - "status": { - "type": "varchar", - "len": "36", - "default": "None" - } + "status": { + "type": "varchar", + "len": "36", + "default": "None" + } } }, "parent": { @@ -164,7 +164,7 @@ } }, "collection": { - "sortBy": "dateStart", - "asc": false + "sortBy": "dateStart", + "asc": false } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json index 6e638986cd..a38338d7d7 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json @@ -13,9 +13,9 @@ "default": "New", "view": "Fields.EnumStyled", "style": { - "Closed": "success", - "Duplicate": "danger", - "Rejected": "danger" + "Closed": "success", + "Duplicate": "danger", + "Rejected": "danger" } }, "priority": { @@ -112,8 +112,8 @@ } }, "collection": { - "sortBy": "number", - "asc": false, - "boolFilters": ["onlyMy"] + "sortBy": "number", + "asc": false, + "boolFilters": ["onlyMy"] } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json index c91558d098..f3c5b6529d 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json @@ -20,7 +20,7 @@ }, "accountId": { "where": { - "=": "contact.id IN (SELECT contact_id FROM account_contact WHERE deleted = 0 AND account_id = {value})" + "=": "contact.id IN (SELECT contact_id FROM account_contact WHERE deleted = 0 AND account_id = {value})" } }, "title": { @@ -30,8 +30,8 @@ "select": "accountContact.role", "orderBy": "accountContact.role {direction}", "where": { - "LIKE": "contact.id IN (SELECT contact_id FROM account_contact WHERE deleted = 0 AND role LIKE {value})", - "=": "contact.id IN (SELECT contact_id FROM account_contact WHERE deleted = 0 AND role = {value})" + "LIKE": "contact.id IN (SELECT contact_id FROM account_contact WHERE deleted = 0 AND role LIKE {value})", + "=": "contact.id IN (SELECT contact_id FROM account_contact WHERE deleted = 0 AND role = {value})" } }, "description": { @@ -75,13 +75,13 @@ "type": "linkMultiple", "view": "Crm:Contact.Fields.Accounts", "columns": { - "role": "contactRole" + "role": "contactRole" } }, "accountRole": { - "type": "varchar", - "notStorable": true, - "disabled": true + "type": "varchar", + "notStorable": true, + "disabled": true }, "accountType": { "type": "foreign", @@ -89,15 +89,15 @@ "field": "type" }, "opportunityRole": { - "type": "enum", - "notStorable": true, - "disabled": true, - "options": ["", "Decision Maker", "Evaluator", "Influencer"] + "type": "enum", + "notStorable": true, + "disabled": true, + "options": ["", "Decision Maker", "Evaluator", "Influencer"] }, "acceptanceStatus": { - "type": "varchar", - "notStorable": true, - "disabled": true + "type": "varchar", + "notStorable": true, + "disabled": true }, "createdAt": { "type": "datetime", @@ -149,12 +149,12 @@ "type": "hasMany", "entity": "Account", "foreign": "contacts", - "additionalColumns": { - "role": { - "type": "varchar", - "len": 50 - } - } + "additionalColumns": { + "role": { + "type": "varchar", + "len": 50 + } + } }, "opportunities": { "type": "hasMany", @@ -187,7 +187,7 @@ } }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json index dbc8707490..cfc7aaa423 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json @@ -14,14 +14,14 @@ "options": ["Active", "Draft", "Expired", "Canceled"], "view": "Fields.EnumStyled", "style": { - "Canceled": "danger", - "Expired": "danger" + "Canceled": "danger", + "Expired": "danger" } }, "source": { - "type": "enum", - "options": ["Espo"], - "default": "Espo" + "type": "enum", + "options": ["Espo"], + "default": "Espo" }, "type": { "type": "enum", @@ -64,16 +64,16 @@ } }, "links": { - "accounts": { + "accounts": { "type": "hasMany", "entity": "Account", "foreign": "documents" - }, - "opportunities": { + }, + "opportunities": { "type": "hasMany", "entity": "Opportunity", "foreign": "documents" - }, + }, "createdBy": { "type": "belongsTo", "entity": "User" @@ -93,7 +93,7 @@ } }, "collection": { - "sortBy": "createdAt", - "asc": false + "sortBy": "createdAt", + "asc": false } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/InboundEmail.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/InboundEmail.json index 4ed9bc3e08..82d36f4526 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/InboundEmail.json @@ -34,7 +34,7 @@ "view": "Crm:InboundEmail.Fields.Folders" }, "fetchData": { - "type": "text", + "type": "text", "readOnly": true }, "assignToUser": { @@ -112,7 +112,7 @@ } }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json index 46750859cc..676aa8d490 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json @@ -28,9 +28,9 @@ "default": "New", "view": "Fields.EnumStyled", "style": { - "Converted": "success", - "Recycled": "danger", - "Dead": "danger" + "Converted": "success", + "Recycled": "danger", + "Dead": "danger" } }, "source": { @@ -106,9 +106,9 @@ "required": true }, "acceptanceStatus": { - "type": "varchar", - "notStorable": true, - "disabled": true + "type": "varchar", + "notStorable": true, + "disabled": true }, "teams": { "type": "linkMultiple" @@ -197,7 +197,7 @@ } }, "collection": { - "sortBy": "createdAt", - "asc": false + "sortBy": "createdAt", + "asc": false } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json index d2a74ca3ad..be3a0ea753 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json @@ -10,7 +10,7 @@ "default": "Planned", "view": "Fields.EnumStyled", "style": { - "Held": "success" + "Held": "success" } }, "dateStart": { @@ -41,17 +41,17 @@ "disabled": true }, "acceptanceStatus": { - "type": "enum", - "notStorable": true, - "disabled": true, - "options": ["None", "Accepted", "Declined"] + "type": "enum", + "notStorable": true, + "disabled": true, + "options": ["None", "Accepted", "Declined"] }, "users": { "type": "linkMultiple", "view": "Crm:Meeting.Fields.Attendees", "disabled": true, "columns": { - "status": "acceptanceStatus" + "status": "acceptanceStatus" } }, "contacts": { @@ -59,7 +59,7 @@ "disabled": true, "view": "Crm:Meeting.Fields.Contacts", "columns": { - "status": "acceptanceStatus" + "status": "acceptanceStatus" } }, "leads": { @@ -67,7 +67,7 @@ "view": "Crm:Meeting.Fields.Attendees", "disabled": true, "columns": { - "status": "acceptanceStatus" + "status": "acceptanceStatus" } }, "createdAt": { @@ -121,11 +121,11 @@ "entity": "User", "foreign": "meetings", "additionalColumns": { - "status": { - "type": "varchar", - "len": "36", - "default": "None" - } + "status": { + "type": "varchar", + "len": "36", + "default": "None" + } } }, "contacts": { @@ -133,11 +133,11 @@ "entity": "Contact", "foreign": "meetings", "additionalColumns": { - "status": { - "type": "varchar", - "len": "36", - "default": "None" - } + "status": { + "type": "varchar", + "len": "36", + "default": "None" + } } }, "leads": { @@ -145,11 +145,11 @@ "entity": "Lead", "foreign": "meetings", "additionalColumns": { - "status": { - "type": "varchar", - "len": "36", - "default": "None" - } + "status": { + "type": "varchar", + "len": "36", + "default": "None" + } } }, "parent": { @@ -159,7 +159,7 @@ } }, "collection": { - "sortBy": "dateStart", - "asc": false + "sortBy": "dateStart", + "asc": false } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json index c3fee5a021..a48243568e 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json @@ -19,12 +19,12 @@ "notStorable": true, "select": "opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100", "where": { - "=": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) = {value}", - "<": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) < {value}", - ">": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) > {value}", - "<=": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) <= {value}", - ">=": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) >= {value}", - "<>": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) <> {value}" + "=": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) = {value}", + "<": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) < {value}", + ">": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) > {value}", + "<=": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) <= {value}", + ">=": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) >= {value}", + "<>": "(opportunity.amount * amount_currency_alias.rate * opportunity.probability / 100) <> {value}" }, "orderBy": "amountWeightedConverted {direction}", "view": "Fields.CurrencyConverted" @@ -37,7 +37,7 @@ "type": "linkMultiple", "view": "Crm:Opportunity.Fields.Contacts", "columns": { - "role": "opportunityRole" + "role": "opportunityRole" } }, "stage": { @@ -115,12 +115,12 @@ "type": "hasMany", "entity": "Contact", "foreign": "opportunities", - "additionalColumns": { - "role": { - "type": "varchar", - "len": 50 - } - } + "additionalColumns": { + "role": { + "type": "varchar", + "len": 50 + } + } }, "meetings": { "type": "hasChildren", @@ -149,19 +149,19 @@ } }, "collection": { - "sortBy": "createdAt", - "asc": false + "sortBy": "createdAt", + "asc": false }, - "probabilityMap": { - "Prospecting": 10, - "Qualification": 10, - "Needs Analysis": 20, - "Value Proposition": 50, - "Id. Decision Makers": 60, - "Perception Analysis": 70, - "Proposal/Price Quote": 75, - "Negotiation/Review": 90, - "Closed Won": 100, - "Closed Lost": 0 - } + "probabilityMap": { + "Prospecting": 10, + "Qualification": 10, + "Needs Analysis": 20, + "Value Proposition": 50, + "Id. Decision Makers": 60, + "Perception Analysis": 70, + "Proposal/Price Quote": 75, + "Negotiation/Review": 90, + "Closed Won": 100, + "Closed Lost": 0 + } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Target.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Target.json index c1cd05f74f..597d60e6f0 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Target.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Target.json @@ -107,7 +107,7 @@ } }, "collection": { - "sortBy": "createdAt", - "asc": false + "sortBy": "createdAt", + "asc": false } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json index e51cb7f187..79ef49061c 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json @@ -9,7 +9,7 @@ "options": ["Not Started", "Started", "Completed", "Canceled"], "view": "Fields.EnumStyled", "style": { - "Completed": "success" + "Completed": "success" } }, "priority": { @@ -27,10 +27,10 @@ "view": "Crm:Task.Fields.DateEnd" }, "isOverdue": { - "type": "bool", - "readOnly": true, - "notStorable": true, - "view": "Crm:Task.Fields.IsOverdue" + "type": "bool", + "readOnly": true, + "notStorable": true, + "view": "Crm:Task.Fields.IsOverdue" }, "description": { "type": "text" @@ -87,7 +87,7 @@ } }, "collection": { - "sortBy": "createdAt", - "asc": false + "sortBy": "createdAt", + "asc": false } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Account.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Account.json index 30dcc61e7d..3308931398 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Account.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Account.json @@ -1,10 +1,10 @@ { - "entity": true, - "layouts": true, - "tab": true, - "acl": true, - "module": "Crm", - "customizable": true, - "stream": true, - "importable": true + "entity": true, + "layouts": true, + "tab": true, + "acl": true, + "module": "Crm", + "customizable": true, + "stream": true, + "importable": true } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Activities.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Activities.json index 36527bd8d9..d22d5e93df 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Activities.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Activities.json @@ -1,8 +1,8 @@ { - "entity": false, - "layouts": false, - "tab": false, - "acl": false, - "module": "Crm", - "customizable": false + "entity": false, + "layouts": false, + "tab": false, + "acl": false, + "module": "Crm", + "customizable": false } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Call.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Call.json index 2b9cff0207..a8e7a855da 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Call.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Call.json @@ -1,9 +1,9 @@ { - "entity": true, - "layouts": true, - "tab": true, - "acl": true, - "module": "Crm", - "customizable": true, - "importable": true + "entity": true, + "layouts": true, + "tab": true, + "acl": true, + "module": "Crm", + "customizable": true, + "importable": true } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Case.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Case.json index 30dcc61e7d..3308931398 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Case.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Case.json @@ -1,10 +1,10 @@ { - "entity": true, - "layouts": true, - "tab": true, - "acl": true, - "module": "Crm", - "customizable": true, - "stream": true, - "importable": true + "entity": true, + "layouts": true, + "tab": true, + "acl": true, + "module": "Crm", + "customizable": true, + "stream": true, + "importable": true } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Contact.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Contact.json index 30f6f8dcd2..072e7b3d7a 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Contact.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Contact.json @@ -1,5 +1,5 @@ {"entity":true,"layouts":true,"tab":true,"acl":true,"module":"Crm", - "customizable": true, - "stream": true, - "importable": true + "customizable": true, + "stream": true, + "importable": true } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Document.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Document.json index 4bb51bf381..a96a75db25 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Document.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Document.json @@ -1,9 +1,9 @@ { - "entity": true, - "layouts": false, - "tab": true, - "acl": true, - "module": "Crm", - "customizable": false, - "importable": false + "entity": true, + "layouts": false, + "tab": true, + "acl": true, + "module": "Crm", + "customizable": false, + "importable": false } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/InboundEmail.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/InboundEmail.json index 7174685f4c..da59fcc7a4 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/InboundEmail.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/InboundEmail.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "module": "Crm" + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "module": "Crm" } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Lead.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Lead.json index 30dcc61e7d..3308931398 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Lead.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Lead.json @@ -1,10 +1,10 @@ { - "entity": true, - "layouts": true, - "tab": true, - "acl": true, - "module": "Crm", - "customizable": true, - "stream": true, - "importable": true + "entity": true, + "layouts": true, + "tab": true, + "acl": true, + "module": "Crm", + "customizable": true, + "stream": true, + "importable": true } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Meeting.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Meeting.json index 2b9cff0207..a8e7a855da 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Meeting.json @@ -1,9 +1,9 @@ { - "entity": true, - "layouts": true, - "tab": true, - "acl": true, - "module": "Crm", - "customizable": true, - "importable": true + "entity": true, + "layouts": true, + "tab": true, + "acl": true, + "module": "Crm", + "customizable": true, + "importable": true } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Opportunity.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Opportunity.json index 30dcc61e7d..3308931398 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Opportunity.json @@ -1,10 +1,10 @@ { - "entity": true, - "layouts": true, - "tab": true, - "acl": true, - "module": "Crm", - "customizable": true, - "stream": true, - "importable": true + "entity": true, + "layouts": true, + "tab": true, + "acl": true, + "module": "Crm", + "customizable": true, + "stream": true, + "importable": true } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Target.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Target.json index 2e95ea947b..bcacda91d0 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Target.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Target.json @@ -1,9 +1,9 @@ { - "entity": false, - "layouts": false, - "tab": false, - "acl": false, - "module": "Crm", - "customizable": false, - "importable": false + "entity": false, + "layouts": false, + "tab": false, + "acl": false, + "module": "Crm", + "customizable": false, + "importable": false } diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Task.json b/application/Espo/Modules/Crm/Resources/metadata/scopes/Task.json index 2b9cff0207..a8e7a855da 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Task.json +++ b/application/Espo/Modules/Crm/Resources/metadata/scopes/Task.json @@ -1,9 +1,9 @@ { - "entity": true, - "layouts": true, - "tab": true, - "acl": true, - "module": "Crm", - "customizable": true, - "importable": true + "entity": true, + "layouts": true, + "tab": true, + "acl": true, + "module": "Crm", + "customizable": true, + "importable": true } diff --git a/application/Espo/Modules/Crm/Resources/routes.json b/application/Espo/Modules/Crm/Resources/routes.json index ba81ad58b8..5cf0133fe8 100644 --- a/application/Espo/Modules/Crm/Resources/routes.json +++ b/application/Espo/Modules/Crm/Resources/routes.json @@ -1,22 +1,22 @@ [ { - "route":"/Activities/:scope/:id/:name", + "route":"/Activities/:scope/:id/:name", "method":"get", "params":{ "controller":"Activities", - "action":"list", - "scope":":scope", - "id":":id", - "name":":name" + "action":"list", + "scope":":scope", + "id":":id", + "name":":name" } }, { - "route":"/Activities", + "route":"/Activities", "method":"get", "params":{ "controller":"Activities", - "action":"listCalendarEvents" + "action":"listCalendarEvents" } } ] diff --git a/application/Espo/Modules/Crm/SelectManagers/Call.php b/application/Espo/Modules/Crm/SelectManagers/Call.php index 1836490d66..63936b3f29 100644 --- a/application/Espo/Modules/Crm/SelectManagers/Call.php +++ b/application/Espo/Modules/Crm/SelectManagers/Call.php @@ -24,14 +24,14 @@ namespace Espo\Modules\Crm\SelectManagers; class Call extends \Espo\Core\SelectManagers\Base { - - protected function getBoolFilterWhereOnlyMy() - { - return array( - 'type' => 'linkedWith', - 'field' => 'users', - 'value' => array($this->user->id) - ); - } + + protected function getBoolFilterWhereOnlyMy() + { + return array( + 'type' => 'linkedWith', + 'field' => 'users', + 'value' => array($this->user->id) + ); + } } diff --git a/application/Espo/Modules/Crm/SelectManagers/Meeting.php b/application/Espo/Modules/Crm/SelectManagers/Meeting.php index aedc764636..9911218f43 100644 --- a/application/Espo/Modules/Crm/SelectManagers/Meeting.php +++ b/application/Espo/Modules/Crm/SelectManagers/Meeting.php @@ -24,14 +24,14 @@ namespace Espo\Modules\Crm\SelectManagers; class Meeting extends \Espo\Core\SelectManagers\Base { - - protected function getBoolFilterWhereOnlyMy() - { - return array( - 'type' => 'linkedWith', - 'field' => 'users', - 'value' => array($this->user->id) - ); - } + + protected function getBoolFilterWhereOnlyMy() + { + return array( + 'type' => 'linkedWith', + 'field' => 'users', + 'value' => array($this->user->id) + ); + } } diff --git a/application/Espo/Modules/Crm/SelectManagers/Task.php b/application/Espo/Modules/Crm/SelectManagers/Task.php index 791da4a29a..5c0fb296f9 100644 --- a/application/Espo/Modules/Crm/SelectManagers/Task.php +++ b/application/Espo/Modules/Crm/SelectManagers/Task.php @@ -24,23 +24,23 @@ namespace Espo\Modules\Crm\SelectManagers; class Task extends \Espo\Core\SelectManagers\Base { - - protected function getBoolFilterWhereActive() - { - return array( - 'type' => 'notIn', - 'field' => 'status', - 'value' => array('Completed', 'Canceled') - ); - } - - protected function getBoolFilterWhereInactive() - { - return array( - 'type' => 'in', - 'field' => 'status', - 'value' => array('Completed', 'Canceled') - ); - } + + protected function getBoolFilterWhereActive() + { + return array( + 'type' => 'notIn', + 'field' => 'status', + 'value' => array('Completed', 'Canceled') + ); + } + + protected function getBoolFilterWhereInactive() + { + return array( + 'type' => 'in', + 'field' => 'status', + 'value' => array('Completed', 'Canceled') + ); + } } diff --git a/application/Espo/Modules/Crm/Services/Account.php b/application/Espo/Modules/Crm/Services/Account.php index b6ba4b77f5..e2b9f0968f 100644 --- a/application/Espo/Modules/Crm/Services/Account.php +++ b/application/Espo/Modules/Crm/Services/Account.php @@ -25,20 +25,20 @@ namespace Espo\Modules\Crm\Services; use \Espo\ORM\Entity; class Account extends \Espo\Services\Record -{ - protected $linkSelectParams = array( - 'contacts' => array( - 'additionalColumns' => array( - 'role' => 'accountRole' - ) - ) - ); - - protected function getDuplicateWhereClause(Entity $entity) - { - return array( - 'name' => $entity->get('name') - ); - } +{ + protected $linkSelectParams = array( + 'contacts' => array( + 'additionalColumns' => array( + 'role' => 'accountRole' + ) + ) + ); + + protected function getDuplicateWhereClause(Entity $entity) + { + return array( + 'name' => $entity->get('name') + ); + } } diff --git a/application/Espo/Modules/Crm/Services/Activities.php b/application/Espo/Modules/Crm/Services/Activities.php index e7e0ea70c4..aef76bad0f 100644 --- a/application/Espo/Modules/Crm/Services/Activities.php +++ b/application/Espo/Modules/Crm/Services/Activities.php @@ -27,414 +27,414 @@ use \PDO; class Activities extends \Espo\Core\Services\Base { - protected $dependencies = array( - 'entityManager', - 'user', - 'metadata', - 'acl' - ); - - protected function getPDO() - { - return $this->getEntityManager()->getPDO(); - } + protected $dependencies = array( + 'entityManager', + 'user', + 'metadata', + 'acl' + ); + + protected function getPDO() + { + return $this->getEntityManager()->getPDO(); + } - protected function getEntityManager() - { - return $this->injections['entityManager']; - } + protected function getEntityManager() + { + return $this->injections['entityManager']; + } - protected function getUser() - { - return $this->injections['user']; - } - - protected function getAcl() - { - return $this->injections['acl']; - } - - protected function getMetadata() - { - return $this->injections['metadata']; - } - - protected function isPerson($scope) - { - return in_array($scope, array('Contact', 'Lead', 'User')); - } - - protected function getMeetingQuery($scope, $id, $op = 'IN', $notIn = array()) - { - $baseSql = " - SELECT meeting.id AS 'id', meeting.name AS 'name', meeting.date_start AS 'dateStart', meeting.date_end AS 'dateEnd', 'Meeting' AS '_scope', - meeting.assigned_user_id AS assignedUserId, TRIM(CONCAT(user.first_name, ' ', user.last_name)) AS assignedUserName, - meeting.parent_type AS 'parentType', meeting.parent_id AS 'parentId', meeting.status AS status, meeting.created_at AS createdAt - FROM `meeting` - LEFT JOIN `user` ON user.id = meeting.assigned_user_id - "; - - $sql = $baseSql; - $sql .= " - WHERE - meeting.deleted = 0 AND - "; - if ($scope == 'Account') { - $sql .= " - (meeting.parent_type = ".$this->getPDO()->quote($scope)." AND meeting.parent_id = ".$this->getPDO()->quote($id)." - OR - meeting.account_id = ".$this->getPDO()->quote($id).") - "; - } else { - $sql .= " - (meeting.parent_type = ".$this->getPDO()->quote($scope)." AND meeting.parent_id = ".$this->getPDO()->quote($id).") - "; - } - - if (!empty($notIn)) { - $sql .= " - AND meeting.status {$op} ('". implode("', '", $notIn) . "') - "; - } - - if ($this->isPerson($scope)) { - $sql = $sql . " - UNION - " . $baseSql; - - switch ($scope) { - case 'Contact': - $joinTable = 'contact_meeting'; - $key = 'contact_id'; - break; - case 'Lead': - $joinTable = 'lead_meeting'; - $key = 'lead_id'; - break; - case 'User': - $joinTable = 'meeting_user'; - $key = 'user_id'; - break; - } - $sql .= " - JOIN `{$joinTable}` ON - meeting.id = {$joinTable}.meeting_id AND - {$joinTable}.deleted = 0 AND - {$joinTable}.{$key} = ".$this->getPDO()->quote($id)." - "; - $sql .= " - WHERE - ( - meeting.parent_type <> ".$this->getPDO()->quote($scope)." OR - meeting.parent_id <> ".$this->getPDO()->quote($id)." OR - meeting.parent_type IS NULL OR - meeting.parent_id IS NULL - ) AND - meeting.deleted = 0 - "; - if (!empty($notIn)) { - $sql .= " - AND meeting.status {$op} ('". implode("', '", $notIn) . "') - "; - } - - } + protected function getUser() + { + return $this->injections['user']; + } + + protected function getAcl() + { + return $this->injections['acl']; + } + + protected function getMetadata() + { + return $this->injections['metadata']; + } + + protected function isPerson($scope) + { + return in_array($scope, array('Contact', 'Lead', 'User')); + } + + protected function getMeetingQuery($scope, $id, $op = 'IN', $notIn = array()) + { + $baseSql = " + SELECT meeting.id AS 'id', meeting.name AS 'name', meeting.date_start AS 'dateStart', meeting.date_end AS 'dateEnd', 'Meeting' AS '_scope', + meeting.assigned_user_id AS assignedUserId, TRIM(CONCAT(user.first_name, ' ', user.last_name)) AS assignedUserName, + meeting.parent_type AS 'parentType', meeting.parent_id AS 'parentId', meeting.status AS status, meeting.created_at AS createdAt + FROM `meeting` + LEFT JOIN `user` ON user.id = meeting.assigned_user_id + "; + + $sql = $baseSql; + $sql .= " + WHERE + meeting.deleted = 0 AND + "; + if ($scope == 'Account') { + $sql .= " + (meeting.parent_type = ".$this->getPDO()->quote($scope)." AND meeting.parent_id = ".$this->getPDO()->quote($id)." + OR + meeting.account_id = ".$this->getPDO()->quote($id).") + "; + } else { + $sql .= " + (meeting.parent_type = ".$this->getPDO()->quote($scope)." AND meeting.parent_id = ".$this->getPDO()->quote($id).") + "; + } + + if (!empty($notIn)) { + $sql .= " + AND meeting.status {$op} ('". implode("', '", $notIn) . "') + "; + } + + if ($this->isPerson($scope)) { + $sql = $sql . " + UNION + " . $baseSql; + + switch ($scope) { + case 'Contact': + $joinTable = 'contact_meeting'; + $key = 'contact_id'; + break; + case 'Lead': + $joinTable = 'lead_meeting'; + $key = 'lead_id'; + break; + case 'User': + $joinTable = 'meeting_user'; + $key = 'user_id'; + break; + } + $sql .= " + JOIN `{$joinTable}` ON + meeting.id = {$joinTable}.meeting_id AND + {$joinTable}.deleted = 0 AND + {$joinTable}.{$key} = ".$this->getPDO()->quote($id)." + "; + $sql .= " + WHERE + ( + meeting.parent_type <> ".$this->getPDO()->quote($scope)." OR + meeting.parent_id <> ".$this->getPDO()->quote($id)." OR + meeting.parent_type IS NULL OR + meeting.parent_id IS NULL + ) AND + meeting.deleted = 0 + "; + if (!empty($notIn)) { + $sql .= " + AND meeting.status {$op} ('". implode("', '", $notIn) . "') + "; + } + + } - return $sql; - } - - protected function getCallQuery($scope, $id, $op = 'IN', $notIn = array()) - { - $baseSql = " - SELECT call.id AS 'id', call.name AS 'name', call.date_start AS 'dateStart', call.date_end AS 'dateEnd', 'Call' AS '_scope', - call.assigned_user_id AS assignedUserId, TRIM(CONCAT(user.first_name, ' ', user.last_name)) AS assignedUserName, - call.parent_type AS 'parentType', call.parent_id AS 'parentId', call.status AS status, call.created_at AS createdAt - FROM `call` - LEFT JOIN `user` ON user.id = call.assigned_user_id - "; - - $sql = $baseSql; - $sql .= " - WHERE - call.deleted = 0 AND - "; - if ($scope == 'Account') { - $sql .= " - (call.parent_type = ".$this->getPDO()->quote($scope)." AND call.parent_id = ".$this->getPDO()->quote($id)." - OR - call.account_id = ".$this->getPDO()->quote($id).") - "; - } else { - $sql .= " - (call.parent_type = ".$this->getPDO()->quote($scope)." AND call.parent_id = ".$this->getPDO()->quote($id).") - "; - } - - if (!empty($notIn)) { - $sql .= " - AND call.status {$op} ('". implode("', '", $notIn) . "') - "; - } - - if ($this->isPerson($scope)) { - $sql = $sql . " - UNION - " . $baseSql; - - switch ($scope) { - case 'Contact': - $joinTable = 'call_contact'; - $key = 'contact_id'; - break; - case 'Lead': - $joinTable = 'call_lead'; - $key = 'lead_id'; - break; - case 'User': - $joinTable = 'call_user'; - $key = 'user_id'; - break; - } - $sql .= " - JOIN `{$joinTable}` ON - call.id = {$joinTable}.call_id AND - {$joinTable}.deleted = 0 AND - {$joinTable}.{$key} = ".$this->getPDO()->quote($id)." - "; - $sql .= " - WHERE - ( - call.parent_type <> ".$this->getPDO()->quote($scope)." OR - call.parent_id <> ".$this->getPDO()->quote($id)." OR - call.parent_type IS NULL OR - call.parent_id IS NULL - ) AND - call.deleted = 0 - "; - if (!empty($notIn)) { - $sql .= " - AND call.status {$op} ('". implode("', '", $notIn) . "') - "; - } - - } + return $sql; + } + + protected function getCallQuery($scope, $id, $op = 'IN', $notIn = array()) + { + $baseSql = " + SELECT call.id AS 'id', call.name AS 'name', call.date_start AS 'dateStart', call.date_end AS 'dateEnd', 'Call' AS '_scope', + call.assigned_user_id AS assignedUserId, TRIM(CONCAT(user.first_name, ' ', user.last_name)) AS assignedUserName, + call.parent_type AS 'parentType', call.parent_id AS 'parentId', call.status AS status, call.created_at AS createdAt + FROM `call` + LEFT JOIN `user` ON user.id = call.assigned_user_id + "; + + $sql = $baseSql; + $sql .= " + WHERE + call.deleted = 0 AND + "; + if ($scope == 'Account') { + $sql .= " + (call.parent_type = ".$this->getPDO()->quote($scope)." AND call.parent_id = ".$this->getPDO()->quote($id)." + OR + call.account_id = ".$this->getPDO()->quote($id).") + "; + } else { + $sql .= " + (call.parent_type = ".$this->getPDO()->quote($scope)." AND call.parent_id = ".$this->getPDO()->quote($id).") + "; + } + + if (!empty($notIn)) { + $sql .= " + AND call.status {$op} ('". implode("', '", $notIn) . "') + "; + } + + if ($this->isPerson($scope)) { + $sql = $sql . " + UNION + " . $baseSql; + + switch ($scope) { + case 'Contact': + $joinTable = 'call_contact'; + $key = 'contact_id'; + break; + case 'Lead': + $joinTable = 'call_lead'; + $key = 'lead_id'; + break; + case 'User': + $joinTable = 'call_user'; + $key = 'user_id'; + break; + } + $sql .= " + JOIN `{$joinTable}` ON + call.id = {$joinTable}.call_id AND + {$joinTable}.deleted = 0 AND + {$joinTable}.{$key} = ".$this->getPDO()->quote($id)." + "; + $sql .= " + WHERE + ( + call.parent_type <> ".$this->getPDO()->quote($scope)." OR + call.parent_id <> ".$this->getPDO()->quote($id)." OR + call.parent_type IS NULL OR + call.parent_id IS NULL + ) AND + call.deleted = 0 + "; + if (!empty($notIn)) { + $sql .= " + AND call.status {$op} ('". implode("', '", $notIn) . "') + "; + } + + } - return $sql; - } - - protected function getEmailQuery($scope, $id, $op = 'IN', $notIn = array()) - { - $baseSql = " - SELECT DISTINCT - email.id AS 'id', email.name AS 'name', email.date_sent AS 'dateStart', '' AS 'dateEnd', 'Email' AS '_scope', - email.assigned_user_id AS assignedUserId, TRIM(CONCAT(user.first_name, ' ', user.last_name)) AS assignedUserName, - email.parent_type AS 'parentType', email.parent_id AS 'parentId', email.status AS status, email.created_at AS createdAt - FROM `email` - LEFT JOIN `user` ON user.id = email.assigned_user_id - "; - - $sql = $baseSql; - $sql .= " - WHERE - email.deleted = 0 AND - "; - if ($scope == 'Account') { - $sql .= " - (email.parent_type = ".$this->getPDO()->quote($scope)." AND email.parent_id = ".$this->getPDO()->quote($id)." - OR - email.account_id = ".$this->getPDO()->quote($id).") - "; - } else { - $sql .= " - (email.parent_type = ".$this->getPDO()->quote($scope)." AND email.parent_id = ".$this->getPDO()->quote($id).") - "; - } - - if (!empty($notIn)) { - $sql .= " - AND email.status {$op} ('". implode("', '", $notIn) . "') - "; - } - - if ($this->isPerson($scope)) { - $sql = $sql . " - UNION - " . $baseSql; - $sql .= " - LEFT JOIN entity_email_address AS entity_email_address_2 ON - entity_email_address_2.email_address_id = email.from_email_address_id AND - entity_email_address_2.entity_type = " . $this->getPDO()->quote($scope) . " AND - entity_email_address_2.deleted = 0 - - LEFT JOIN email_email_address ON - email_email_address.email_id = email.id AND - email_email_address.deleted = 0 - LEFT JOIN entity_email_address AS entity_email_address_1 ON - entity_email_address_1.email_address_id = email_email_address.email_address_id AND - - entity_email_address_1.entity_type = " . $this->getPDO()->quote($scope) . " AND - entity_email_address_1.deleted = 0 - "; - $sql .= " - WHERE - email.deleted = 0 AND - ( - email.parent_type <> ".$this->getPDO()->quote($scope)." OR - email.parent_id <> ".$this->getPDO()->quote($id)." OR - email.parent_type IS NULL OR - email.parent_id IS NULL - ) AND - (entity_email_address_1.entity_id = ".$this->getPDO()->quote($id)." OR entity_email_address_2.entity_id = ".$this->getPDO()->quote($id).") - "; - if (!empty($notIn)) { - $sql .= " - AND email.status {$op} ('". implode("', '", $notIn) . "') - "; - } - } - - return $sql; - } - - protected function getResult($parts, $scope, $id, $params) - { - $pdo = $this->getEntityManager()->getPDO(); - - $onlyScope = false; - if (!empty($params['scope'])) { - $onlyScope = $params['scope']; - } - - if (!$onlyScope) { - $qu = implode(" UNION ", $parts); - } else { - $qu = $parts[$onlyScope]; - } - - $countQu = "SELECT COUNT(*) AS 'count' FROM ({$qu}) AS c"; - $sth = $pdo->prepare($countQu); - $sth->execute(); - - $row = $sth->fetch(PDO::FETCH_ASSOC); - $totalCount = $row['count']; - - $qu .= " - ORDER BY dateStart DESC, createdAt DESC - "; - - if (!empty($params['maxSize'])) { - $qu .= " - LIMIT :offset, :maxSize - "; - } + return $sql; + } + + protected function getEmailQuery($scope, $id, $op = 'IN', $notIn = array()) + { + $baseSql = " + SELECT DISTINCT + email.id AS 'id', email.name AS 'name', email.date_sent AS 'dateStart', '' AS 'dateEnd', 'Email' AS '_scope', + email.assigned_user_id AS assignedUserId, TRIM(CONCAT(user.first_name, ' ', user.last_name)) AS assignedUserName, + email.parent_type AS 'parentType', email.parent_id AS 'parentId', email.status AS status, email.created_at AS createdAt + FROM `email` + LEFT JOIN `user` ON user.id = email.assigned_user_id + "; + + $sql = $baseSql; + $sql .= " + WHERE + email.deleted = 0 AND + "; + if ($scope == 'Account') { + $sql .= " + (email.parent_type = ".$this->getPDO()->quote($scope)." AND email.parent_id = ".$this->getPDO()->quote($id)." + OR + email.account_id = ".$this->getPDO()->quote($id).") + "; + } else { + $sql .= " + (email.parent_type = ".$this->getPDO()->quote($scope)." AND email.parent_id = ".$this->getPDO()->quote($id).") + "; + } + + if (!empty($notIn)) { + $sql .= " + AND email.status {$op} ('". implode("', '", $notIn) . "') + "; + } + + if ($this->isPerson($scope)) { + $sql = $sql . " + UNION + " . $baseSql; + $sql .= " + LEFT JOIN entity_email_address AS entity_email_address_2 ON + entity_email_address_2.email_address_id = email.from_email_address_id AND + entity_email_address_2.entity_type = " . $this->getPDO()->quote($scope) . " AND + entity_email_address_2.deleted = 0 + + LEFT JOIN email_email_address ON + email_email_address.email_id = email.id AND + email_email_address.deleted = 0 + LEFT JOIN entity_email_address AS entity_email_address_1 ON + entity_email_address_1.email_address_id = email_email_address.email_address_id AND + + entity_email_address_1.entity_type = " . $this->getPDO()->quote($scope) . " AND + entity_email_address_1.deleted = 0 + "; + $sql .= " + WHERE + email.deleted = 0 AND + ( + email.parent_type <> ".$this->getPDO()->quote($scope)." OR + email.parent_id <> ".$this->getPDO()->quote($id)." OR + email.parent_type IS NULL OR + email.parent_id IS NULL + ) AND + (entity_email_address_1.entity_id = ".$this->getPDO()->quote($id)." OR entity_email_address_2.entity_id = ".$this->getPDO()->quote($id).") + "; + if (!empty($notIn)) { + $sql .= " + AND email.status {$op} ('". implode("', '", $notIn) . "') + "; + } + } + + return $sql; + } + + protected function getResult($parts, $scope, $id, $params) + { + $pdo = $this->getEntityManager()->getPDO(); + + $onlyScope = false; + if (!empty($params['scope'])) { + $onlyScope = $params['scope']; + } + + if (!$onlyScope) { + $qu = implode(" UNION ", $parts); + } else { + $qu = $parts[$onlyScope]; + } + + $countQu = "SELECT COUNT(*) AS 'count' FROM ({$qu}) AS c"; + $sth = $pdo->prepare($countQu); + $sth->execute(); + + $row = $sth->fetch(PDO::FETCH_ASSOC); + $totalCount = $row['count']; + + $qu .= " + ORDER BY dateStart DESC, createdAt DESC + "; + + if (!empty($params['maxSize'])) { + $qu .= " + LIMIT :offset, :maxSize + "; + } - + - $sth = $pdo->prepare($qu); - - if (!empty($params['maxSize'])) { - $offset = 0; - if (!empty($params['offset'])) { - $offset = $params['offset']; - } - - $sth->bindParam(':offset', $offset, PDO::PARAM_INT); - $sth->bindParam(':maxSize', $params['maxSize'], PDO::PARAM_INT); - } - - $sth->execute(); - - $rows = $sth->fetchAll(PDO::FETCH_ASSOC); - - $list = array(); - foreach ($rows as $row) { - $list[] = $row; - } - - return array( - 'list' => $rows, - 'total' => $totalCount - ); - } - - public function getActivities($scope, $id, $params = array()) - { - $fetchAll = empty($params['scope']); - - $parts = array( - 'Meeting' => ($fetchAll || $params['scope'] == 'Meeting') ? $this->getMeetingQuery($scope, $id, 'NOT IN', array('Held', 'Not Held')) : array(), - 'Call' => ($fetchAll || $params['scope'] == 'Call') ? $this->getCallQuery($scope, $id, 'NOT IN', array('Held', 'Not Held')) : array(), - ); - return $this->getResult($parts, $scope, $id, $params); - } - - public function getHistory($scope, $id, $params) - { - - $fetchAll = empty($params['scope']); + $sth = $pdo->prepare($qu); + + if (!empty($params['maxSize'])) { + $offset = 0; + if (!empty($params['offset'])) { + $offset = $params['offset']; + } + + $sth->bindParam(':offset', $offset, PDO::PARAM_INT); + $sth->bindParam(':maxSize', $params['maxSize'], PDO::PARAM_INT); + } + + $sth->execute(); + + $rows = $sth->fetchAll(PDO::FETCH_ASSOC); + + $list = array(); + foreach ($rows as $row) { + $list[] = $row; + } + + return array( + 'list' => $rows, + 'total' => $totalCount + ); + } + + public function getActivities($scope, $id, $params = array()) + { + $fetchAll = empty($params['scope']); + + $parts = array( + 'Meeting' => ($fetchAll || $params['scope'] == 'Meeting') ? $this->getMeetingQuery($scope, $id, 'NOT IN', array('Held', 'Not Held')) : array(), + 'Call' => ($fetchAll || $params['scope'] == 'Call') ? $this->getCallQuery($scope, $id, 'NOT IN', array('Held', 'Not Held')) : array(), + ); + return $this->getResult($parts, $scope, $id, $params); + } + + public function getHistory($scope, $id, $params) + { + + $fetchAll = empty($params['scope']); - $parts = array( - 'Meeting' => ($fetchAll || $params['scope'] == 'Meeting') ? $this->getMeetingQuery($scope, $id, 'IN', array('Held')) : array(), - 'Call' => ($fetchAll || $params['scope'] == 'Call') ? $this->getCallQuery($scope, $id, 'IN', array('Held')) : array(), - 'Email' => ($fetchAll || $params['scope'] == 'Email') ? $this->getEmailQuery($scope, $id, 'IN', array('Archived', 'Sent')) : array(), - ); - $result = $this->getResult($parts, $scope, $id, $params); - - foreach ($result['list'] as &$item) { - if ($item['_scope'] == 'Email') { - $item['dateSent'] = $item['dateStart']; - } - } - - return $result; - } - - public function getEvents($userId, $from, $to) - { - $pdo = $this->getPDO(); - - $sql = " - SELECT 'Meeting' AS scope, meeting.id AS id, meeting.name AS name, meeting.date_start AS dateStart, meeting.date_end AS dateEnd, meeting.status AS status - FROM `meeting` - JOIN meeting_user ON meeting_user.meeting_id = meeting.id AND meeting_user.deleted = 0 - WHERE - meeting.deleted = 0 AND - meeting.date_start >= ".$pdo->quote($from)." AND - meeting.date_start < ".$pdo->quote($to)." AND - meeting_user.user_id =".$pdo->quote($userId)." - UNION - SELECT 'Call' AS scope, call.id AS id, call.name AS name, call.date_start AS dateStart, call.date_end AS dateEnd, call.status AS status - FROM `call` - JOIN call_user ON call_user.call_id = call.id AND call_user.deleted = 0 - WHERE - call.deleted = 0 AND - call.date_start >= ".$pdo->quote($from)." AND - call.date_start < ".$pdo->quote($to)." AND - call_user.user_id = ".$pdo->quote($userId)." - UNION - SELECT 'Task' AS scope, task.id AS id, task.name AS name, task.date_start AS dateStart, task.date_end AS dateEnd, task.status AS status - FROM `task` - WHERE - task.deleted = 0 AND - ( - ( - task.date_start >= ".$pdo->quote($from)." AND - task.date_start < ".$pdo->quote($to)." - ) OR ( - (task.date_start IS NULL OR task.date_start = '') AND - task.date_end >= ".$pdo->quote($from)." AND - task.date_end < ".$pdo->quote($to)." - ) - ) AND - task.assigned_user_id = ".$pdo->quote($userId)." - "; + $parts = array( + 'Meeting' => ($fetchAll || $params['scope'] == 'Meeting') ? $this->getMeetingQuery($scope, $id, 'IN', array('Held')) : array(), + 'Call' => ($fetchAll || $params['scope'] == 'Call') ? $this->getCallQuery($scope, $id, 'IN', array('Held')) : array(), + 'Email' => ($fetchAll || $params['scope'] == 'Email') ? $this->getEmailQuery($scope, $id, 'IN', array('Archived', 'Sent')) : array(), + ); + $result = $this->getResult($parts, $scope, $id, $params); + + foreach ($result['list'] as &$item) { + if ($item['_scope'] == 'Email') { + $item['dateSent'] = $item['dateStart']; + } + } + + return $result; + } + + public function getEvents($userId, $from, $to) + { + $pdo = $this->getPDO(); + + $sql = " + SELECT 'Meeting' AS scope, meeting.id AS id, meeting.name AS name, meeting.date_start AS dateStart, meeting.date_end AS dateEnd, meeting.status AS status + FROM `meeting` + JOIN meeting_user ON meeting_user.meeting_id = meeting.id AND meeting_user.deleted = 0 + WHERE + meeting.deleted = 0 AND + meeting.date_start >= ".$pdo->quote($from)." AND + meeting.date_start < ".$pdo->quote($to)." AND + meeting_user.user_id =".$pdo->quote($userId)." + UNION + SELECT 'Call' AS scope, call.id AS id, call.name AS name, call.date_start AS dateStart, call.date_end AS dateEnd, call.status AS status + FROM `call` + JOIN call_user ON call_user.call_id = call.id AND call_user.deleted = 0 + WHERE + call.deleted = 0 AND + call.date_start >= ".$pdo->quote($from)." AND + call.date_start < ".$pdo->quote($to)." AND + call_user.user_id = ".$pdo->quote($userId)." + UNION + SELECT 'Task' AS scope, task.id AS id, task.name AS name, task.date_start AS dateStart, task.date_end AS dateEnd, task.status AS status + FROM `task` + WHERE + task.deleted = 0 AND + ( + ( + task.date_start >= ".$pdo->quote($from)." AND + task.date_start < ".$pdo->quote($to)." + ) OR ( + (task.date_start IS NULL OR task.date_start = '') AND + task.date_end >= ".$pdo->quote($from)." AND + task.date_end < ".$pdo->quote($to)." + ) + ) AND + task.assigned_user_id = ".$pdo->quote($userId)." + "; - - $sth = $pdo->prepare($sql); - $sth->execute(); - $rows = $sth->fetchAll(PDO::FETCH_ASSOC); - - return $rows; - } + + $sth = $pdo->prepare($sql); + $sth->execute(); + $rows = $sth->fetchAll(PDO::FETCH_ASSOC); + + return $rows; + } } diff --git a/application/Espo/Modules/Crm/Services/Contact.php b/application/Espo/Modules/Crm/Services/Contact.php index 37668c1d5e..8570a5670f 100644 --- a/application/Espo/Modules/Crm/Services/Contact.php +++ b/application/Espo/Modules/Crm/Services/Contact.php @@ -26,19 +26,19 @@ use \Espo\ORM\Entity; class Contact extends \Espo\Services\Record { - protected function getDuplicateWhereClause(Entity $entity) - { - return array( - 'OR' => array( - array( - 'firstName' => $entity->get('firstName'), - 'lastName' => $entity->get('lastName'), - ), - array( - 'emailAddress' => $entity->get('emailAddress'), - ), - ), - ); - } + protected function getDuplicateWhereClause(Entity $entity) + { + return array( + 'OR' => array( + array( + 'firstName' => $entity->get('firstName'), + 'lastName' => $entity->get('lastName'), + ), + array( + 'emailAddress' => $entity->get('emailAddress'), + ), + ), + ); + } } diff --git a/application/Espo/Modules/Crm/Services/InboundEmail.php b/application/Espo/Modules/Crm/Services/InboundEmail.php index 725f0f3cae..30d8189166 100644 --- a/application/Espo/Modules/Crm/Services/InboundEmail.php +++ b/application/Espo/Modules/Crm/Services/InboundEmail.php @@ -28,400 +28,400 @@ use \Espo\Core\Exceptions\Error; use \Espo\Core\Exceptions\Forbidden; class InboundEmail extends \Espo\Services\Record -{ - protected $internalFields = array('password'); - - const PORTION_LIMIT = 20; - - public function createEntity($data) - { - $entity = parent::createEntity($data); - return $entity; - } - - public function getEntity($id = null) - { - $entity = parent::getEntity($id); - return $entity; - } - - public function updateEntity($id, $data) - { - $entity = parent::updateEntity($id, $data); - return $entity; - } - - public function findEntities($params) - { - $result = parent::findEntities($params); - - return $result; - } - - protected function init() - { - $this->dependencies[] = 'fileManager'; - $this->dependencies[] = 'mailSender'; - $this->dependencies[] = 'crypt'; - } - - protected function getFileManager() - { - return $this->injections['fileManager']; - } - - protected function getMailSender() - { - return $this->injections['mailSender']; - } - - protected function getCrypt() - { - return $this->injections['crypt']; - } - - protected function handleInput(&$data) - { - parent::handleInput($data); - if (array_key_exists('password', $data)) { - $data['password'] = $this->getCrypt()->encrypt($data['password']); - } - } - - public function getFolders($params) - { - $password = $params['password']; - - if (!empty($params['id'])) { - $entity = $this->getEntityManager()->getEntity('InboundEmail', $params['id']); - if ($entity) { - $password = $this->getCrypt()->decrypt($entity->get('password')); - } - } - - $imapParams = array( - 'host' => $params['host'], - 'port' => $params['port'], - 'user' => $params['username'], - 'password' => $password, - ); - - if (!empty($params['ssl'])) { - $imapParams['ssl'] = 'SSL'; - } - - $foldersArr = array(); - - $storage = new \Zend\Mail\Storage\Imap($imapParams); - - $folders = new \RecursiveIteratorIterator($storage->getFolders(), \RecursiveIteratorIterator::SELF_FIRST); - foreach ($folders as $name => $folder) { - $foldersArr[] = $folder->getGlobalName(); - } - return $foldersArr; - } - - public function fetchFromMailServer(Entity $inboundEmail) - { - if ($inboundEmail->get('status') != 'Active') { - throw new Error(); - } - - $importer = new \Espo\Core\Mail\Importer($this->getEntityManager(), $this->getFileManager()); - - $maxSize = $this->getConfig()->get('emailMessageMaxSize'); - - $teamId = $inboundEmail->get('teamId'); - $userId = $this->getUser()->id; - if ($inboundEmail->get('assignToUserId')) { - $userId = $inboundEmail->get('assignToUserId'); - } - - $fetchData = json_decode($inboundEmail->get('fetchData'), true); - if (empty($fetchData)) { - $fetchData = array(); - } - if (!array_key_exists('lastUID', $fetchData)) { - $fetchData['lastUID'] = array(); - } - if (!array_key_exists('lastUID', $fetchData)) { - $fetchData['lastDate'] = array(); - } - - $imapParams = array( - 'host' => $inboundEmail->get('host'), - 'port' => $inboundEmail->get('port'), - 'user' => $inboundEmail->get('username'), - 'password' => $this->getCrypt()->decrypt($inboundEmail->get('password')), - ); - - if ($inboundEmail->get('ssl')) { - $imapParams['ssl'] = 'SSL'; - } - - $storage = new \Espo\Core\Mail\Storage\Imap($imapParams); - - $monitoredFolders = $inboundEmail->get('monitoredFolders'); - if (empty($monitoredFolders)) { - $monitoredFolders = 'INBOX'; - } - - $monitoredFoldersArr = explode(',', $monitoredFolders); - foreach ($monitoredFoldersArr as $folder) { - $folder = trim($folder); - $storage->selectFolder($folder); - - $lastUID = 0; - $lastDate = 0; - if (!empty($fetchData['lastUID'][$folder])) { - $lastUID = $fetchData['lastUID'][$folder]; - } - if (!empty($fetchData['lastDate'][$folder])) { - $lastDate = $fetchData['lastDate'][$folder]; - } +{ + protected $internalFields = array('password'); + + const PORTION_LIMIT = 20; + + public function createEntity($data) + { + $entity = parent::createEntity($data); + return $entity; + } + + public function getEntity($id = null) + { + $entity = parent::getEntity($id); + return $entity; + } + + public function updateEntity($id, $data) + { + $entity = parent::updateEntity($id, $data); + return $entity; + } + + public function findEntities($params) + { + $result = parent::findEntities($params); + + return $result; + } + + protected function init() + { + $this->dependencies[] = 'fileManager'; + $this->dependencies[] = 'mailSender'; + $this->dependencies[] = 'crypt'; + } + + protected function getFileManager() + { + return $this->injections['fileManager']; + } + + protected function getMailSender() + { + return $this->injections['mailSender']; + } + + protected function getCrypt() + { + return $this->injections['crypt']; + } + + protected function handleInput(&$data) + { + parent::handleInput($data); + if (array_key_exists('password', $data)) { + $data['password'] = $this->getCrypt()->encrypt($data['password']); + } + } + + public function getFolders($params) + { + $password = $params['password']; + + if (!empty($params['id'])) { + $entity = $this->getEntityManager()->getEntity('InboundEmail', $params['id']); + if ($entity) { + $password = $this->getCrypt()->decrypt($entity->get('password')); + } + } + + $imapParams = array( + 'host' => $params['host'], + 'port' => $params['port'], + 'user' => $params['username'], + 'password' => $password, + ); + + if (!empty($params['ssl'])) { + $imapParams['ssl'] = 'SSL'; + } + + $foldersArr = array(); + + $storage = new \Zend\Mail\Storage\Imap($imapParams); + + $folders = new \RecursiveIteratorIterator($storage->getFolders(), \RecursiveIteratorIterator::SELF_FIRST); + foreach ($folders as $name => $folder) { + $foldersArr[] = $folder->getGlobalName(); + } + return $foldersArr; + } + + public function fetchFromMailServer(Entity $inboundEmail) + { + if ($inboundEmail->get('status') != 'Active') { + throw new Error(); + } + + $importer = new \Espo\Core\Mail\Importer($this->getEntityManager(), $this->getFileManager()); + + $maxSize = $this->getConfig()->get('emailMessageMaxSize'); + + $teamId = $inboundEmail->get('teamId'); + $userId = $this->getUser()->id; + if ($inboundEmail->get('assignToUserId')) { + $userId = $inboundEmail->get('assignToUserId'); + } + + $fetchData = json_decode($inboundEmail->get('fetchData'), true); + if (empty($fetchData)) { + $fetchData = array(); + } + if (!array_key_exists('lastUID', $fetchData)) { + $fetchData['lastUID'] = array(); + } + if (!array_key_exists('lastUID', $fetchData)) { + $fetchData['lastDate'] = array(); + } + + $imapParams = array( + 'host' => $inboundEmail->get('host'), + 'port' => $inboundEmail->get('port'), + 'user' => $inboundEmail->get('username'), + 'password' => $this->getCrypt()->decrypt($inboundEmail->get('password')), + ); + + if ($inboundEmail->get('ssl')) { + $imapParams['ssl'] = 'SSL'; + } + + $storage = new \Espo\Core\Mail\Storage\Imap($imapParams); + + $monitoredFolders = $inboundEmail->get('monitoredFolders'); + if (empty($monitoredFolders)) { + $monitoredFolders = 'INBOX'; + } + + $monitoredFoldersArr = explode(',', $monitoredFolders); + foreach ($monitoredFoldersArr as $folder) { + $folder = trim($folder); + $storage->selectFolder($folder); + + $lastUID = 0; + $lastDate = 0; + if (!empty($fetchData['lastUID'][$folder])) { + $lastUID = $fetchData['lastUID'][$folder]; + } + if (!empty($fetchData['lastDate'][$folder])) { + $lastDate = $fetchData['lastDate'][$folder]; + } - $ids = $storage->getIdsFromUID($lastUID); - - if ((count($ids) == 1) && !empty($lastUID)) { - if ($storage->getUniqueId($ids[0]) == $lastUID) { - continue; - } - } - - $k = 0; - foreach ($ids as $i => $id) { - if ($k == count($ids) - 1) { - $lastUID = $storage->getUniqueId($id); - } - - if ($maxSize) { - if ($storage->getSize($id) > $maxSize * 1024 * 1024) { - continue; - } - } - - $message = $storage->getMessage($id); - - $email = $importer->importMessage($message, $userId, array($teamId)); - - if ($email) { - if ($inboundEmail->get('createCase')) { - $this->createCase($inboundEmail, $email); - } else { - if ($inboundEmail->get('reply')) { - $user = $this->getEntityManager()->getEntity('User', $userId); - $this->autoReply($inboundEmail, $email, $user); - } - } - } - - if ($k == count($ids) - 1) { - if ($message) { - $dt = new \DateTime($message->date); - if ($dt) { - $dateSent = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'); - $lastDate = $dateSent; - } - } - } - - if ($k == self::PORTION_LIMIT - 1) { - $lastUID = $storage->getUniqueId($id); - break; - } - $k++; - } - - $fetchData['lastUID'][$folder] = $lastUID; - $fetchData['lastDate'][$folder] = $lastDate; - - $inboundEmail->set('fetchData', json_encode($fetchData)); - $this->getEntityManager()->saveEntity($inboundEmail); - } - - return true; - } - - protected function createCase($inboundEmail, $email) - { - if (preg_match('/\[#([0-9]+)[^0-9]*\]/', $email->get('name'), $m)) { - $caseNumber = $m[1]; - $case = $this->getEntityManager()->getRepository('Case')->where(array( - 'number' => $caseNumber - ))->findOne(); - if ($case) { - $email->set('parentType', 'Case'); - $email->set('parentId', $case->id); - $this->getEntityManager()->saveEntity($email); - $this->getServiceFactory()->create('Stream')->noteEmailReceived($case, $email); - } - } else { - $params = array( - 'caseDistribution' => $inboundEmail->get('caseDistribution'), - 'teamId' => $inboundEmail->get('teamId'), - 'userId' => $inboundEmail->get('assignToUserId'), - ); - $case = $this->emailToCase($email, $params); - $user = $this->getEntityManager()->getEntity('User', $case->get('assignedUserId')); - if ($inboundEmail->get('reply')) { - $this->autoReply($inboundEmail, $email, $case, $user); - } - } - } - - protected function assignRoundRobin($case, $team) - { - $roundRobin = new \Espo\Modules\Crm\Business\CaseDistribution\RoundRobin($this->getEntityManager()); - $user = $roundRobin->getUser($team); - if ($user) { - $case->set('assignedUserId', $user->id); - } - } - - protected function assignLeastBusy($case, $team) - { - $leastBusy = new \Espo\Modules\Crm\Business\CaseDistribution\LeastBusy($this->getEntityManager()); - $user = $leastBusy->getUser($team); - if ($user) { - $case->set('assignedUserId', $user->id); - } - } - - protected function emailToCase(\Espo\Entities\Email $email, array $params = array()) - { - $case = $this->getEntityManager()->getEntity('Case'); - $case->populateDefaults(); - $case->set('name', $email->get('name')); - - $userId = $this->getUser()->id; - if (!empty($params['userId'])) { - $userId = $params['userId']; - } - $case->set('assignedUserId', $userId); - - $teamId = false; - if (!empty($params['teamId'])) { - $teamId = $params['teamId']; - } - if ($teamId) { - $case->set('teamsIds', array($teamId)); - } - - $caseDistribution = 'Direct-Assignment'; - if (!empty($params['caseDistribution'])) { - $caseDistribution = $params['caseDistribution']; - } - - $case->set('status', 'Assigned'); - - switch ($caseDistribution) { - case 'Round-Robin': - if ($teamId) { - $team = $this->getEntityManager()->getEntity('Team', $teamId); - if ($team) { - $this->assignRoundRobin($case, $team); - } - } - break; - case 'Least-Busy': - if ($teamId) { - $team = $this->getEntityManager()->getEntity('Team', $teamId); - if ($team) { - $this->assignLeastBusy($case, $team); - } - } - break; - } - - $email->set('assignedUserId', $case->get('assignedUserId')); - - $contact = $this->getEntityManager()->getRepository('Contact')->where(array( - 'EmailAddress.id' => $email->get('fromEmailAddressId') - ))->findOne(); - if ($contact) { - $case->set('contactId', $contact->id); - if ($contact->get('accountId')) { - $case->set('accountId', $contact->get('accountId')); - } - } - - $this->getEntityManager()->saveEntity($case); - - $email->set('parentType', 'Case'); - $email->set('parentId', $case->id); - $this->getEntityManager()->saveEntity($email); - - $case = $this->getEntityManager()->getEntity('Case', $case->id); - - return $case; - } - - protected function autoReply($inboundEmail, $email, $case = null, $user = null) - { - try { - $replyEmailTemplateId = $inboundEmail->get('replyEmailTemplateId'); - if ($replyEmailTemplateId) { - $entityHash = array(); - if ($case) { - $entityHash['Case'] = $case; - if ($case->get('contactId')) { - $contact = $this->getEntityManager()->getEntity('Contact', $case->get('contactId')); - } - } - if (empty($contact)) { - $contact = $this->getEntityManager()->getEntity('Contact'); - $contact->set('name', $email->get('fromName')); - } - - - $entityHash['Person'] = $contact; - $entityHash['Contact'] = $contact; - - if ($user) { - $entityHash['User'] = $user; - } - - $emailTemplateService = $this->getServiceFactory()->create('EmailTemplate'); - - $replyData = $emailTemplateService->parse($replyEmailTemplateId, array('entityHash' => $entityHash), true); - - $subject = $replyData['subject']; - if ($case) { - $subject = '[#' . $case->get('number'). '] ' . $subject; - } - - $reply = $this->getEntityManager()->getEntity('Email'); - $reply->set('to', $email->get('from')); - $reply->set('subject', $subject); - $reply->set('body', $replyData['body']); - $reply->set('isHtml', $replyData['isHtml']); - $reply->set('attachmentsIds', $replyData['attachmentsIds']); - - $this->getEntityManager()->saveEntity($reply); - - $sender = $this->getMailSender()->useGlobal(); - $senderParams = array(); - if ($inboundEmail->get('replyFromAddress')) { - $senderParams['fromAddress'] = $inboundEmail->get('replyFromAddress'); - } - if ($inboundEmail->get('replyFromName')) { - $senderParams['fromName'] = $inboundEmail->get('replyFromName'); - } - if ($inboundEmail->get('replyToAddress')) { - $senderParams['replyToAddress'] = $inboundEmail->get('replyToAddress'); - } - $sender->send($reply, $senderParams); - - foreach ($reply->get('attachments') as $attachment) { - $this->getEntityManager()->removeEntity($attachment); - } - - $this->getEntityManager()->removeEntity($reply); - - return true; - } - - } catch (\Exception $e) {} - } + $ids = $storage->getIdsFromUID($lastUID); + + if ((count($ids) == 1) && !empty($lastUID)) { + if ($storage->getUniqueId($ids[0]) == $lastUID) { + continue; + } + } + + $k = 0; + foreach ($ids as $i => $id) { + if ($k == count($ids) - 1) { + $lastUID = $storage->getUniqueId($id); + } + + if ($maxSize) { + if ($storage->getSize($id) > $maxSize * 1024 * 1024) { + continue; + } + } + + $message = $storage->getMessage($id); + + $email = $importer->importMessage($message, $userId, array($teamId)); + + if ($email) { + if ($inboundEmail->get('createCase')) { + $this->createCase($inboundEmail, $email); + } else { + if ($inboundEmail->get('reply')) { + $user = $this->getEntityManager()->getEntity('User', $userId); + $this->autoReply($inboundEmail, $email, $user); + } + } + } + + if ($k == count($ids) - 1) { + if ($message) { + $dt = new \DateTime($message->date); + if ($dt) { + $dateSent = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'); + $lastDate = $dateSent; + } + } + } + + if ($k == self::PORTION_LIMIT - 1) { + $lastUID = $storage->getUniqueId($id); + break; + } + $k++; + } + + $fetchData['lastUID'][$folder] = $lastUID; + $fetchData['lastDate'][$folder] = $lastDate; + + $inboundEmail->set('fetchData', json_encode($fetchData)); + $this->getEntityManager()->saveEntity($inboundEmail); + } + + return true; + } + + protected function createCase($inboundEmail, $email) + { + if (preg_match('/\[#([0-9]+)[^0-9]*\]/', $email->get('name'), $m)) { + $caseNumber = $m[1]; + $case = $this->getEntityManager()->getRepository('Case')->where(array( + 'number' => $caseNumber + ))->findOne(); + if ($case) { + $email->set('parentType', 'Case'); + $email->set('parentId', $case->id); + $this->getEntityManager()->saveEntity($email); + $this->getServiceFactory()->create('Stream')->noteEmailReceived($case, $email); + } + } else { + $params = array( + 'caseDistribution' => $inboundEmail->get('caseDistribution'), + 'teamId' => $inboundEmail->get('teamId'), + 'userId' => $inboundEmail->get('assignToUserId'), + ); + $case = $this->emailToCase($email, $params); + $user = $this->getEntityManager()->getEntity('User', $case->get('assignedUserId')); + if ($inboundEmail->get('reply')) { + $this->autoReply($inboundEmail, $email, $case, $user); + } + } + } + + protected function assignRoundRobin($case, $team) + { + $roundRobin = new \Espo\Modules\Crm\Business\CaseDistribution\RoundRobin($this->getEntityManager()); + $user = $roundRobin->getUser($team); + if ($user) { + $case->set('assignedUserId', $user->id); + } + } + + protected function assignLeastBusy($case, $team) + { + $leastBusy = new \Espo\Modules\Crm\Business\CaseDistribution\LeastBusy($this->getEntityManager()); + $user = $leastBusy->getUser($team); + if ($user) { + $case->set('assignedUserId', $user->id); + } + } + + protected function emailToCase(\Espo\Entities\Email $email, array $params = array()) + { + $case = $this->getEntityManager()->getEntity('Case'); + $case->populateDefaults(); + $case->set('name', $email->get('name')); + + $userId = $this->getUser()->id; + if (!empty($params['userId'])) { + $userId = $params['userId']; + } + $case->set('assignedUserId', $userId); + + $teamId = false; + if (!empty($params['teamId'])) { + $teamId = $params['teamId']; + } + if ($teamId) { + $case->set('teamsIds', array($teamId)); + } + + $caseDistribution = 'Direct-Assignment'; + if (!empty($params['caseDistribution'])) { + $caseDistribution = $params['caseDistribution']; + } + + $case->set('status', 'Assigned'); + + switch ($caseDistribution) { + case 'Round-Robin': + if ($teamId) { + $team = $this->getEntityManager()->getEntity('Team', $teamId); + if ($team) { + $this->assignRoundRobin($case, $team); + } + } + break; + case 'Least-Busy': + if ($teamId) { + $team = $this->getEntityManager()->getEntity('Team', $teamId); + if ($team) { + $this->assignLeastBusy($case, $team); + } + } + break; + } + + $email->set('assignedUserId', $case->get('assignedUserId')); + + $contact = $this->getEntityManager()->getRepository('Contact')->where(array( + 'EmailAddress.id' => $email->get('fromEmailAddressId') + ))->findOne(); + if ($contact) { + $case->set('contactId', $contact->id); + if ($contact->get('accountId')) { + $case->set('accountId', $contact->get('accountId')); + } + } + + $this->getEntityManager()->saveEntity($case); + + $email->set('parentType', 'Case'); + $email->set('parentId', $case->id); + $this->getEntityManager()->saveEntity($email); + + $case = $this->getEntityManager()->getEntity('Case', $case->id); + + return $case; + } + + protected function autoReply($inboundEmail, $email, $case = null, $user = null) + { + try { + $replyEmailTemplateId = $inboundEmail->get('replyEmailTemplateId'); + if ($replyEmailTemplateId) { + $entityHash = array(); + if ($case) { + $entityHash['Case'] = $case; + if ($case->get('contactId')) { + $contact = $this->getEntityManager()->getEntity('Contact', $case->get('contactId')); + } + } + if (empty($contact)) { + $contact = $this->getEntityManager()->getEntity('Contact'); + $contact->set('name', $email->get('fromName')); + } + + + $entityHash['Person'] = $contact; + $entityHash['Contact'] = $contact; + + if ($user) { + $entityHash['User'] = $user; + } + + $emailTemplateService = $this->getServiceFactory()->create('EmailTemplate'); + + $replyData = $emailTemplateService->parse($replyEmailTemplateId, array('entityHash' => $entityHash), true); + + $subject = $replyData['subject']; + if ($case) { + $subject = '[#' . $case->get('number'). '] ' . $subject; + } + + $reply = $this->getEntityManager()->getEntity('Email'); + $reply->set('to', $email->get('from')); + $reply->set('subject', $subject); + $reply->set('body', $replyData['body']); + $reply->set('isHtml', $replyData['isHtml']); + $reply->set('attachmentsIds', $replyData['attachmentsIds']); + + $this->getEntityManager()->saveEntity($reply); + + $sender = $this->getMailSender()->useGlobal(); + $senderParams = array(); + if ($inboundEmail->get('replyFromAddress')) { + $senderParams['fromAddress'] = $inboundEmail->get('replyFromAddress'); + } + if ($inboundEmail->get('replyFromName')) { + $senderParams['fromName'] = $inboundEmail->get('replyFromName'); + } + if ($inboundEmail->get('replyToAddress')) { + $senderParams['replyToAddress'] = $inboundEmail->get('replyToAddress'); + } + $sender->send($reply, $senderParams); + + foreach ($reply->get('attachments') as $attachment) { + $this->getEntityManager()->removeEntity($attachment); + } + + $this->getEntityManager()->removeEntity($reply); + + return true; + } + + } catch (\Exception $e) {} + } } diff --git a/application/Espo/Modules/Crm/Services/Lead.php b/application/Espo/Modules/Crm/Services/Lead.php index 2128af3cbd..386b21a5ad 100644 --- a/application/Espo/Modules/Crm/Services/Lead.php +++ b/application/Espo/Modules/Crm/Services/Lead.php @@ -28,99 +28,99 @@ use \Espo\Core\Exceptions\Forbidden; use \Espo\ORM\Entity; class Lead extends \Espo\Services\Record -{ - protected function getDuplicateWhereClause(Entity $entity) - { - return array( - 'OR' => array( - array( - 'firstName' => $entity->get('firstName'), - 'lastName' => $entity->get('lastName'), - ), - array( - 'emailAddress' => $entity->get('emailAddress'), - ), - ), - ); - } - - public function convert($id, $recordsData) - { - $lead = $this->getEntity($id); - - if (!$this->getAcl()->check($lead, 'edit')) { - throw new Forbidden(); - } +{ + protected function getDuplicateWhereClause(Entity $entity) + { + return array( + 'OR' => array( + array( + 'firstName' => $entity->get('firstName'), + 'lastName' => $entity->get('lastName'), + ), + array( + 'emailAddress' => $entity->get('emailAddress'), + ), + ), + ); + } + + public function convert($id, $recordsData) + { + $lead = $this->getEntity($id); + + if (!$this->getAcl()->check($lead, 'edit')) { + throw new Forbidden(); + } - $entityManager = $this->getEntityManager(); + $entityManager = $this->getEntityManager(); - if (!empty($recordsData->Account)) { - $account = $entityManager->getEntity('Account'); - $account->set(get_object_vars($recordsData->Account)); - $entityManager->saveEntity($account); - $lead->set('createdAccountId', $account->id); - } - if (!empty($recordsData->Opportunity)) { - $opportunity = $entityManager->getEntity('Opportunity'); - $opportunity->set(get_object_vars($recordsData->Opportunity)); - if (isset($account)) { - $opportunity->set('accountId', $account->id); - } - $entityManager->saveEntity($opportunity); - $lead->set('createdOpportunityId', $opportunity->id); - } - if (!empty($recordsData->Contact)) { - $contact = $entityManager->getEntity('Contact'); - $contact->set(get_object_vars($recordsData->Contact)); - if (isset($account)) { - $contact->set('accountId', $account->id); - } - $entityManager->saveEntity($contact); - if (isset($opportunity)) { - $entityManager->getRepository('Contact')->relate($contact, 'opportunities', $opportunity); - } - $lead->set('createdContactId', $contact->id); - } + if (!empty($recordsData->Account)) { + $account = $entityManager->getEntity('Account'); + $account->set(get_object_vars($recordsData->Account)); + $entityManager->saveEntity($account); + $lead->set('createdAccountId', $account->id); + } + if (!empty($recordsData->Opportunity)) { + $opportunity = $entityManager->getEntity('Opportunity'); + $opportunity->set(get_object_vars($recordsData->Opportunity)); + if (isset($account)) { + $opportunity->set('accountId', $account->id); + } + $entityManager->saveEntity($opportunity); + $lead->set('createdOpportunityId', $opportunity->id); + } + if (!empty($recordsData->Contact)) { + $contact = $entityManager->getEntity('Contact'); + $contact->set(get_object_vars($recordsData->Contact)); + if (isset($account)) { + $contact->set('accountId', $account->id); + } + $entityManager->saveEntity($contact); + if (isset($opportunity)) { + $entityManager->getRepository('Contact')->relate($contact, 'opportunities', $opportunity); + } + $lead->set('createdContactId', $contact->id); + } - $lead->set('status', 'Converted'); - $entityManager->saveEntity($lead); - - if ($meetings = $lead->get('meetings')) { - foreach ($meetings as $meeting) { - if (!empty($contact)) { - $entityManager->getRepository('Meeting')->relate($meeting, 'contacts', $contact); - } - - if (!empty($opportunity)) { - $meeting->set('parentId', $opportunity->id); - $meeting->set('parentType', 'Opportunity'); - $entityManager->saveEntity($meeting); - } else if (!empty($account)) { - $meeting->set('parentId', $account->id); - $meeting->set('parentType', 'Account'); - $entityManager->saveEntity($meeting); - } - } - } - if ($calls = $lead->get('calls')) { - foreach ($calls as $call) { - if (!empty($contact)) { - $entityManager->getRepository('Call')->relate($call, 'contacts', $contact); - } - if (!empty($opportunity)) { - $call->set('parentId', $opportunity->id); - $call->set('parentType', 'Opportunity'); - $entityManager->saveEntity($call); - } else if (!empty($account)) { - $call->set('parentId', $account->id); - $call->set('parentType', 'Account'); - $entityManager->saveEntity($call); - } - } - } + $lead->set('status', 'Converted'); + $entityManager->saveEntity($lead); + + if ($meetings = $lead->get('meetings')) { + foreach ($meetings as $meeting) { + if (!empty($contact)) { + $entityManager->getRepository('Meeting')->relate($meeting, 'contacts', $contact); + } + + if (!empty($opportunity)) { + $meeting->set('parentId', $opportunity->id); + $meeting->set('parentType', 'Opportunity'); + $entityManager->saveEntity($meeting); + } else if (!empty($account)) { + $meeting->set('parentId', $account->id); + $meeting->set('parentType', 'Account'); + $entityManager->saveEntity($meeting); + } + } + } + if ($calls = $lead->get('calls')) { + foreach ($calls as $call) { + if (!empty($contact)) { + $entityManager->getRepository('Call')->relate($call, 'contacts', $contact); + } + if (!empty($opportunity)) { + $call->set('parentId', $opportunity->id); + $call->set('parentType', 'Opportunity'); + $entityManager->saveEntity($call); + } else if (!empty($account)) { + $call->set('parentId', $account->id); + $call->set('parentType', 'Account'); + $entityManager->saveEntity($call); + } + } + } - return $lead; - } + return $lead; + } } diff --git a/application/Espo/Modules/Crm/Services/Meeting.php b/application/Espo/Modules/Crm/Services/Meeting.php index f0ce9899ad..00bd114fc5 100644 --- a/application/Espo/Modules/Crm/Services/Meeting.php +++ b/application/Espo/Modules/Crm/Services/Meeting.php @@ -30,80 +30,80 @@ use \Espo\Core\Exceptions\Forbidden; class Meeting extends \Espo\Services\Record { - protected function init() - { - $this->dependencies[] = 'mailSender'; - $this->dependencies[] = 'preferences'; - $this->dependencies[] = 'language'; - $this->dependencies[] = 'dateTime'; - } + protected function init() + { + $this->dependencies[] = 'mailSender'; + $this->dependencies[] = 'preferences'; + $this->dependencies[] = 'language'; + $this->dependencies[] = 'dateTime'; + } - protected function getMailSender() - { - return $this->injections['mailSender']; - } + protected function getMailSender() + { + return $this->injections['mailSender']; + } - protected function getPreferences() - { - return $this->injections['preferences']; - } + protected function getPreferences() + { + return $this->injections['preferences']; + } - protected function getLanguage() - { - return $this->injections['language']; - } + protected function getLanguage() + { + return $this->injections['language']; + } - protected function getDateTime() - { - return $this->injections['dateTime']; - } - - protected function getInvitationManager() - { - return new Invitations($this->getEntityManager(), $this->getMailSender(), $this->getConfig(), $this->getDateTime(), $this->getLanguage()); - } + protected function getDateTime() + { + return $this->injections['dateTime']; + } + + protected function getInvitationManager() + { + return new Invitations($this->getEntityManager(), $this->getMailSender(), $this->getConfig(), $this->getDateTime(), $this->getLanguage()); + } - public function sendInvitations(Entity $entity) - { - $invitationManager = $this->getInvitationManager(); - - $users = $entity->get('users'); - foreach ($users as $user) { - $invitationManager->sendInvitation($entity, $user, 'users'); - } + public function sendInvitations(Entity $entity) + { + $invitationManager = $this->getInvitationManager(); + + $users = $entity->get('users'); + foreach ($users as $user) { + $invitationManager->sendInvitation($entity, $user, 'users'); + } - $contacts = $entity->get('contacts'); - foreach ($contacts as $contact) { - $invitationManager->sendInvitation($entity, $contact, 'contacts'); - } + $contacts = $entity->get('contacts'); + foreach ($contacts as $contact) { + $invitationManager->sendInvitation($entity, $contact, 'contacts'); + } - $leads = $entity->get('leads'); - foreach ($leads as $lead) { - $invitationManager->sendInvitation($entity, $lead, 'leads'); - } + $leads = $entity->get('leads'); + foreach ($leads as $lead) { + $invitationManager->sendInvitation($entity, $lead, 'leads'); + } - return true; - } + return true; + } - protected function storeEntity(Entity $entity) - { - $assignedUserId = $entity->get('assignedUserId'); - if ($assignedUserId && $entity->has('usersIds')) { - $usersIds = $entity->get('usersIds'); - if (!is_array($usersIds)) { - $usersIds = array(); - } - if (!in_array($assignedUserId, $usersIds)) { - $usersIds[] = $assignedUserId; - $entity->set('usersIds', $usersIds); - $hash = $entity->get('usersNames'); - if ($hash instanceof \stdClass) { - $hash->assignedUserId = $entity->get('assignedUserName'); - $entity->set('usersNames', $hash); - } - } - } - return parent::storeEntity($entity); - } + protected function storeEntity(Entity $entity) + { + $assignedUserId = $entity->get('assignedUserId'); + if ($assignedUserId && $entity->has('usersIds')) { + $usersIds = $entity->get('usersIds'); + if (!is_array($usersIds)) { + $usersIds = array(); + } + if (!in_array($assignedUserId, $usersIds)) { + $usersIds[] = $assignedUserId; + $entity->set('usersIds', $usersIds); + $hash = $entity->get('usersNames'); + if ($hash instanceof \stdClass) { + $hash->assignedUserId = $entity->get('assignedUserName'); + $entity->set('usersNames', $hash); + } + } + } + return parent::storeEntity($entity); + } } diff --git a/application/Espo/Modules/Crm/Services/Opportunity.php b/application/Espo/Modules/Crm/Services/Opportunity.php index 73af9e08b3..b7e1f827d8 100644 --- a/application/Espo/Modules/Crm/Services/Opportunity.php +++ b/application/Espo/Modules/Crm/Services/Opportunity.php @@ -29,130 +29,130 @@ use \Espo\Core\Exceptions\Forbidden; class Opportunity extends \Espo\Services\Record { - public function reportSalesPipeline($dateFrom, $dateTo) - { - $pdo = $this->getEntityManager()->getPDO(); + public function reportSalesPipeline($dateFrom, $dateTo) + { + $pdo = $this->getEntityManager()->getPDO(); - $options = $this->getMetadata()->get('entityDefs.Opportunity.fields.stage.options'); + $options = $this->getMetadata()->get('entityDefs.Opportunity.fields.stage.options'); - $sql = " - SELECT opportunity.stage AS `stage`, SUM(opportunity.amount * currency.rate) as `amount` - FROM opportunity - JOIN currency ON currency.id = opportunity.amount_currency - WHERE - opportunity.deleted = 0 AND - opportunity.close_date >= ".$pdo->quote($dateFrom)." AND - opportunity.close_date < ".$pdo->quote($dateTo)." AND - opportunity.stage <> 'Closed Lost' - GROUP BY opportunity.stage - ORDER BY FIELD(opportunity.stage, '".implode("','", $options)."') - "; + $sql = " + SELECT opportunity.stage AS `stage`, SUM(opportunity.amount * currency.rate) as `amount` + FROM opportunity + JOIN currency ON currency.id = opportunity.amount_currency + WHERE + opportunity.deleted = 0 AND + opportunity.close_date >= ".$pdo->quote($dateFrom)." AND + opportunity.close_date < ".$pdo->quote($dateTo)." AND + opportunity.stage <> 'Closed Lost' + GROUP BY opportunity.stage + ORDER BY FIELD(opportunity.stage, '".implode("','", $options)."') + "; - $sth = $pdo->prepare($sql); - $sth->execute(); + $sth = $pdo->prepare($sql); + $sth->execute(); - $rows = $sth->fetchAll(\PDO::FETCH_ASSOC); + $rows = $sth->fetchAll(\PDO::FETCH_ASSOC); - $result = array(); - foreach ($rows as $row) { - $result[$row['stage']] = floatval($row['amount']); - } + $result = array(); + foreach ($rows as $row) { + $result[$row['stage']] = floatval($row['amount']); + } - return $result; - } + return $result; + } - public function reportByLeadSource($dateFrom, $dateTo) - { - $pdo = $this->getEntityManager()->getPDO(); + public function reportByLeadSource($dateFrom, $dateTo) + { + $pdo = $this->getEntityManager()->getPDO(); - $sql = " - SELECT opportunity.lead_source AS `leadSource`, SUM(opportunity.amount * currency.rate * opportunity.probability / 100) as `amount` - FROM opportunity - JOIN currency ON currency.id = opportunity.amount_currency - WHERE - opportunity.deleted = 0 AND - opportunity.close_date >= ".$pdo->quote($dateFrom)." AND - opportunity.close_date < ".$pdo->quote($dateTo)." AND - opportunity.stage <> 'Closed Lost' AND - opportunity.lead_source <> '' - GROUP BY opportunity.lead_source - "; + $sql = " + SELECT opportunity.lead_source AS `leadSource`, SUM(opportunity.amount * currency.rate * opportunity.probability / 100) as `amount` + FROM opportunity + JOIN currency ON currency.id = opportunity.amount_currency + WHERE + opportunity.deleted = 0 AND + opportunity.close_date >= ".$pdo->quote($dateFrom)." AND + opportunity.close_date < ".$pdo->quote($dateTo)." AND + opportunity.stage <> 'Closed Lost' AND + opportunity.lead_source <> '' + GROUP BY opportunity.lead_source + "; - $sth = $pdo->prepare($sql); - $sth->execute(); + $sth = $pdo->prepare($sql); + $sth->execute(); - $rows = $sth->fetchAll(\PDO::FETCH_ASSOC); + $rows = $sth->fetchAll(\PDO::FETCH_ASSOC); - $result = array(); - foreach ($rows as $row) { - $result[$row['leadSource']] = floatval($row['amount']); - } + $result = array(); + foreach ($rows as $row) { + $result[$row['leadSource']] = floatval($row['amount']); + } - return $result; - } - - public function reportByStage($dateFrom, $dateTo) - { - $pdo = $this->getEntityManager()->getPDO(); - - $options = $this->getMetadata()->get('entityDefs.Opportunity.fields.stage.options'); - - $sql = " - SELECT opportunity.stage AS `stage`, SUM(opportunity.amount * currency.rate) as `amount` - FROM opportunity - JOIN currency ON currency.id = opportunity.amount_currency - WHERE - opportunity.deleted = 0 AND - opportunity.close_date >= ".$pdo->quote($dateFrom)." AND - opportunity.close_date < ".$pdo->quote($dateTo)." AND - opportunity.stage <> 'Closed Lost' - GROUP BY opportunity.stage - ORDER BY FIELD(opportunity.stage, '".implode("','", $options)."') - "; - - $sth = $pdo->prepare($sql); - $sth->execute(); - - $rows = $sth->fetchAll(\PDO::FETCH_ASSOC); - - $result = array(); - foreach ($rows as $row) { - $result[$row['stage']] = floatval($row['amount']); - } - - return $result; - } - - public function reportSalesByMonth($dateFrom, $dateTo) - { - $pdo = $this->getEntityManager()->getPDO(); - - $sql = " - SELECT DATE_FORMAT(opportunity.close_date, '%Y-%m') AS `month`, SUM(opportunity.amount * currency.rate) as `amount` - FROM opportunity - JOIN currency ON currency.id = opportunity.amount_currency - WHERE - opportunity.deleted = 0 AND - opportunity.close_date >= ".$pdo->quote($dateFrom)." AND - opportunity.close_date < ".$pdo->quote($dateTo)." AND - opportunity.stage = 'Closed Won' - - GROUP BY DATE_FORMAT(opportunity.close_date, '%Y-%m') - ORDER BY opportunity.close_date - "; - - $sth = $pdo->prepare($sql); - $sth->execute(); - - $rows = $sth->fetchAll(\PDO::FETCH_ASSOC); - - $result = array(); - foreach ($rows as $row) { - $result[$row['month']] = floatval($row['amount']); - } - - return $result; - } + return $result; + } + + public function reportByStage($dateFrom, $dateTo) + { + $pdo = $this->getEntityManager()->getPDO(); + + $options = $this->getMetadata()->get('entityDefs.Opportunity.fields.stage.options'); + + $sql = " + SELECT opportunity.stage AS `stage`, SUM(opportunity.amount * currency.rate) as `amount` + FROM opportunity + JOIN currency ON currency.id = opportunity.amount_currency + WHERE + opportunity.deleted = 0 AND + opportunity.close_date >= ".$pdo->quote($dateFrom)." AND + opportunity.close_date < ".$pdo->quote($dateTo)." AND + opportunity.stage <> 'Closed Lost' + GROUP BY opportunity.stage + ORDER BY FIELD(opportunity.stage, '".implode("','", $options)."') + "; + + $sth = $pdo->prepare($sql); + $sth->execute(); + + $rows = $sth->fetchAll(\PDO::FETCH_ASSOC); + + $result = array(); + foreach ($rows as $row) { + $result[$row['stage']] = floatval($row['amount']); + } + + return $result; + } + + public function reportSalesByMonth($dateFrom, $dateTo) + { + $pdo = $this->getEntityManager()->getPDO(); + + $sql = " + SELECT DATE_FORMAT(opportunity.close_date, '%Y-%m') AS `month`, SUM(opportunity.amount * currency.rate) as `amount` + FROM opportunity + JOIN currency ON currency.id = opportunity.amount_currency + WHERE + opportunity.deleted = 0 AND + opportunity.close_date >= ".$pdo->quote($dateFrom)." AND + opportunity.close_date < ".$pdo->quote($dateTo)." AND + opportunity.stage = 'Closed Won' + + GROUP BY DATE_FORMAT(opportunity.close_date, '%Y-%m') + ORDER BY opportunity.close_date + "; + + $sth = $pdo->prepare($sql); + $sth->execute(); + + $rows = $sth->fetchAll(\PDO::FETCH_ASSOC); + + $result = array(); + foreach ($rows as $row) { + $result[$row['month']] = floatval($row['amount']); + } + + return $result; + } } diff --git a/application/Espo/Modules/Crm/Services/Target.php b/application/Espo/Modules/Crm/Services/Target.php index 1c61110783..7885333c3b 100644 --- a/application/Espo/Modules/Crm/Services/Target.php +++ b/application/Espo/Modules/Crm/Services/Target.php @@ -27,34 +27,34 @@ use \Espo\Core\Exceptions\Forbidden; use \Espo\ORM\Entity; class Target extends \Espo\Services\Record -{ - protected function getDuplicateWhereClause(Entity $entity) - { - return array( - 'firstName' => $entity->get('firstName'), - 'lastName' => $entity->get('lastName'), - ); - } - - public function convert($id) - { - $entityManager = $this->getEntityManager(); - $target = $this->getEntity($id); - - if (!$this->getAcl()->check($target, 'delete')) { - throw new Forbidden(); - } - if (!$this->getAcl()->check('Lead', 'read')) { - throw new Forbidden(); - } - - $lead = $entityManager->getEntity('Lead'); - $lead->set($target->toArray()); - - $entityManager->removeEntity($target); - $entityManager->saveEntity($lead); +{ + protected function getDuplicateWhereClause(Entity $entity) + { + return array( + 'firstName' => $entity->get('firstName'), + 'lastName' => $entity->get('lastName'), + ); + } + + public function convert($id) + { + $entityManager = $this->getEntityManager(); + $target = $this->getEntity($id); + + if (!$this->getAcl()->check($target, 'delete')) { + throw new Forbidden(); + } + if (!$this->getAcl()->check('Lead', 'read')) { + throw new Forbidden(); + } + + $lead = $entityManager->getEntity('Lead'); + $lead->set($target->toArray()); + + $entityManager->removeEntity($target); + $entityManager->saveEntity($lead); - return $lead; - } + return $lead; + } } diff --git a/application/Espo/ORM/DB/IMapper.php b/application/Espo/ORM/DB/IMapper.php index 5c9f64ecb5..3ef559a279 100644 --- a/application/Espo/ORM/DB/IMapper.php +++ b/application/Espo/ORM/DB/IMapper.php @@ -27,160 +27,160 @@ use Espo\ORM\Classes\EntityFactory; interface IMapper { - /** - * Selects bean by id. - * - * @param IEntity $entity - * @param string $id Id of the needed bean - * @return IEntity $entity - */ - function selectById(IEntity $entity, $id); - - /** - * Selects list of beans according to given parameters. - * - * @param IEntity $entity - * @param array $params Parameters (whereClause, offset, limit, orderBy, order, customWhere, joins, distinct) - * @return array Array of beans - */ - function select(IEntity $entity, $params); + /** + * Selects bean by id. + * + * @param IEntity $entity + * @param string $id Id of the needed bean + * @return IEntity $entity + */ + function selectById(IEntity $entity, $id); + + /** + * Selects list of beans according to given parameters. + * + * @param IEntity $entity + * @param array $params Parameters (whereClause, offset, limit, orderBy, order, customWhere, joins, distinct) + * @return array Array of beans + */ + function select(IEntity $entity, $params); - /** - * Invokes aggregate function and returns a value. - * - * @param IEntity $entity - * @param array $params Parameters (whereClause, joins, distinct, customWhere, customJoin) - * @param string $aggregation Aggregate function (COUNT, MAX, MIN, SUM, AVG) - * @param string $aggregationBy Field to aggregate - * @param bool $deleted True to consider records marked as deleted either. - * @return mixed Result of the aggregation - */ - function aggregate(IEntity $entity, $params, $aggregation, $aggregationBy, $deleted); - - /** - * Returns count of records according to given parameters. - * - * @param IEntity $entity - * @param array $params Parameters (ordering, and limitig are not used) - * @return int Count of record - */ - function count(IEntity $entity, $params); - - /** - * Returns max value of the field in the select according to given parameters. - * - * @param IEntity $entity - * @param array $params Parameters - * @param string $field Needed field. - * @param bool $deleted True to consider records marked as deleted either. - * @return mixed Max value - */ - function max(IEntity $entity, $params, $field, $deleted); - - /** - * Returns min value of the field in the select according to given parameters. - * - * @param IEntity $entity - * @param array $params Parameters - * @param string $field Needed field. - * @param bool $deleted True to consider records marked as deleted either. - * @return mixed Min value - */ - function min(IEntity $entity, $params, $field, $deleted); - - /** - * Returns sum value of the field in the select according to given parameters. - * - * @param IEntity $entity - * @param array $params Parameters - * @param string $field Needed field. - * @param bool $deleted True to consider records marked as deleted either. - * @return mixed Sum value - */ - function sum(IEntity $entity, $params); - - /** - * Selects related bean or list of beans. - * - * @param IEntity $entity - * @param string $relName Relation name - * @param array $params (whereClause, offset, limit, orderBy, order, customWhere) - * @param bool $totalCount used by DB::countRelated to make this method return total count - * @return array List of beans or total count if $totalCount was passed as true - */ - function selectRelated(IEntity $entity, $relName, $params, $totalCount); - - /** - * Returns count of related records according to given parameters. - * - * @param IEntity $entity - * @param string $relName Relation name - * @param array $params (whereClause, customWhere) - * @return int Count of records - */ - function countRelated(IEntity $entity, $relName, $params); - - /** - * Links the bean with another one. - * - * @param IEntity $entity - * @param string $relName Relation name - * @param string $id Id of the foreign record. - * @return bool True if success - */ - function addRelation(IEntity $entity, $relName, $id); - - /** - * Removes relation of bean with certain record. - * - * @param IEntity $entity - * @param string $relName Relation name - * @param string $id Id of the foreign record. - * @return bool True if success - */ - function removeRelation(IEntity $entity, $relName, $id); - - /** - * Removes all relations of bean of specified relation name. - * - * @param IEntity $entity - * @param string $relName Relation name - * @return bool True if success - */ - function removeAllRelations(IEntity $entity, $relName); - - /** - * Insert the bean into db. - * - * @param IEntity $entity - * @return bool True if success - */ - function insert(IEntity $entity); - - /** - * Updates the bean in db. - * - * @param IEntity $entity - * @return bool True if success - */ - function update(IEntity $entity); - - - /** - * Deletes the bean. - * (Marks as deleted) - * - * @param IEntity $entity - * @return bool True if success - */ - function delete(IEntity $entity); - - /** - * Sets class name of a model collection that will be returned by operations such as select. - * - * @param string $collectionClass Class name of a model collection. - */ - function setCollectionClass($collectionClass); + /** + * Invokes aggregate function and returns a value. + * + * @param IEntity $entity + * @param array $params Parameters (whereClause, joins, distinct, customWhere, customJoin) + * @param string $aggregation Aggregate function (COUNT, MAX, MIN, SUM, AVG) + * @param string $aggregationBy Field to aggregate + * @param bool $deleted True to consider records marked as deleted either. + * @return mixed Result of the aggregation + */ + function aggregate(IEntity $entity, $params, $aggregation, $aggregationBy, $deleted); + + /** + * Returns count of records according to given parameters. + * + * @param IEntity $entity + * @param array $params Parameters (ordering, and limitig are not used) + * @return int Count of record + */ + function count(IEntity $entity, $params); + + /** + * Returns max value of the field in the select according to given parameters. + * + * @param IEntity $entity + * @param array $params Parameters + * @param string $field Needed field. + * @param bool $deleted True to consider records marked as deleted either. + * @return mixed Max value + */ + function max(IEntity $entity, $params, $field, $deleted); + + /** + * Returns min value of the field in the select according to given parameters. + * + * @param IEntity $entity + * @param array $params Parameters + * @param string $field Needed field. + * @param bool $deleted True to consider records marked as deleted either. + * @return mixed Min value + */ + function min(IEntity $entity, $params, $field, $deleted); + + /** + * Returns sum value of the field in the select according to given parameters. + * + * @param IEntity $entity + * @param array $params Parameters + * @param string $field Needed field. + * @param bool $deleted True to consider records marked as deleted either. + * @return mixed Sum value + */ + function sum(IEntity $entity, $params); + + /** + * Selects related bean or list of beans. + * + * @param IEntity $entity + * @param string $relName Relation name + * @param array $params (whereClause, offset, limit, orderBy, order, customWhere) + * @param bool $totalCount used by DB::countRelated to make this method return total count + * @return array List of beans or total count if $totalCount was passed as true + */ + function selectRelated(IEntity $entity, $relName, $params, $totalCount); + + /** + * Returns count of related records according to given parameters. + * + * @param IEntity $entity + * @param string $relName Relation name + * @param array $params (whereClause, customWhere) + * @return int Count of records + */ + function countRelated(IEntity $entity, $relName, $params); + + /** + * Links the bean with another one. + * + * @param IEntity $entity + * @param string $relName Relation name + * @param string $id Id of the foreign record. + * @return bool True if success + */ + function addRelation(IEntity $entity, $relName, $id); + + /** + * Removes relation of bean with certain record. + * + * @param IEntity $entity + * @param string $relName Relation name + * @param string $id Id of the foreign record. + * @return bool True if success + */ + function removeRelation(IEntity $entity, $relName, $id); + + /** + * Removes all relations of bean of specified relation name. + * + * @param IEntity $entity + * @param string $relName Relation name + * @return bool True if success + */ + function removeAllRelations(IEntity $entity, $relName); + + /** + * Insert the bean into db. + * + * @param IEntity $entity + * @return bool True if success + */ + function insert(IEntity $entity); + + /** + * Updates the bean in db. + * + * @param IEntity $entity + * @return bool True if success + */ + function update(IEntity $entity); + + + /** + * Deletes the bean. + * (Marks as deleted) + * + * @param IEntity $entity + * @return bool True if success + */ + function delete(IEntity $entity); + + /** + * Sets class name of a model collection that will be returned by operations such as select. + * + * @param string $collectionClass Class name of a model collection. + */ + function setCollectionClass($collectionClass); } diff --git a/application/Espo/ORM/DB/Mapper.php b/application/Espo/ORM/DB/Mapper.php index a052918ae9..ee9386934e 100644 --- a/application/Espo/ORM/DB/Mapper.php +++ b/application/Espo/ORM/DB/Mapper.php @@ -34,768 +34,768 @@ use PDO; */ abstract class Mapper implements IMapper { - public $pdo; - - protected $entityFactroy; - - protected $query; - - protected $fieldsMapCache = array(); - protected $aliasesCache = array(); - - protected $returnCollection = true; - - protected $collectionClass = "\\Espo\\ORM\\EntityCollection"; - - protected static $sqlOperators = array( - 'OR', - 'AND', - ); - - protected static $comparisonOperators = array( - '!=' => '<>', - '*' => 'LIKE', - '>=' => '>=', - '<=' => '<=', - '>' => '>', - '<' => '<', - '=' => '=', - ); - - protected static $selectParamList = array( - 'offset', - 'limit', - 'order', - 'orderBy', - 'customWhere', - 'customJoin', - 'joins', - 'leftJoins', - 'distinct', - 'joinConditions', - ); - - public function __construct(PDO $pdo, \Espo\ORM\EntityFactory $entityFactory, Query $query) { - $this->pdo = $pdo; - $this->query = $query; - $this->entityFactory = $entityFactory; - } - - public function selectById(IEntity $entity, $id, $params = array()) - { - if (!array_key_exists('whereClause', $params)) { - $params['whereClause'] = array(); - } - - $params['whereClause']['id'] = $id; - $params['whereClause']['deleted'] = 0; - - $sql = $this->query->createSelectQuery($entity->getEntityName(), $params); - - $ps = $this->pdo->query($sql); - - if ($ps) { - foreach ($ps as $row) { - $entity = $this->fromRow($entity, $row); - return true; - } - } - return false; - } - - public function count(IEntity $entity, $params = array()) - { - return $this->aggregate($entity, $params, 'COUNT', 'id'); - } - - public function max(IEntity $entity, $params = array(), $field, $deleted = false) - { - return $this->aggregate($entity, $params, 'MAX', $field, true); - } - - public function min(IEntity $entity, $params = array(), $field, $deleted = false) - { - return $this->aggregate($entity, $params, 'MIN', $field, true); - } - - public function sum(IEntity $entity, $params = array()) - { - return $this->aggregate($entity, $params, 'SUM', 'id'); - } - - public function select(IEntity $entity, $params = array()) - { - $sql = $this->query->createSelectQuery($entity->getEntityName(), $params); - - $dataArr = array(); - $ps = $this->pdo->query($sql); - if ($ps) { - $dataArr = $ps->fetchAll(); - } - - if ($this->returnCollection) { - $collectionClass = $this->collectionClass; - $entityArr = new $collectionClass($dataArr, $entity->getEntityName(), $this->entityFactory); - return $entityArr; - } else { - return $dataArr; - } - } - - public function aggregate(IEntity $entity, $params = array(), $aggregation, $aggregationBy, $deleted = false) - { - if (empty($aggregation) || !isset($entity->fields[$aggregationBy])) { - return false; - } - - $params['aggregation'] = $aggregation; - $params['aggregationBy'] = $aggregationBy; - - $sql = $this->query->createSelectQuery($entity->getEntityName(), $params, $deleted); - - $ps = $this->pdo->query($sql); - - if ($ps) { - foreach ($ps as $row) { - return $row['AggregateValue']; - } - } - return false; - } - - public function selectRelated(IEntity $entity, $relationName, $params = array(), $totalCount = false) - { - $relOpt = $entity->relations[$relationName]; - - if (!isset($relOpt['entity']) || !isset($relOpt['type'])) { - throw new \LogicException("Not appropriate defenition for relationship {$relationName} in " . $entity->getEntityName() . " entity"); - } - - $relEntityName = (!empty($relOpt['class'])) ? $relOpt['class'] : $relOpt['entity']; - $relEntity = $this->entityFactory->create($relEntityName); - - if (!$relEntity) { - return null; - } - - if ($totalCount) { - $params['aggregation'] = 'COUNT'; - $params['aggregationBy'] = 'id'; - } - - - if (empty($params['whereClause'])) { - $params['whereClause'] = array(); - } - - $relType = $relOpt['type']; - - $keySet = $this->query->getKeys($entity, $relationName); - - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - - switch ($relType) { - - case IEntity::BELONGS_TO: - $params['whereClause'][$foreignKey] = $entity->get($key); - $params['offset'] = 0; - $params['limit'] = 1; - - $sql = $this->query->createSelectQuery($relEntity->getEntityName(), $params); - - $ps = $this->pdo->query($sql); - - if ($ps) { - foreach ($ps as $row) { - if (!$totalCount) { - $relEntity = $this->fromRow($relEntity, $row); - return $relEntity; - } else { - return $row['AggregateValue']; - } - } - } - break; - - case IEntity::HAS_MANY: - case IEntity::HAS_CHILDREN: - - $params['whereClause'][$foreignKey] = $entity->get($key); - - if ($relType == IEntity::HAS_CHILDREN) { - $foreignType = $keySet['foreignType']; - $params['whereClause'][$foreignType] = $entity->getEntityName(); - } - - $dataArr = array(); - - $sql = $this->query->createSelectQuery($relEntity->getEntityName(), $params); - - $ps = $this->pdo->query($sql); - if ($ps) { - if (!$totalCount) { - $dataArr = $ps->fetchAll(); - - } else { - foreach ($ps as $row) { - return $row['AggregateValue']; - } - } - } - if ($this->returnCollection) { - $collectionClass = $this->collectionClass; - return new $collectionClass($dataArr, $relEntity->getEntityName(), $this->entityFactory); - } else { - return $dataArr; - } - break; - - case IEntity::MANY_MANY: - - $MMJoinPart = $this->getMMJoin($entity, $relationName, $keySet); - - if (empty($params['customJoin'])) { - $params['customJoin'] = ''; - } else { - $params['customJoin'] .= ' '; - } - $params['customJoin'] .= $MMJoinPart; - - - $params['relationName'] = $relOpt['relationName']; - - // TODO total - - - $sql = $this->query->createSelectQuery($relEntity->getEntityName(), $params); - - $dataArr = array(); - - - $ps = $this->pdo->query($sql); - if ($ps) { - if (!$totalCount) { - $dataArr = $ps->fetchAll(); - - } else { - foreach ($ps as $row) { - return $row['AggregateValue']; - } - } - } - if ($this->returnCollection) { - $collectionClass = $this->collectionClass; - return new $collectionClass($dataArr, $relEntity->getEntityName(), $this->entityFactory); - } else { - return $dataArr; - } - break; - } - - return false; - } - - - public function countRelated(IEntity $entity, $relationName, $params = array()) - { - return $this->selectRelated($entity, $relationName, $params, true); - } - - public function relate(IEntity $entityFrom, $relationName, IEntity $entityTo, $data = null) - { - $this->addRelation($entityFrom, $relationName, null, $entityTo, $data); - } - - public function unrelate(IEntity $entityFrom, $relationName, IEntity $entityTo) - { - $this->removeRelation($entityFrom, $relationName, null, false, $entityTo); - } - - public function updateRelation(IEntity $entity, $relationName, $id = null, array $columnData) - { - if (empty($id) || empty($relationName)) { - return false; - } - - $relOpt = $entity->relations[$relationName]; - $keySet = $this->query->getKeys($entity, $relationName); - - $relType = $relOpt['type']; - - - switch ($relType) { - case IEntity::MANY_MANY: - $relTable = $this->toDb($relOpt['relationName']); - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - $nearKey = $keySet['nearKey']; - $distantKey = $keySet['distantKey']; - - $setArr = array(); - foreach ($columnData as $column => $value) { - $setArr[] = $this->toDb($column) . " = " . $this->pdo->quote($value); - } - if (empty($setArr)) { - return true; - } - $setPart = implode(', ', $setArr); - - $wherePart = - $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->id) . " - AND " . $this->toDb($distantKey) . " = " . $this->pdo->quote($id) . " AND deleted = 0 - "; - - if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { - foreach ($relOpt['conditions'] as $f => $v) { - $wherePart .= " AND " . $this->toDb($f) . " = " . $this->pdo->quote($v); - } - } - - $sql = $this->composeUpdateQuery($relTable, $setPart, $wherePart); - - if ($this->pdo->query($sql)) { - return true; - } - } - } - - public function addRelation(IEntity $entity, $relationName, $id = null, $relEntity = null, $data = null) - { - if (!is_null($relEntity)) { - $id = $relEntity->id; - } - - if (empty($id) || empty($relationName)) { - return false; - } - - $relOpt = $entity->relations[$relationName]; - - if (!isset($relOpt['entity']) || !isset($relOpt['type'])) { - throw new \LogicException("Not appropriate defenition for relationship {$relationName} in " . $entity->getEntityName() . " entity"); - } - - $relType = $relOpt['type']; - - $className = (!empty($relOpt['class'])) ? $relOpt['class'] : $relOpt['entity']; - - if (is_null($relEntity)) { - $relEntity = $this->entityFactory->create($className); - if (!$relEntity) { - return null; - } - $relEntity->id = $id; - } - - $keySet = $this->query->getKeys($entity, $relationName); - - switch ($relType) { - case IEntity::BELONGS_TO: - case IEntity::HAS_ONE: - return false; - break; - - case IEntity::HAS_CHILDREN: - case IEntity::HAS_MANY: - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - - if ($this->count($relEntity, array('whereClause' => array('id' => $id))) > 0) { - - $setPart = $this->toDb($foreignKey) . " = " . $this->pdo->quote($entity->get($key)); - - if ($relType == IEntity::HAS_CHILDREN) { - $foreignType = $keySet['foreignType']; - $setPart .= ", " . $this->toDb($foreignType) . " = " . $this->pdo->quote($entity->getEntityName()); - } - - $wherePart = $this->query->getWhere($relEntity, array('id' => $id, 'deleted' => 0)); - $sql = $this->composeUpdateQuery($this->toDb($relEntity->getEntityName()), $setPart, $wherePart); - - if ($this->pdo->query($sql)) { - return true; - } - } else { - return false; - } - break; - - case IEntity::MANY_MANY: - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - $nearKey = $keySet['nearKey']; - $distantKey = $keySet['distantKey']; - - if ($this->count($relEntity, array('whereClause' => array('id' => $id))) > 0) { - $relTable = $this->toDb($relOpt['relationName']); - - $wherePart = - $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->id) . " ". - "AND " . $this->toDb($distantKey) . " = " . $this->pdo->quote($relEntity->id); - if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { - foreach ($relOpt['conditions'] as $f => $v) { - $wherePart .= " AND " . $this->toDb($f) . " = " . $this->pdo->quote($v); - } - } - - $sql = $this->query->composeSelectQuery($relTable, '*', '', $wherePart); - - $ps = $this->pdo->query($sql); - - if ($ps->rowCount() == 0) { - $fieldsPart = $this->toDb($nearKey) . ", " . $this->toDb($distantKey); - $valuesPart = $this->pdo->quote($entity->id) . ", " . $this->pdo->quote($relEntity->id); - - if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { - foreach ($relOpt['conditions'] as $f => $v) { - $fieldsPart .= ", " . $this->toDb($f); - $valuesPart .= ", " . $this->pdo->quote($v); - } - } - - if (!empty($data) && is_array($data)) { - foreach ($data as $column => $columnValue) { - $fieldsPart .= ", " . $this->toDb($column); - $valuesPart .= ", " . $this->pdo->quote($columnValue); - } - } - - $sql = $this->composeInsertQuery($relTable, $fieldsPart, $valuesPart); - - if ($this->pdo->query($sql)) { - return true; - } - } else { - $setPart = 'deleted = 0'; - - if (!empty($data) && is_array($data)) { - $setArr = array(); - foreach ($data as $column => $value) { - $setArr[] = $this->toDb($column) . " = " . $this->pdo->quote($value); - } - $setPart .= ', ' . implode(', ', $setArr); - } - - $wherePart = - $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->id) . " - AND " . $this->toDb($distantKey) . " = " . $this->pdo->quote($relEntity->id) . " - "; - - if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { - foreach ($relOpt['conditions'] as $f => $v) { - $wherePart .= " AND " . $this->toDb($f) . " = " . $this->pdo->quote($v); - } - } - - $sql = $this->composeUpdateQuery($relTable, $setPart, $wherePart); - if ($this->pdo->query($sql)) { - return true; - } - } - } else { - return false; - } - break; - } - } - - public function removeRelation(IEntity $entity, $relationName, $id = null, $all = false, IEntity $relEntity = null) - { - if (!is_null($relEntity)) { - $id = $relEntity->id; - } - - if (empty($id) && empty($all) || empty($relationName)) { - return false; - } - - $relOpt = $entity->relations[$relationName]; - - if (!isset($relOpt['entity']) || !isset($relOpt['type'])) { - throw new \LogicException("Not appropriate defenition for relationship {$relationName} in " . $entity->getEntityName() . " entity"); - } - - $relType = $relOpt['type']; - - $className = (!empty($relOpt['class'])) ? $relOpt['class'] : $relOpt['entity']; - - if (is_null($relEntity)) { - $relEntity = $this->entityFactory->create($className); - if (!$relEntity) { - return null; - } - $relEntity->id = $id; - } - - $keySet = $this->query->getKeys($entity, $relationName); - - switch ($relType) { - - case IEntity::BELONGS_TO: - /*$foreignKey = $keySet['foreignKey']; - $relEntity->$foreignKey = null; - $this-> - break;*/ - - case IEntity::HAS_ONE: - return false; - - - case IEntity::HAS_MANY: - case IEntity::HAS_CHILDREN: - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - - $setPart = $this->toDb($foreignKey) . " = " . "NULL"; - - $whereClause = array('deleted' => 0); - if (empty($all)) { - $whereClause['id'] = $id; - } else { - $whereClause[$foreignKey] = $entity->id; - } - - if ($relType == IEntity::HAS_CHILDREN) { - $foreignType = $keySet['foreignType']; - $whereClause[$foreignType] = $entity->getEntityName(); - } - - $wherePart = $this->query->getWhere($relEntity, $whereClause); - $sql = $this->composeUpdateQuery($this->toDb($relEntity->getEntityName()), $setPart, $wherePart); - if ($this->pdo->query($sql)) { - return true; - } - break; - - case IEntity::MANY_MANY: - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - $nearKey = $keySet['nearKey']; - $distantKey = $keySet['distantKey']; - - $relTable = $this->toDb($relOpt['relationName']); - - $setPart = 'deleted = 1'; - $wherePart = $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->id); - - - if (empty($all)) { - $wherePart .= " AND " . $this->toDb($distantKey) . " = " . $this->pdo->quote($id) . ""; - } - - if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { - foreach ($relOpt['conditions'] as $f => $v) { - $wherePart .= " AND " . $this->toDb($f) . " = " . $this->pdo->quote($v); - } - } - - $sql = $this->composeUpdateQuery($relTable, $setPart, $wherePart); - - if ($this->pdo->query($sql)) { - return true; - } - break; - } - } - - public function removeAllRelations(IEntity $entity, $relationName) - { - $this->removeRelation($entity, $relationName, null, true); - } - - protected function quote($value) - { - if (is_null($value)) { - return 'NULL'; - } else { - return $this->pdo->quote($value); - } - } - - public function insert(IEntity $entity) - { - $dataArr = $this->toArray($entity); - - $fieldArr = array(); - $valArr = array(); - foreach ($dataArr as $field => $value) { - $fieldArr[] = $this->toDb($field); - - $type = $entity->fields[$field]['type']; - - $value = $this->prepareValueForInsert($type, $value); - - $valArr[] = $this->quote($value); - } - $fieldsPart = "`" . implode("`, `", $fieldArr) . "`"; - $valuesPart = implode(", ", $valArr); - - $sql = $this->composeInsertQuery($this->toDb($entity->getEntityName()), $fieldsPart, $valuesPart); - - if ($this->pdo->query($sql)) { - return $entity->id; - } - - return false; - } - - public function update(IEntity $entity) - { - $dataArr = $this->toArray($entity); - - $setArr = array(); - foreach ($dataArr as $field => $value) { - if ($field == 'id') { - continue; - } - $type = $entity->fields[$field]['type']; - - if ($type == IEntity::FOREIGN) { - continue; - } - - if ($entity->getFetched($field) === $value && $type != IEntity::JSON_ARRAY && $type != IEntity::JSON_OBJECT) { - continue; - } - - $value = $this->prepareValueForInsert($type, $value); - - $setArr[] = "`" . $this->toDb($field) . "` = " . $this->quote($value); - } - if (count($setArr) == 0) { - return $entity->id; - } - - $setPart = implode(', ', $setArr); - $wherePart = $this->query->getWhere($entity, array('id' => $entity->id, 'deleted' => 0)); - - $sql = $this->composeUpdateQuery($this->toDb($entity->getEntityName()), $setPart, $wherePart); - - if ($this->pdo->query($sql)) { - return $entity->id; - } - - return false; - } - - protected function prepareValueForInsert($type, $value) { - if ($type == IEntity::JSON_ARRAY && is_array($value)) { - $value = json_encode($value); - } else if ($type == IEntity::JSON_OBJECT && (is_array($value) || $value instanceof \stdClass)) { - $value = json_encode($value); - } - - if (is_bool($value)) { - $value = (int) $value; - } - return $value; - } - - public function deleteFromDb($entityName, $id) - { - if (!empty($entityName) && !empty($id)) { - $table = $this->toDb($entityName); - $sql = "DELETE FROM `{$table}` WHERE id = " . $this->quote($id); - if ($this->pdo->query($sql)) { - return true; - } - } - } - - public function delete(IEntity $entity) - { - $entity->set('deleted', true); - return $this->update($entity); - } - - protected function toArray(IEntity $entity, $onlyStorable = true) - { - $arr = array(); - foreach ($entity->fields as $field => $fieldDefs) { - if ($entity->has($field)) { - if ($onlyStorable) { - if (!empty($fieldDefs['notStorable']) || isset($fieldDefs['source']) && $fieldDefs['source'] != 'db') - continue; - if ($fieldDefs['type'] == IEntity::FOREIGN) - continue; - } - $arr[$field] = $entity->get($field); - } - } - return $arr; - } - - protected function fromRow(IEntity $entity, $data) - { - $entity->set($data); - return $entity; - } - - protected function getMMJoin(IEntity $entity, $relationName, $keySet = false) - { - $relOpt = $entity->relations[$relationName]; - - if (empty($keySet)) { - $keySet = $this->query->getKeys($entity, $relationName); - } - - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - $nearKey = $keySet['nearKey']; - $distantKey = $keySet['distantKey']; - - $relTable = $this->toDb($relOpt['relationName']); - $distantTable = $this->toDb($relOpt['entity']); - - $join = - "JOIN `{$relTable}` ON {$distantTable}." . $this->toDb($foreignKey) . " = {$relTable}." . $this->toDb($distantKey) - . " AND " - . "{$relTable}." . $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->get($key)) - . " AND " - . "{$relTable}.deleted = " . $this->pdo->quote(0) . ""; - - if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { - foreach ($relOpt['conditions'] as $f => $v) { - $join .= " AND {$relTable}." . $this->toDb($f) . " = " . $this->pdo->quote($v); - } - } - - return $join; - } - - - protected function composeInsertQuery($table, $fields, $values) - { - $sql = "INSERT INTO `{$table}`"; - $sql .= " ({$fields})"; - if (!is_array($values)) { - $sql .= " VALUES ({$values})"; - } else { - $sql .= " VALUES (" . implode("), (", $values) . ")"; - } - - return $sql; - } - - protected function composeUpdateQuery($table, $set, $where) - { - $sql = "UPDATE `{$table}` SET {$set} WHERE {$where}"; - - return $sql; - } - - abstract protected function toDb($field); - - public function setReturnCollection($returnCollection) - { - $this->returnCollection = $returnCollection; - } - - public function setCollectionClass($collectionClass) - { - $this->collectionClass = $collectionClass; - } + public $pdo; + + protected $entityFactroy; + + protected $query; + + protected $fieldsMapCache = array(); + protected $aliasesCache = array(); + + protected $returnCollection = true; + + protected $collectionClass = "\\Espo\\ORM\\EntityCollection"; + + protected static $sqlOperators = array( + 'OR', + 'AND', + ); + + protected static $comparisonOperators = array( + '!=' => '<>', + '*' => 'LIKE', + '>=' => '>=', + '<=' => '<=', + '>' => '>', + '<' => '<', + '=' => '=', + ); + + protected static $selectParamList = array( + 'offset', + 'limit', + 'order', + 'orderBy', + 'customWhere', + 'customJoin', + 'joins', + 'leftJoins', + 'distinct', + 'joinConditions', + ); + + public function __construct(PDO $pdo, \Espo\ORM\EntityFactory $entityFactory, Query $query) { + $this->pdo = $pdo; + $this->query = $query; + $this->entityFactory = $entityFactory; + } + + public function selectById(IEntity $entity, $id, $params = array()) + { + if (!array_key_exists('whereClause', $params)) { + $params['whereClause'] = array(); + } + + $params['whereClause']['id'] = $id; + $params['whereClause']['deleted'] = 0; + + $sql = $this->query->createSelectQuery($entity->getEntityName(), $params); + + $ps = $this->pdo->query($sql); + + if ($ps) { + foreach ($ps as $row) { + $entity = $this->fromRow($entity, $row); + return true; + } + } + return false; + } + + public function count(IEntity $entity, $params = array()) + { + return $this->aggregate($entity, $params, 'COUNT', 'id'); + } + + public function max(IEntity $entity, $params = array(), $field, $deleted = false) + { + return $this->aggregate($entity, $params, 'MAX', $field, true); + } + + public function min(IEntity $entity, $params = array(), $field, $deleted = false) + { + return $this->aggregate($entity, $params, 'MIN', $field, true); + } + + public function sum(IEntity $entity, $params = array()) + { + return $this->aggregate($entity, $params, 'SUM', 'id'); + } + + public function select(IEntity $entity, $params = array()) + { + $sql = $this->query->createSelectQuery($entity->getEntityName(), $params); + + $dataArr = array(); + $ps = $this->pdo->query($sql); + if ($ps) { + $dataArr = $ps->fetchAll(); + } + + if ($this->returnCollection) { + $collectionClass = $this->collectionClass; + $entityArr = new $collectionClass($dataArr, $entity->getEntityName(), $this->entityFactory); + return $entityArr; + } else { + return $dataArr; + } + } + + public function aggregate(IEntity $entity, $params = array(), $aggregation, $aggregationBy, $deleted = false) + { + if (empty($aggregation) || !isset($entity->fields[$aggregationBy])) { + return false; + } + + $params['aggregation'] = $aggregation; + $params['aggregationBy'] = $aggregationBy; + + $sql = $this->query->createSelectQuery($entity->getEntityName(), $params, $deleted); + + $ps = $this->pdo->query($sql); + + if ($ps) { + foreach ($ps as $row) { + return $row['AggregateValue']; + } + } + return false; + } + + public function selectRelated(IEntity $entity, $relationName, $params = array(), $totalCount = false) + { + $relOpt = $entity->relations[$relationName]; + + if (!isset($relOpt['entity']) || !isset($relOpt['type'])) { + throw new \LogicException("Not appropriate defenition for relationship {$relationName} in " . $entity->getEntityName() . " entity"); + } + + $relEntityName = (!empty($relOpt['class'])) ? $relOpt['class'] : $relOpt['entity']; + $relEntity = $this->entityFactory->create($relEntityName); + + if (!$relEntity) { + return null; + } + + if ($totalCount) { + $params['aggregation'] = 'COUNT'; + $params['aggregationBy'] = 'id'; + } + + + if (empty($params['whereClause'])) { + $params['whereClause'] = array(); + } + + $relType = $relOpt['type']; + + $keySet = $this->query->getKeys($entity, $relationName); + + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + + switch ($relType) { + + case IEntity::BELONGS_TO: + $params['whereClause'][$foreignKey] = $entity->get($key); + $params['offset'] = 0; + $params['limit'] = 1; + + $sql = $this->query->createSelectQuery($relEntity->getEntityName(), $params); + + $ps = $this->pdo->query($sql); + + if ($ps) { + foreach ($ps as $row) { + if (!$totalCount) { + $relEntity = $this->fromRow($relEntity, $row); + return $relEntity; + } else { + return $row['AggregateValue']; + } + } + } + break; + + case IEntity::HAS_MANY: + case IEntity::HAS_CHILDREN: + + $params['whereClause'][$foreignKey] = $entity->get($key); + + if ($relType == IEntity::HAS_CHILDREN) { + $foreignType = $keySet['foreignType']; + $params['whereClause'][$foreignType] = $entity->getEntityName(); + } + + $dataArr = array(); + + $sql = $this->query->createSelectQuery($relEntity->getEntityName(), $params); + + $ps = $this->pdo->query($sql); + if ($ps) { + if (!$totalCount) { + $dataArr = $ps->fetchAll(); + + } else { + foreach ($ps as $row) { + return $row['AggregateValue']; + } + } + } + if ($this->returnCollection) { + $collectionClass = $this->collectionClass; + return new $collectionClass($dataArr, $relEntity->getEntityName(), $this->entityFactory); + } else { + return $dataArr; + } + break; + + case IEntity::MANY_MANY: + + $MMJoinPart = $this->getMMJoin($entity, $relationName, $keySet); + + if (empty($params['customJoin'])) { + $params['customJoin'] = ''; + } else { + $params['customJoin'] .= ' '; + } + $params['customJoin'] .= $MMJoinPart; + + + $params['relationName'] = $relOpt['relationName']; + + // TODO total + + + $sql = $this->query->createSelectQuery($relEntity->getEntityName(), $params); + + $dataArr = array(); + + + $ps = $this->pdo->query($sql); + if ($ps) { + if (!$totalCount) { + $dataArr = $ps->fetchAll(); + + } else { + foreach ($ps as $row) { + return $row['AggregateValue']; + } + } + } + if ($this->returnCollection) { + $collectionClass = $this->collectionClass; + return new $collectionClass($dataArr, $relEntity->getEntityName(), $this->entityFactory); + } else { + return $dataArr; + } + break; + } + + return false; + } + + + public function countRelated(IEntity $entity, $relationName, $params = array()) + { + return $this->selectRelated($entity, $relationName, $params, true); + } + + public function relate(IEntity $entityFrom, $relationName, IEntity $entityTo, $data = null) + { + $this->addRelation($entityFrom, $relationName, null, $entityTo, $data); + } + + public function unrelate(IEntity $entityFrom, $relationName, IEntity $entityTo) + { + $this->removeRelation($entityFrom, $relationName, null, false, $entityTo); + } + + public function updateRelation(IEntity $entity, $relationName, $id = null, array $columnData) + { + if (empty($id) || empty($relationName)) { + return false; + } + + $relOpt = $entity->relations[$relationName]; + $keySet = $this->query->getKeys($entity, $relationName); + + $relType = $relOpt['type']; + + + switch ($relType) { + case IEntity::MANY_MANY: + $relTable = $this->toDb($relOpt['relationName']); + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + $nearKey = $keySet['nearKey']; + $distantKey = $keySet['distantKey']; + + $setArr = array(); + foreach ($columnData as $column => $value) { + $setArr[] = $this->toDb($column) . " = " . $this->pdo->quote($value); + } + if (empty($setArr)) { + return true; + } + $setPart = implode(', ', $setArr); + + $wherePart = + $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->id) . " + AND " . $this->toDb($distantKey) . " = " . $this->pdo->quote($id) . " AND deleted = 0 + "; + + if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { + foreach ($relOpt['conditions'] as $f => $v) { + $wherePart .= " AND " . $this->toDb($f) . " = " . $this->pdo->quote($v); + } + } + + $sql = $this->composeUpdateQuery($relTable, $setPart, $wherePart); + + if ($this->pdo->query($sql)) { + return true; + } + } + } + + public function addRelation(IEntity $entity, $relationName, $id = null, $relEntity = null, $data = null) + { + if (!is_null($relEntity)) { + $id = $relEntity->id; + } + + if (empty($id) || empty($relationName)) { + return false; + } + + $relOpt = $entity->relations[$relationName]; + + if (!isset($relOpt['entity']) || !isset($relOpt['type'])) { + throw new \LogicException("Not appropriate defenition for relationship {$relationName} in " . $entity->getEntityName() . " entity"); + } + + $relType = $relOpt['type']; + + $className = (!empty($relOpt['class'])) ? $relOpt['class'] : $relOpt['entity']; + + if (is_null($relEntity)) { + $relEntity = $this->entityFactory->create($className); + if (!$relEntity) { + return null; + } + $relEntity->id = $id; + } + + $keySet = $this->query->getKeys($entity, $relationName); + + switch ($relType) { + case IEntity::BELONGS_TO: + case IEntity::HAS_ONE: + return false; + break; + + case IEntity::HAS_CHILDREN: + case IEntity::HAS_MANY: + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + + if ($this->count($relEntity, array('whereClause' => array('id' => $id))) > 0) { + + $setPart = $this->toDb($foreignKey) . " = " . $this->pdo->quote($entity->get($key)); + + if ($relType == IEntity::HAS_CHILDREN) { + $foreignType = $keySet['foreignType']; + $setPart .= ", " . $this->toDb($foreignType) . " = " . $this->pdo->quote($entity->getEntityName()); + } + + $wherePart = $this->query->getWhere($relEntity, array('id' => $id, 'deleted' => 0)); + $sql = $this->composeUpdateQuery($this->toDb($relEntity->getEntityName()), $setPart, $wherePart); + + if ($this->pdo->query($sql)) { + return true; + } + } else { + return false; + } + break; + + case IEntity::MANY_MANY: + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + $nearKey = $keySet['nearKey']; + $distantKey = $keySet['distantKey']; + + if ($this->count($relEntity, array('whereClause' => array('id' => $id))) > 0) { + $relTable = $this->toDb($relOpt['relationName']); + + $wherePart = + $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->id) . " ". + "AND " . $this->toDb($distantKey) . " = " . $this->pdo->quote($relEntity->id); + if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { + foreach ($relOpt['conditions'] as $f => $v) { + $wherePart .= " AND " . $this->toDb($f) . " = " . $this->pdo->quote($v); + } + } + + $sql = $this->query->composeSelectQuery($relTable, '*', '', $wherePart); + + $ps = $this->pdo->query($sql); + + if ($ps->rowCount() == 0) { + $fieldsPart = $this->toDb($nearKey) . ", " . $this->toDb($distantKey); + $valuesPart = $this->pdo->quote($entity->id) . ", " . $this->pdo->quote($relEntity->id); + + if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { + foreach ($relOpt['conditions'] as $f => $v) { + $fieldsPart .= ", " . $this->toDb($f); + $valuesPart .= ", " . $this->pdo->quote($v); + } + } + + if (!empty($data) && is_array($data)) { + foreach ($data as $column => $columnValue) { + $fieldsPart .= ", " . $this->toDb($column); + $valuesPart .= ", " . $this->pdo->quote($columnValue); + } + } + + $sql = $this->composeInsertQuery($relTable, $fieldsPart, $valuesPart); + + if ($this->pdo->query($sql)) { + return true; + } + } else { + $setPart = 'deleted = 0'; + + if (!empty($data) && is_array($data)) { + $setArr = array(); + foreach ($data as $column => $value) { + $setArr[] = $this->toDb($column) . " = " . $this->pdo->quote($value); + } + $setPart .= ', ' . implode(', ', $setArr); + } + + $wherePart = + $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->id) . " + AND " . $this->toDb($distantKey) . " = " . $this->pdo->quote($relEntity->id) . " + "; + + if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { + foreach ($relOpt['conditions'] as $f => $v) { + $wherePart .= " AND " . $this->toDb($f) . " = " . $this->pdo->quote($v); + } + } + + $sql = $this->composeUpdateQuery($relTable, $setPart, $wherePart); + if ($this->pdo->query($sql)) { + return true; + } + } + } else { + return false; + } + break; + } + } + + public function removeRelation(IEntity $entity, $relationName, $id = null, $all = false, IEntity $relEntity = null) + { + if (!is_null($relEntity)) { + $id = $relEntity->id; + } + + if (empty($id) && empty($all) || empty($relationName)) { + return false; + } + + $relOpt = $entity->relations[$relationName]; + + if (!isset($relOpt['entity']) || !isset($relOpt['type'])) { + throw new \LogicException("Not appropriate defenition for relationship {$relationName} in " . $entity->getEntityName() . " entity"); + } + + $relType = $relOpt['type']; + + $className = (!empty($relOpt['class'])) ? $relOpt['class'] : $relOpt['entity']; + + if (is_null($relEntity)) { + $relEntity = $this->entityFactory->create($className); + if (!$relEntity) { + return null; + } + $relEntity->id = $id; + } + + $keySet = $this->query->getKeys($entity, $relationName); + + switch ($relType) { + + case IEntity::BELONGS_TO: + /*$foreignKey = $keySet['foreignKey']; + $relEntity->$foreignKey = null; + $this-> + break;*/ + + case IEntity::HAS_ONE: + return false; + + + case IEntity::HAS_MANY: + case IEntity::HAS_CHILDREN: + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + + $setPart = $this->toDb($foreignKey) . " = " . "NULL"; + + $whereClause = array('deleted' => 0); + if (empty($all)) { + $whereClause['id'] = $id; + } else { + $whereClause[$foreignKey] = $entity->id; + } + + if ($relType == IEntity::HAS_CHILDREN) { + $foreignType = $keySet['foreignType']; + $whereClause[$foreignType] = $entity->getEntityName(); + } + + $wherePart = $this->query->getWhere($relEntity, $whereClause); + $sql = $this->composeUpdateQuery($this->toDb($relEntity->getEntityName()), $setPart, $wherePart); + if ($this->pdo->query($sql)) { + return true; + } + break; + + case IEntity::MANY_MANY: + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + $nearKey = $keySet['nearKey']; + $distantKey = $keySet['distantKey']; + + $relTable = $this->toDb($relOpt['relationName']); + + $setPart = 'deleted = 1'; + $wherePart = $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->id); + + + if (empty($all)) { + $wherePart .= " AND " . $this->toDb($distantKey) . " = " . $this->pdo->quote($id) . ""; + } + + if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { + foreach ($relOpt['conditions'] as $f => $v) { + $wherePart .= " AND " . $this->toDb($f) . " = " . $this->pdo->quote($v); + } + } + + $sql = $this->composeUpdateQuery($relTable, $setPart, $wherePart); + + if ($this->pdo->query($sql)) { + return true; + } + break; + } + } + + public function removeAllRelations(IEntity $entity, $relationName) + { + $this->removeRelation($entity, $relationName, null, true); + } + + protected function quote($value) + { + if (is_null($value)) { + return 'NULL'; + } else { + return $this->pdo->quote($value); + } + } + + public function insert(IEntity $entity) + { + $dataArr = $this->toArray($entity); + + $fieldArr = array(); + $valArr = array(); + foreach ($dataArr as $field => $value) { + $fieldArr[] = $this->toDb($field); + + $type = $entity->fields[$field]['type']; + + $value = $this->prepareValueForInsert($type, $value); + + $valArr[] = $this->quote($value); + } + $fieldsPart = "`" . implode("`, `", $fieldArr) . "`"; + $valuesPart = implode(", ", $valArr); + + $sql = $this->composeInsertQuery($this->toDb($entity->getEntityName()), $fieldsPart, $valuesPart); + + if ($this->pdo->query($sql)) { + return $entity->id; + } + + return false; + } + + public function update(IEntity $entity) + { + $dataArr = $this->toArray($entity); + + $setArr = array(); + foreach ($dataArr as $field => $value) { + if ($field == 'id') { + continue; + } + $type = $entity->fields[$field]['type']; + + if ($type == IEntity::FOREIGN) { + continue; + } + + if ($entity->getFetched($field) === $value && $type != IEntity::JSON_ARRAY && $type != IEntity::JSON_OBJECT) { + continue; + } + + $value = $this->prepareValueForInsert($type, $value); + + $setArr[] = "`" . $this->toDb($field) . "` = " . $this->quote($value); + } + if (count($setArr) == 0) { + return $entity->id; + } + + $setPart = implode(', ', $setArr); + $wherePart = $this->query->getWhere($entity, array('id' => $entity->id, 'deleted' => 0)); + + $sql = $this->composeUpdateQuery($this->toDb($entity->getEntityName()), $setPart, $wherePart); + + if ($this->pdo->query($sql)) { + return $entity->id; + } + + return false; + } + + protected function prepareValueForInsert($type, $value) { + if ($type == IEntity::JSON_ARRAY && is_array($value)) { + $value = json_encode($value); + } else if ($type == IEntity::JSON_OBJECT && (is_array($value) || $value instanceof \stdClass)) { + $value = json_encode($value); + } + + if (is_bool($value)) { + $value = (int) $value; + } + return $value; + } + + public function deleteFromDb($entityName, $id) + { + if (!empty($entityName) && !empty($id)) { + $table = $this->toDb($entityName); + $sql = "DELETE FROM `{$table}` WHERE id = " . $this->quote($id); + if ($this->pdo->query($sql)) { + return true; + } + } + } + + public function delete(IEntity $entity) + { + $entity->set('deleted', true); + return $this->update($entity); + } + + protected function toArray(IEntity $entity, $onlyStorable = true) + { + $arr = array(); + foreach ($entity->fields as $field => $fieldDefs) { + if ($entity->has($field)) { + if ($onlyStorable) { + if (!empty($fieldDefs['notStorable']) || isset($fieldDefs['source']) && $fieldDefs['source'] != 'db') + continue; + if ($fieldDefs['type'] == IEntity::FOREIGN) + continue; + } + $arr[$field] = $entity->get($field); + } + } + return $arr; + } + + protected function fromRow(IEntity $entity, $data) + { + $entity->set($data); + return $entity; + } + + protected function getMMJoin(IEntity $entity, $relationName, $keySet = false) + { + $relOpt = $entity->relations[$relationName]; + + if (empty($keySet)) { + $keySet = $this->query->getKeys($entity, $relationName); + } + + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + $nearKey = $keySet['nearKey']; + $distantKey = $keySet['distantKey']; + + $relTable = $this->toDb($relOpt['relationName']); + $distantTable = $this->toDb($relOpt['entity']); + + $join = + "JOIN `{$relTable}` ON {$distantTable}." . $this->toDb($foreignKey) . " = {$relTable}." . $this->toDb($distantKey) + . " AND " + . "{$relTable}." . $this->toDb($nearKey) . " = " . $this->pdo->quote($entity->get($key)) + . " AND " + . "{$relTable}.deleted = " . $this->pdo->quote(0) . ""; + + if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { + foreach ($relOpt['conditions'] as $f => $v) { + $join .= " AND {$relTable}." . $this->toDb($f) . " = " . $this->pdo->quote($v); + } + } + + return $join; + } + + + protected function composeInsertQuery($table, $fields, $values) + { + $sql = "INSERT INTO `{$table}`"; + $sql .= " ({$fields})"; + if (!is_array($values)) { + $sql .= " VALUES ({$values})"; + } else { + $sql .= " VALUES (" . implode("), (", $values) . ")"; + } + + return $sql; + } + + protected function composeUpdateQuery($table, $set, $where) + { + $sql = "UPDATE `{$table}` SET {$set} WHERE {$where}"; + + return $sql; + } + + abstract protected function toDb($field); + + public function setReturnCollection($returnCollection) + { + $this->returnCollection = $returnCollection; + } + + public function setCollectionClass($collectionClass) + { + $this->collectionClass = $collectionClass; + } } diff --git a/application/Espo/ORM/DB/MysqlMapper.php b/application/Espo/ORM/DB/MysqlMapper.php index 76688d7c63..34a0624eae 100644 --- a/application/Espo/ORM/DB/MysqlMapper.php +++ b/application/Espo/ORM/DB/MysqlMapper.php @@ -33,10 +33,10 @@ use PDO; */ class MysqlMapper extends Mapper { - protected function toDb($field) - { - return $this->query->toDb($field); - } + protected function toDb($field) + { + return $this->query->toDb($field); + } } diff --git a/application/Espo/ORM/DB/Query.php b/application/Espo/ORM/DB/Query.php index 4898ee2689..abbb3ebc07 100644 --- a/application/Espo/ORM/DB/Query.php +++ b/application/Espo/ORM/DB/Query.php @@ -28,781 +28,781 @@ use Espo\ORM\EntityFactory; use PDO; class Query -{ - protected static $selectParamList = array( - 'select', - 'whereClause', - 'offset', - 'limit', - 'order', - 'orderBy', - 'customWhere', - 'customJoin', - 'joins', - 'leftJoins', - 'distinct', - 'joinConditions', - 'aggregation', - 'aggregationBy', - 'groupBy' - ); - - protected static $sqlOperators = array( - 'OR', - 'AND', - ); - - protected static $comparisonOperators = array( - '!=' => '<>', - '*' => 'LIKE', - '>=' => '>=', - '<=' => '<=', - '>' => '>', - '<' => '<', - '=' => '=', - ); - - protected $entityFactory; - - protected $pdo; - - protected $fieldsMapCache = array(); - - protected $aliasesCache = array(); - - protected $seedCache = array(); - - public function __construct(PDO $pdo, EntityFactory $entityFactory) - { - $this->entityFactory = $entityFactory; - $this->pdo = $pdo; - } - - protected function getSeed($entityName) - { - if (empty($this->seedCache[$entityName])) { - $this->seedCache[$entityName] = $this->entityFactory->create($entityName); - } - return $this->seedCache[$entityName]; - } - - public function createSelectQuery($entityName, array $params = array(), $deleted = false) - { - $entity = $this->getSeed($entityName); - - foreach (self::$selectParamList as $k) { - $params[$k] = array_key_exists($k, $params) ? $params[$k] : null; - } - - $whereClause = $params['whereClause']; - if (empty($whereClause)) { - $whereClause = array(); - } - - if (!$deleted) { - $whereClause = $whereClause + array('deleted' => 0); - } - - if (empty($params['aggregation'])) { - $selectPart = $this->getSelect($entity, $params['select'], $params['distinct']); - $orderPart = $this->getOrder($entity, $params['orderBy'], $params['order']); - - if (!empty($params['additionalColumns']) && is_array($params['additionalColumns']) && !empty($params['relationName'])) { - foreach ($params['additionalColumns'] as $column => $field) { - $selectPart .= ", `" . $this->toDb($params['relationName']) . "`." . $this->toDb($column) . " AS `{$field}`"; - } - } - - } else { - $aggDist = false; - if ($params['distinct'] && $params['aggregation'] == 'COUNT') { - $aggDist = true; - } - $selectPart = $this->getAggregationSelect($entity, $params['aggregation'], $params['aggregationBy'], $aggDist); - } - - if (empty($params['joins'])) { - $params['joins'] = array(); - } - if (empty($params['leftJoins'])) { - $params['leftJoins'] = array(); - } - - $joinsPart = $this->getBelongsToJoins($entity, $params['select'], $params['joins'] + $params['leftJoins']); - - $wherePart = $this->getWhere($entity, $whereClause); - - if (!empty($params['customWhere'])) { - $wherePart .= ' ' . $params['customWhere']; - } - - if (!empty($params['customJoin'])) { - if (!empty($joinsPart)) { - $joinsPart .= ' '; - } - $joinsPart .= '' . $params['customJoin'] . ''; - } - - if (!empty($params['joins']) && is_array($params['joins'])) { - $joinsRelated = $this->getJoins($entity, $params['joins'], false, $params['joinConditions']); - if (!empty($joinsRelated)) { - if (!empty($joinsPart)) { - $joinsPart .= ' '; - } - $joinsPart .= $joinsRelated; - } - } - - if (!empty($params['leftJoins']) && is_array($params['leftJoins'])) { - $joinsRelated = $this->getJoins($entity, $params['leftJoins'], true, $params['joinConditions']); - if (!empty($joinsRelated)) { - if (!empty($joinsPart)) { - $joinsPart .= ' '; - } - $joinsPart .= $joinsRelated; - } - } - - $groupByPart = null; - if (!empty($params['groupBy']) && is_array($params['groupBy'])) { - $arr = array(); - foreach ($params['groupBy'] as $field) { - $arr[] = $this->convertComplexExpression($entity, $field, $entity->getEntityName()); - } - $groupByPart = implode(', ', $arr); - } - - if (empty($params['aggregation'])) { - return $this->composeSelectQuery($this->toDb($entity->getEntityName()), $selectPart, $joinsPart, $wherePart, $orderPart, $params['offset'], $params['limit'], $params['distinct'], null, $groupByPart); - } else { - return $this->composeSelectQuery($this->toDb($entity->getEntityName()), $selectPart, $joinsPart, $wherePart, null, null, null, false, $params['aggregation']); - } - } - - protected function getFunctionPart($function, $part, $entityName, $distinct = false) - { - switch ($function) { - case 'MONTH': - return "DATE_FORMAT({$part}, '%Y-%m')"; - case 'DAY': - return "DATE_FORMAT({$part}, '%Y-%m-%d')"; - } - if ($distinct) { - $idPart = $this->toDb($entityName) . ".id"; - switch ($function) { - case 'SUM': - case 'COUNT': - return $function . "({$part}) * COUNT(DISTINCT {$idPart}) / COUNT({$idPart})"; - } - } - return $function . '(' . $part . ')'; - } - - - protected function convertComplexExpression($entity, $field, $entityName = null, $distinct = false) - { - $function = null; - $relName = null; - - if (strpos($field, ':')) { - list($function, $field) = explode(':', $field); - } - if (strpos($field, '.')) { - list($relName, $field) = explode('.', $field); - } - - $part = $this->toDb($field); - if ($relName) { - $part = $this->toDb($relName) . '.' . $part; - } else { - if (!empty($entity->fields[$field]['select'])) { - $part = $entity->fields[$field]['select']; - } else { - if ($entityName) { - $part = $this->toDb($entityName) . '.' . $part; - } - } - } - if ($function) { - $part = $this->getFunctionPart(strtoupper($function), $part, $entityName, $distinct); - } - return $part; - } - - protected function getSelect(IEntity $entity, $fields = null, $distinct = false) - { - $select = ""; - $arr = array(); - $specifiedList = is_array($fields) ? true : false; - - if (empty($fields)) { - $fieldList = array_keys($entity->fields); - } else { - $fieldList = $fields; - } - - foreach ($fieldList as $field) { - if (array_key_exists($field, $entity->fields)) { - $fieldDefs = $entity->fields[$field]; - } else { - $part = $this->convertComplexExpression($entity, $field, $entity->getEntityName(), $distinct); - $arr[] = $part . ' AS `' . $field . '`'; - continue; - } - - if (!empty($fieldDefs['select'])) { - $fieldPath = $fieldDefs['select']; - } else { - if (!empty($fieldDefs['notStorable'])) { - continue; - } - $fieldPath = $this->getFieldPath($entity, $field); - } - - $arr[] = $fieldPath . ' AS `' . $field . '`'; - } - - $select = implode(', ', $arr); - - return $select; - } - - protected function getBelongsToJoin(IEntity $entity, $relationName, $r = null) - { - if (empty($r)) { - $r = $entity->relations[$relationName]; - } - - $keySet = $this->getKeys($entity, $relationName); - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - - $alias = $this->getAlias($entity, $relationName); - - if ($alias) { - return "JOIN `" . $this->toDb($r['entity']) . "` AS `" . $alias . "` ON ". - $this->toDb($entity->getEntityName()) . "." . $this->toDb($key) . " = " . $alias . "." . $this->toDb($foreignKey); - } - } - - protected function getBelongsToJoins(IEntity $entity, $select = null, $skipList = array()) - { - $joinsArr = array(); - - $fieldDefs = $entity->fields; - - $relationsToJoin = array(); - if (is_array($select)) { - foreach ($select as $field) { - if (!empty($fieldDefs[$field]) && $fieldDefs[$field]['type'] == 'foreign' && !empty($fieldDefs[$field]['relation'])) { - $relationsToJoin[] = $fieldDefs[$field]['relation']; - } - } - } - - foreach ($entity->relations as $relationName => $r) { - if ($r['type'] == IEntity::BELONGS_TO) { - if (in_array($relationName, $skipList)) { - continue; - } - - if (!empty($select)) { - if (!in_array($relationName, $relationsToJoin)) { - continue; - } - } - - $join = $this->getBelongsToJoin($entity, $relationName, $r); - if ($join) { - $joinsArr[] = 'LEFT ' . $join; - } - } - } - - return implode(' ', $joinsArr); - } - - protected function getOrderPart(IEntity $entity, $orderBy = null, $order = null) { - - if (!is_null($orderBy)) { - if (is_array($orderBy)) { - $arr = array(); - - foreach ($orderBy as $item) { - if (is_array($item)) { - $orderByInternal = $item[0]; - $orderInternal = null; - if (!empty($item[1])) { - $orderInternal = $item[1]; - } - $arr[] = $this->getOrderPart($entity, $orderByInternal, $orderInternal); - } - } - return implode(", ", $arr); - } - - if (strpos($orderBy, 'LIST:') === 0) { - list($l, $field, $list) = explode(':', $orderBy); - $fieldPath = $this->getFieldPathForOrderBy($entity, $field); - return "FIELD(" . $fieldPath . ", '" . implode("', '", explode(",", $list)) . "')"; - } - - if (!is_null($order)) { - $order = strtoupper($order); - if (!in_array($order, array('ASC', 'DESC'))) { - $order = 'ASC'; - } - } else { - $order = 'ASC'; - } - - if (is_integer($orderBy)) { - return "{$orderBy} " . $order; - } - - if (!empty($entity->fields[$orderBy])) { - $fieldDefs = $entity->fields[$orderBy]; - } - if (!empty($fieldDefs) && !empty($fieldDefs['orderBy'])) { - $orderPart = str_replace('{direction}', $order, $fieldDefs['orderBy']); - return "{$orderPart}"; - } else { - $fieldPath = $this->getFieldPathForOrderBy($entity, $orderBy); - - return "{$fieldPath} " . $order; - } - } - } - - protected function getOrder(IEntity $entity, $orderBy = null, $order = null) - { - $orderPart = $this->getOrderPart($entity, $orderBy, $order); - if ($orderPart) { - return "ORDER BY " . $orderPart; - } - - } - - protected function getFieldPathForOrderBy($entity, $orderBy) - { - if (strpos($orderBy, '.') !== false) { - list($alias, $field) = explode('.', $orderBy); - $fieldPath = $this->toDb($alias) . '.' . $this->toDb($field); - } else { - $fieldPath = $this->getFieldPath($entity, $orderBy); - } - return $fieldPath; - } - - protected function getAggregationSelect(IEntity $entity, $aggregation, $aggregationBy, $distinct = false) - { - if (!isset($entity->fields[$aggregationBy])) { - return false; - } - - $aggregation = strtoupper($aggregation); - - $distinctPart = ''; - if ($distinct) { - $distinctPart = 'DISTINCT '; - } - - $selectPart = "{$aggregation}({$distinctPart}" . $this->toDb($entity->getEntityName()) . "." . $this->toDb($aggregationBy) . ") AS AggregateValue"; - return $selectPart; - } - - public function toDb($field) - { - if (array_key_exists($field, $this->fieldsMapCache)) { - return $this->fieldsMapCache[$field]; - - } else { - $field[0] = strtolower($field[0]); - $dbField = preg_replace_callback('/([A-Z])/', array($this, 'toDbConversion'), $field); - - $this->fieldsMapCache[$field] = $dbField; - return $dbField; - } - } - - protected function toDbConversion($matches) - { - return "_" . strtolower($matches[1]); - } - - protected function getAlias(IEntity $entity, $relationName) - { - if (!isset($this->aliasesCache[$entity->getEntityName()])) { - $this->aliasesCache[$entity->getEntityName()] = $this->getTableAliases($entity); - } - - if (isset($this->aliasesCache[$entity->getEntityName()][$relationName])) { - return $this->aliasesCache[$entity->getEntityName()][$relationName]; - } else { - return false; - } - } - - protected function getTableAliases(IEntity $entity) - { - $aliases = array(); - $c = 0; - - $occuranceHash = array(); - - foreach ($entity->relations as $name => $r) { - if ($r['type'] == IEntity::BELONGS_TO) { - $table = $this->toDb($r['entity']); - - - if (!array_key_exists($name, $aliases)) { - if (array_key_exists($name, $occuranceHash)) { - $occuranceHash[$name]++; - } else { - $occuranceHash[$name] = 0; - } - $suffix = ''; - if ($occuranceHash[$name] > 0) { - $suffix .= '_' . $occuranceHash[$name]; - } - - $aliases[$name] = $this->toDb($name) . $suffix; - } - } - } - - return $aliases; - } - - protected function getFieldPath(IEntity $entity, $field) - { - if (isset($entity->fields[$field])) { - $f = $entity->fields[$field]; - - if (isset($f['source'])) { - if ($f['source'] != 'db') { - return false; - } - } - - if (!empty($f['notStorable'])) { - return false; - } - - $fieldPath = ''; - - switch($f['type']) { - case 'foreign': - if (isset($f['relation'])) { - $relationName = $f['relation']; - - $foreigh = $f['foreign']; - - if (is_array($foreigh)) { - foreach ($foreigh as $i => $value) { - if ($value == ' ') { - $foreigh[$i] = '\' \''; - } else { - $foreigh[$i] = $this->getAlias($entity, $relationName) . '.' . $this->toDb($value); - } - } - $fieldPath = 'TRIM(CONCAT(' . implode(', ', $foreigh). '))'; - } else { - $fieldPath = $this->getAlias($entity, $relationName) . '.' . $this->toDb($foreigh); - } - } - break; - default: - $fieldPath = $this->toDb($entity->getEntityName()) . '.' . $this->toDb($field) ; - } - - return $fieldPath; - } - - return false; - } - - public function getWhere(IEntity $entity, $whereClause, $sqlOp = 'AND') - { - $whereParts = array(); - - foreach ($whereClause as $field => $value) { - - if (is_int($field)) { - $field = 'AND'; - } - - if (!in_array($field, self::$sqlOperators)) { - - $inRelated = false; - - if (strpos($field, '.') !== false) { - list($entityName, $field) = array_map('trim', explode('.', $field)); - $entityName = preg_replace('/[^A-Za-z0-9_]+/', '', $entityName); - $field = preg_replace('/[^A-Za-z0-9_]+/', '', $field); - $inRelated = true; - } - - $operator = '='; - - if (!preg_match('/^[a-z0-9]+$/i', $field)) { - foreach (self::$comparisonOperators as $op => $opDb) { - if (strpos($field, $op) !== false) { - $field = trim(str_replace($op, '', $field)); - $operator = $opDb; - break; - } - } - } - - if (!$inRelated) { - - if (!isset($entity->fields[$field])) { - continue; - } - - $fieldDefs = $entity->fields[$field]; - - if (!empty($fieldDefs['where']) && !empty($fieldDefs['where'][$operator])) { - $whereParts[] = str_replace('{value}', $this->pdo->quote($value), $fieldDefs['where'][$operator]); - } else { - if ($fieldDefs['type'] == IEntity::FOREIGN) { - $leftPart = ''; - if (isset($fieldDefs['relation'])) { - $relationName = $fieldDefs['relation']; - if (isset($entity->relations[$relationName])) { - - $alias = $this->getAlias($entity, $relationName); - if ($alias) { - $leftPart = $alias . '.' . $this->toDb($fieldDefs['foreign']); - } - } - } - } else { - $leftPart = $this->toDb($entity->getEntityName()) . '.' . $this->toDb($field); - } - } - } else { - $leftPart = $this->toDb($entityName) . '.' . $this->toDb($field); - } - - if (!empty($leftPart)) { - if (!is_array($value)) { - $whereParts[] = $leftPart . " " . $operator . " " . $this->pdo->quote($value); - - } else { - $valArr = $value; - foreach ($valArr as $k => $v) { - $valArr[$k] = $this->pdo->quote($valArr[$k]); - } - $oppose = ''; - if ($operator == '<>') { - $oppose = 'NOT'; - } - if (!empty($valArr)) { - $whereParts[] = $leftPart . " {$oppose} IN " . "(" . implode(',', $valArr) . ")"; - } - } - } - } else { - $whereParts[] = "(" . $this->getWhere($entity, $value, $field) . ")"; - } - } - return implode(" " . $sqlOp . " ", $whereParts); - } - - protected function getJoins(IEntity $entity, array $joins, $left = false, $joinConditions = array()) - { - $joinsArr = array(); - foreach ($joins as $relationName) { - $conditions = array(); - if (!empty($joinConditions[$relationName])) { - $conditions = $joinConditions[$relationName]; - } - if ($joinRelated = $this->getJoinRelated($entity, $relationName, $left, $conditions)) { - $joinsArr[] = $joinRelated; - } - } - return implode(' ', $joinsArr); - } - - protected function getJoinRelated(IEntity $entity, $relationName, $left = false, $conditions = array()) - { - $relOpt = $entity->relations[$relationName]; - $keySet = $this->getKeys($entity, $relationName); - - $pre = ($left) ? 'LEFT ' : ''; - - if ($relOpt['type'] == IEntity::MANY_MANY) { - - $key = $keySet['key']; - $foreignKey = $keySet['foreignKey']; - $nearKey = $keySet['nearKey']; - $distantKey = $keySet['distantKey']; - - $relTable = $this->toDb($relOpt['relationName']); - $distantTable = $this->toDb($relOpt['entity']); - - $join = - "{$pre}JOIN `{$relTable}` ON {$this->toDb($entity->getEntityName())}." . $this->toDb($key) . " = {$relTable}." . $this->toDb($nearKey) - . " AND " - . "{$relTable}.deleted = " . $this->pdo->quote(0); - - if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { - $conditions = array_merge($conditions, $relOpt['conditions']); - } - foreach ($conditions as $f => $v) { - $join .= " AND {$relTable}." . $this->toDb($f) . " = " . $this->pdo->quote($v); - } - - $join .= " {$pre}JOIN `{$distantTable}` ON {$distantTable}." . $this->toDb($foreignKey) . " = {$relTable}." . $this->toDb($distantKey) - . " AND " - . "{$distantTable}.deleted = " . $this->pdo->quote(0) . ""; - - return $join; - } - - if ($relOpt['type'] == IEntity::HAS_MANY) { - - $foreignKey = $keySet['foreignKey']; - $distantTable = $this->toDb($relOpt['entity']); - - // TODO conditions - - $join = - "{$pre}JOIN `{$distantTable}` ON {$this->toDb($entity->getEntityName())}." . $this->toDb('id') . " = {$distantTable}." . $this->toDb($foreignKey) - . " AND " - . "{$distantTable}.deleted = " . $this->pdo->quote(0) . ""; - - return $join; - } - - if ($relOpt['type'] == IEntity::BELONGS_TO) { - return $pre . $this->getBelongsToJoin($entity, $relationName); - } - - return false; - } - - public function composeSelectQuery($table, $select, $joins = '', $where = '', $order = '', $offset = null, $limit = null, $distinct = null, $aggregation = false, $groupBy = null) - { - $sql = "SELECT"; - - /*if (!empty($distinct)) { - $sql .= " DISTINCT"; - }*/ - - $sql .= " {$select} FROM `{$table}`"; - - if (!empty($joins)) { - $sql .= " {$joins}"; - } - - if (!empty($where)) { - $sql .= " WHERE {$where}"; - } - - if (!empty($groupBy)) { - $sql .= " GROUP BY {$groupBy}"; - } else { - if (!empty($distinct)) { - $sql .= " GROUP BY `{$table}`.id"; - } - } - - if (!empty($order)) { - $sql .= " {$order}"; - } - - if (is_null($offset) && !is_null($limit)) { - $offset = 0; - } - - if (!is_null($offset) && !is_null($limit)) { - $offset = intval($offset); - $limit = intval($limit); - $sql .= " LIMIT {$offset}, {$limit}"; - } - - return $sql; - } - - public function getKeys(IEntity $entity, $relationName) - { - $relOpt = $entity->relations[$relationName]; - $relType = $relOpt['type']; - - switch ($relType) { - - case IEntity::BELONGS_TO: - $key = $this->toDb($entity->getEntityName()) . 'Id'; - if (isset($relOpt['key'])) { - $key = $relOpt['key']; - } - $foreignKey = 'id'; - if(isset($relOpt['foreignKey'])){ - $foreignKey = $relOpt['foreignKey']; - } - return array( - 'key' => $key, - 'foreignKey' => $foreignKey, - ); - - case IEntity::HAS_MANY: - $key = 'id'; - if (isset($relOpt['key'])){ - $key = $relOpt['key']; - } - $foreignKey = $this->toDb($entity->getEntityName()) . 'Id'; - if (isset($relOpt['foreignKey'])) { - $foreignKey = $relOpt['foreignKey']; - } - return array( - 'key' => $key, - 'foreignKey' => $foreignKey, - ); - case IEntity::HAS_CHILDREN: - $key = 'id'; - if (isset($relOpt['key'])){ - $key = $relOpt['key']; - } - $foreignKey = 'parentId'; - if (isset($relOpt['foreignKey'])) { - $foreignKey = $relOpt['foreignKey']; - } - $foreignType = 'parentType'; - if (isset($relOpt['foreignType'])) { - $foreignType = $relOpt['foreignType']; - } - return array( - 'key' => $key, - 'foreignKey' => $foreignKey, - 'foreignType' => $foreignType, - ); - - case IEntity::MANY_MANY: - $key = 'id'; - if(isset($relOpt['key'])){ - $key = $relOpt['key']; - } - $foreignKey = 'id'; - if(isset($relOpt['foreignKey'])){ - $foreignKey = $relOpt['foreignKey']; - } - $nearKey = $this->toDb($entity->getEntityName()) . 'Id'; - $distantKey = $this->toDb($relOpt['entity']) . 'Id'; - if (isset($relOpt['midKeys']) && is_array($relOpt['midKeys'])){ - $nearKey = $relOpt['midKeys'][0]; - $distantKey = $relOpt['midKeys'][1]; - } - return array( - 'key' => $key, - 'foreignKey' => $foreignKey, - 'nearKey' => $nearKey, - 'distantKey' => $distantKey, - ); - } - } - +{ + protected static $selectParamList = array( + 'select', + 'whereClause', + 'offset', + 'limit', + 'order', + 'orderBy', + 'customWhere', + 'customJoin', + 'joins', + 'leftJoins', + 'distinct', + 'joinConditions', + 'aggregation', + 'aggregationBy', + 'groupBy' + ); + + protected static $sqlOperators = array( + 'OR', + 'AND', + ); + + protected static $comparisonOperators = array( + '!=' => '<>', + '*' => 'LIKE', + '>=' => '>=', + '<=' => '<=', + '>' => '>', + '<' => '<', + '=' => '=', + ); + + protected $entityFactory; + + protected $pdo; + + protected $fieldsMapCache = array(); + + protected $aliasesCache = array(); + + protected $seedCache = array(); + + public function __construct(PDO $pdo, EntityFactory $entityFactory) + { + $this->entityFactory = $entityFactory; + $this->pdo = $pdo; + } + + protected function getSeed($entityName) + { + if (empty($this->seedCache[$entityName])) { + $this->seedCache[$entityName] = $this->entityFactory->create($entityName); + } + return $this->seedCache[$entityName]; + } + + public function createSelectQuery($entityName, array $params = array(), $deleted = false) + { + $entity = $this->getSeed($entityName); + + foreach (self::$selectParamList as $k) { + $params[$k] = array_key_exists($k, $params) ? $params[$k] : null; + } + + $whereClause = $params['whereClause']; + if (empty($whereClause)) { + $whereClause = array(); + } + + if (!$deleted) { + $whereClause = $whereClause + array('deleted' => 0); + } + + if (empty($params['aggregation'])) { + $selectPart = $this->getSelect($entity, $params['select'], $params['distinct']); + $orderPart = $this->getOrder($entity, $params['orderBy'], $params['order']); + + if (!empty($params['additionalColumns']) && is_array($params['additionalColumns']) && !empty($params['relationName'])) { + foreach ($params['additionalColumns'] as $column => $field) { + $selectPart .= ", `" . $this->toDb($params['relationName']) . "`." . $this->toDb($column) . " AS `{$field}`"; + } + } + + } else { + $aggDist = false; + if ($params['distinct'] && $params['aggregation'] == 'COUNT') { + $aggDist = true; + } + $selectPart = $this->getAggregationSelect($entity, $params['aggregation'], $params['aggregationBy'], $aggDist); + } + + if (empty($params['joins'])) { + $params['joins'] = array(); + } + if (empty($params['leftJoins'])) { + $params['leftJoins'] = array(); + } + + $joinsPart = $this->getBelongsToJoins($entity, $params['select'], $params['joins'] + $params['leftJoins']); + + $wherePart = $this->getWhere($entity, $whereClause); + + if (!empty($params['customWhere'])) { + $wherePart .= ' ' . $params['customWhere']; + } + + if (!empty($params['customJoin'])) { + if (!empty($joinsPart)) { + $joinsPart .= ' '; + } + $joinsPart .= '' . $params['customJoin'] . ''; + } + + if (!empty($params['joins']) && is_array($params['joins'])) { + $joinsRelated = $this->getJoins($entity, $params['joins'], false, $params['joinConditions']); + if (!empty($joinsRelated)) { + if (!empty($joinsPart)) { + $joinsPart .= ' '; + } + $joinsPart .= $joinsRelated; + } + } + + if (!empty($params['leftJoins']) && is_array($params['leftJoins'])) { + $joinsRelated = $this->getJoins($entity, $params['leftJoins'], true, $params['joinConditions']); + if (!empty($joinsRelated)) { + if (!empty($joinsPart)) { + $joinsPart .= ' '; + } + $joinsPart .= $joinsRelated; + } + } + + $groupByPart = null; + if (!empty($params['groupBy']) && is_array($params['groupBy'])) { + $arr = array(); + foreach ($params['groupBy'] as $field) { + $arr[] = $this->convertComplexExpression($entity, $field, $entity->getEntityName()); + } + $groupByPart = implode(', ', $arr); + } + + if (empty($params['aggregation'])) { + return $this->composeSelectQuery($this->toDb($entity->getEntityName()), $selectPart, $joinsPart, $wherePart, $orderPart, $params['offset'], $params['limit'], $params['distinct'], null, $groupByPart); + } else { + return $this->composeSelectQuery($this->toDb($entity->getEntityName()), $selectPart, $joinsPart, $wherePart, null, null, null, false, $params['aggregation']); + } + } + + protected function getFunctionPart($function, $part, $entityName, $distinct = false) + { + switch ($function) { + case 'MONTH': + return "DATE_FORMAT({$part}, '%Y-%m')"; + case 'DAY': + return "DATE_FORMAT({$part}, '%Y-%m-%d')"; + } + if ($distinct) { + $idPart = $this->toDb($entityName) . ".id"; + switch ($function) { + case 'SUM': + case 'COUNT': + return $function . "({$part}) * COUNT(DISTINCT {$idPart}) / COUNT({$idPart})"; + } + } + return $function . '(' . $part . ')'; + } + + + protected function convertComplexExpression($entity, $field, $entityName = null, $distinct = false) + { + $function = null; + $relName = null; + + if (strpos($field, ':')) { + list($function, $field) = explode(':', $field); + } + if (strpos($field, '.')) { + list($relName, $field) = explode('.', $field); + } + + $part = $this->toDb($field); + if ($relName) { + $part = $this->toDb($relName) . '.' . $part; + } else { + if (!empty($entity->fields[$field]['select'])) { + $part = $entity->fields[$field]['select']; + } else { + if ($entityName) { + $part = $this->toDb($entityName) . '.' . $part; + } + } + } + if ($function) { + $part = $this->getFunctionPart(strtoupper($function), $part, $entityName, $distinct); + } + return $part; + } + + protected function getSelect(IEntity $entity, $fields = null, $distinct = false) + { + $select = ""; + $arr = array(); + $specifiedList = is_array($fields) ? true : false; + + if (empty($fields)) { + $fieldList = array_keys($entity->fields); + } else { + $fieldList = $fields; + } + + foreach ($fieldList as $field) { + if (array_key_exists($field, $entity->fields)) { + $fieldDefs = $entity->fields[$field]; + } else { + $part = $this->convertComplexExpression($entity, $field, $entity->getEntityName(), $distinct); + $arr[] = $part . ' AS `' . $field . '`'; + continue; + } + + if (!empty($fieldDefs['select'])) { + $fieldPath = $fieldDefs['select']; + } else { + if (!empty($fieldDefs['notStorable'])) { + continue; + } + $fieldPath = $this->getFieldPath($entity, $field); + } + + $arr[] = $fieldPath . ' AS `' . $field . '`'; + } + + $select = implode(', ', $arr); + + return $select; + } + + protected function getBelongsToJoin(IEntity $entity, $relationName, $r = null) + { + if (empty($r)) { + $r = $entity->relations[$relationName]; + } + + $keySet = $this->getKeys($entity, $relationName); + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + + $alias = $this->getAlias($entity, $relationName); + + if ($alias) { + return "JOIN `" . $this->toDb($r['entity']) . "` AS `" . $alias . "` ON ". + $this->toDb($entity->getEntityName()) . "." . $this->toDb($key) . " = " . $alias . "." . $this->toDb($foreignKey); + } + } + + protected function getBelongsToJoins(IEntity $entity, $select = null, $skipList = array()) + { + $joinsArr = array(); + + $fieldDefs = $entity->fields; + + $relationsToJoin = array(); + if (is_array($select)) { + foreach ($select as $field) { + if (!empty($fieldDefs[$field]) && $fieldDefs[$field]['type'] == 'foreign' && !empty($fieldDefs[$field]['relation'])) { + $relationsToJoin[] = $fieldDefs[$field]['relation']; + } + } + } + + foreach ($entity->relations as $relationName => $r) { + if ($r['type'] == IEntity::BELONGS_TO) { + if (in_array($relationName, $skipList)) { + continue; + } + + if (!empty($select)) { + if (!in_array($relationName, $relationsToJoin)) { + continue; + } + } + + $join = $this->getBelongsToJoin($entity, $relationName, $r); + if ($join) { + $joinsArr[] = 'LEFT ' . $join; + } + } + } + + return implode(' ', $joinsArr); + } + + protected function getOrderPart(IEntity $entity, $orderBy = null, $order = null) { + + if (!is_null($orderBy)) { + if (is_array($orderBy)) { + $arr = array(); + + foreach ($orderBy as $item) { + if (is_array($item)) { + $orderByInternal = $item[0]; + $orderInternal = null; + if (!empty($item[1])) { + $orderInternal = $item[1]; + } + $arr[] = $this->getOrderPart($entity, $orderByInternal, $orderInternal); + } + } + return implode(", ", $arr); + } + + if (strpos($orderBy, 'LIST:') === 0) { + list($l, $field, $list) = explode(':', $orderBy); + $fieldPath = $this->getFieldPathForOrderBy($entity, $field); + return "FIELD(" . $fieldPath . ", '" . implode("', '", explode(",", $list)) . "')"; + } + + if (!is_null($order)) { + $order = strtoupper($order); + if (!in_array($order, array('ASC', 'DESC'))) { + $order = 'ASC'; + } + } else { + $order = 'ASC'; + } + + if (is_integer($orderBy)) { + return "{$orderBy} " . $order; + } + + if (!empty($entity->fields[$orderBy])) { + $fieldDefs = $entity->fields[$orderBy]; + } + if (!empty($fieldDefs) && !empty($fieldDefs['orderBy'])) { + $orderPart = str_replace('{direction}', $order, $fieldDefs['orderBy']); + return "{$orderPart}"; + } else { + $fieldPath = $this->getFieldPathForOrderBy($entity, $orderBy); + + return "{$fieldPath} " . $order; + } + } + } + + protected function getOrder(IEntity $entity, $orderBy = null, $order = null) + { + $orderPart = $this->getOrderPart($entity, $orderBy, $order); + if ($orderPart) { + return "ORDER BY " . $orderPart; + } + + } + + protected function getFieldPathForOrderBy($entity, $orderBy) + { + if (strpos($orderBy, '.') !== false) { + list($alias, $field) = explode('.', $orderBy); + $fieldPath = $this->toDb($alias) . '.' . $this->toDb($field); + } else { + $fieldPath = $this->getFieldPath($entity, $orderBy); + } + return $fieldPath; + } + + protected function getAggregationSelect(IEntity $entity, $aggregation, $aggregationBy, $distinct = false) + { + if (!isset($entity->fields[$aggregationBy])) { + return false; + } + + $aggregation = strtoupper($aggregation); + + $distinctPart = ''; + if ($distinct) { + $distinctPart = 'DISTINCT '; + } + + $selectPart = "{$aggregation}({$distinctPart}" . $this->toDb($entity->getEntityName()) . "." . $this->toDb($aggregationBy) . ") AS AggregateValue"; + return $selectPart; + } + + public function toDb($field) + { + if (array_key_exists($field, $this->fieldsMapCache)) { + return $this->fieldsMapCache[$field]; + + } else { + $field[0] = strtolower($field[0]); + $dbField = preg_replace_callback('/([A-Z])/', array($this, 'toDbConversion'), $field); + + $this->fieldsMapCache[$field] = $dbField; + return $dbField; + } + } + + protected function toDbConversion($matches) + { + return "_" . strtolower($matches[1]); + } + + protected function getAlias(IEntity $entity, $relationName) + { + if (!isset($this->aliasesCache[$entity->getEntityName()])) { + $this->aliasesCache[$entity->getEntityName()] = $this->getTableAliases($entity); + } + + if (isset($this->aliasesCache[$entity->getEntityName()][$relationName])) { + return $this->aliasesCache[$entity->getEntityName()][$relationName]; + } else { + return false; + } + } + + protected function getTableAliases(IEntity $entity) + { + $aliases = array(); + $c = 0; + + $occuranceHash = array(); + + foreach ($entity->relations as $name => $r) { + if ($r['type'] == IEntity::BELONGS_TO) { + $table = $this->toDb($r['entity']); + + + if (!array_key_exists($name, $aliases)) { + if (array_key_exists($name, $occuranceHash)) { + $occuranceHash[$name]++; + } else { + $occuranceHash[$name] = 0; + } + $suffix = ''; + if ($occuranceHash[$name] > 0) { + $suffix .= '_' . $occuranceHash[$name]; + } + + $aliases[$name] = $this->toDb($name) . $suffix; + } + } + } + + return $aliases; + } + + protected function getFieldPath(IEntity $entity, $field) + { + if (isset($entity->fields[$field])) { + $f = $entity->fields[$field]; + + if (isset($f['source'])) { + if ($f['source'] != 'db') { + return false; + } + } + + if (!empty($f['notStorable'])) { + return false; + } + + $fieldPath = ''; + + switch($f['type']) { + case 'foreign': + if (isset($f['relation'])) { + $relationName = $f['relation']; + + $foreigh = $f['foreign']; + + if (is_array($foreigh)) { + foreach ($foreigh as $i => $value) { + if ($value == ' ') { + $foreigh[$i] = '\' \''; + } else { + $foreigh[$i] = $this->getAlias($entity, $relationName) . '.' . $this->toDb($value); + } + } + $fieldPath = 'TRIM(CONCAT(' . implode(', ', $foreigh). '))'; + } else { + $fieldPath = $this->getAlias($entity, $relationName) . '.' . $this->toDb($foreigh); + } + } + break; + default: + $fieldPath = $this->toDb($entity->getEntityName()) . '.' . $this->toDb($field) ; + } + + return $fieldPath; + } + + return false; + } + + public function getWhere(IEntity $entity, $whereClause, $sqlOp = 'AND') + { + $whereParts = array(); + + foreach ($whereClause as $field => $value) { + + if (is_int($field)) { + $field = 'AND'; + } + + if (!in_array($field, self::$sqlOperators)) { + + $inRelated = false; + + if (strpos($field, '.') !== false) { + list($entityName, $field) = array_map('trim', explode('.', $field)); + $entityName = preg_replace('/[^A-Za-z0-9_]+/', '', $entityName); + $field = preg_replace('/[^A-Za-z0-9_]+/', '', $field); + $inRelated = true; + } + + $operator = '='; + + if (!preg_match('/^[a-z0-9]+$/i', $field)) { + foreach (self::$comparisonOperators as $op => $opDb) { + if (strpos($field, $op) !== false) { + $field = trim(str_replace($op, '', $field)); + $operator = $opDb; + break; + } + } + } + + if (!$inRelated) { + + if (!isset($entity->fields[$field])) { + continue; + } + + $fieldDefs = $entity->fields[$field]; + + if (!empty($fieldDefs['where']) && !empty($fieldDefs['where'][$operator])) { + $whereParts[] = str_replace('{value}', $this->pdo->quote($value), $fieldDefs['where'][$operator]); + } else { + if ($fieldDefs['type'] == IEntity::FOREIGN) { + $leftPart = ''; + if (isset($fieldDefs['relation'])) { + $relationName = $fieldDefs['relation']; + if (isset($entity->relations[$relationName])) { + + $alias = $this->getAlias($entity, $relationName); + if ($alias) { + $leftPart = $alias . '.' . $this->toDb($fieldDefs['foreign']); + } + } + } + } else { + $leftPart = $this->toDb($entity->getEntityName()) . '.' . $this->toDb($field); + } + } + } else { + $leftPart = $this->toDb($entityName) . '.' . $this->toDb($field); + } + + if (!empty($leftPart)) { + if (!is_array($value)) { + $whereParts[] = $leftPart . " " . $operator . " " . $this->pdo->quote($value); + + } else { + $valArr = $value; + foreach ($valArr as $k => $v) { + $valArr[$k] = $this->pdo->quote($valArr[$k]); + } + $oppose = ''; + if ($operator == '<>') { + $oppose = 'NOT'; + } + if (!empty($valArr)) { + $whereParts[] = $leftPart . " {$oppose} IN " . "(" . implode(',', $valArr) . ")"; + } + } + } + } else { + $whereParts[] = "(" . $this->getWhere($entity, $value, $field) . ")"; + } + } + return implode(" " . $sqlOp . " ", $whereParts); + } + + protected function getJoins(IEntity $entity, array $joins, $left = false, $joinConditions = array()) + { + $joinsArr = array(); + foreach ($joins as $relationName) { + $conditions = array(); + if (!empty($joinConditions[$relationName])) { + $conditions = $joinConditions[$relationName]; + } + if ($joinRelated = $this->getJoinRelated($entity, $relationName, $left, $conditions)) { + $joinsArr[] = $joinRelated; + } + } + return implode(' ', $joinsArr); + } + + protected function getJoinRelated(IEntity $entity, $relationName, $left = false, $conditions = array()) + { + $relOpt = $entity->relations[$relationName]; + $keySet = $this->getKeys($entity, $relationName); + + $pre = ($left) ? 'LEFT ' : ''; + + if ($relOpt['type'] == IEntity::MANY_MANY) { + + $key = $keySet['key']; + $foreignKey = $keySet['foreignKey']; + $nearKey = $keySet['nearKey']; + $distantKey = $keySet['distantKey']; + + $relTable = $this->toDb($relOpt['relationName']); + $distantTable = $this->toDb($relOpt['entity']); + + $join = + "{$pre}JOIN `{$relTable}` ON {$this->toDb($entity->getEntityName())}." . $this->toDb($key) . " = {$relTable}." . $this->toDb($nearKey) + . " AND " + . "{$relTable}.deleted = " . $this->pdo->quote(0); + + if (!empty($relOpt['conditions']) && is_array($relOpt['conditions'])) { + $conditions = array_merge($conditions, $relOpt['conditions']); + } + foreach ($conditions as $f => $v) { + $join .= " AND {$relTable}." . $this->toDb($f) . " = " . $this->pdo->quote($v); + } + + $join .= " {$pre}JOIN `{$distantTable}` ON {$distantTable}." . $this->toDb($foreignKey) . " = {$relTable}." . $this->toDb($distantKey) + . " AND " + . "{$distantTable}.deleted = " . $this->pdo->quote(0) . ""; + + return $join; + } + + if ($relOpt['type'] == IEntity::HAS_MANY) { + + $foreignKey = $keySet['foreignKey']; + $distantTable = $this->toDb($relOpt['entity']); + + // TODO conditions + + $join = + "{$pre}JOIN `{$distantTable}` ON {$this->toDb($entity->getEntityName())}." . $this->toDb('id') . " = {$distantTable}." . $this->toDb($foreignKey) + . " AND " + . "{$distantTable}.deleted = " . $this->pdo->quote(0) . ""; + + return $join; + } + + if ($relOpt['type'] == IEntity::BELONGS_TO) { + return $pre . $this->getBelongsToJoin($entity, $relationName); + } + + return false; + } + + public function composeSelectQuery($table, $select, $joins = '', $where = '', $order = '', $offset = null, $limit = null, $distinct = null, $aggregation = false, $groupBy = null) + { + $sql = "SELECT"; + + /*if (!empty($distinct)) { + $sql .= " DISTINCT"; + }*/ + + $sql .= " {$select} FROM `{$table}`"; + + if (!empty($joins)) { + $sql .= " {$joins}"; + } + + if (!empty($where)) { + $sql .= " WHERE {$where}"; + } + + if (!empty($groupBy)) { + $sql .= " GROUP BY {$groupBy}"; + } else { + if (!empty($distinct)) { + $sql .= " GROUP BY `{$table}`.id"; + } + } + + if (!empty($order)) { + $sql .= " {$order}"; + } + + if (is_null($offset) && !is_null($limit)) { + $offset = 0; + } + + if (!is_null($offset) && !is_null($limit)) { + $offset = intval($offset); + $limit = intval($limit); + $sql .= " LIMIT {$offset}, {$limit}"; + } + + return $sql; + } + + public function getKeys(IEntity $entity, $relationName) + { + $relOpt = $entity->relations[$relationName]; + $relType = $relOpt['type']; + + switch ($relType) { + + case IEntity::BELONGS_TO: + $key = $this->toDb($entity->getEntityName()) . 'Id'; + if (isset($relOpt['key'])) { + $key = $relOpt['key']; + } + $foreignKey = 'id'; + if(isset($relOpt['foreignKey'])){ + $foreignKey = $relOpt['foreignKey']; + } + return array( + 'key' => $key, + 'foreignKey' => $foreignKey, + ); + + case IEntity::HAS_MANY: + $key = 'id'; + if (isset($relOpt['key'])){ + $key = $relOpt['key']; + } + $foreignKey = $this->toDb($entity->getEntityName()) . 'Id'; + if (isset($relOpt['foreignKey'])) { + $foreignKey = $relOpt['foreignKey']; + } + return array( + 'key' => $key, + 'foreignKey' => $foreignKey, + ); + case IEntity::HAS_CHILDREN: + $key = 'id'; + if (isset($relOpt['key'])){ + $key = $relOpt['key']; + } + $foreignKey = 'parentId'; + if (isset($relOpt['foreignKey'])) { + $foreignKey = $relOpt['foreignKey']; + } + $foreignType = 'parentType'; + if (isset($relOpt['foreignType'])) { + $foreignType = $relOpt['foreignType']; + } + return array( + 'key' => $key, + 'foreignKey' => $foreignKey, + 'foreignType' => $foreignType, + ); + + case IEntity::MANY_MANY: + $key = 'id'; + if(isset($relOpt['key'])){ + $key = $relOpt['key']; + } + $foreignKey = 'id'; + if(isset($relOpt['foreignKey'])){ + $foreignKey = $relOpt['foreignKey']; + } + $nearKey = $this->toDb($entity->getEntityName()) . 'Id'; + $distantKey = $this->toDb($relOpt['entity']) . 'Id'; + if (isset($relOpt['midKeys']) && is_array($relOpt['midKeys'])){ + $nearKey = $relOpt['midKeys'][0]; + $distantKey = $relOpt['midKeys'][1]; + } + return array( + 'key' => $key, + 'foreignKey' => $foreignKey, + 'nearKey' => $nearKey, + 'distantKey' => $distantKey, + ); + } + } + } diff --git a/application/Espo/ORM/Entity.php b/application/Espo/ORM/Entity.php index 748b24ab2c..0fe2cadab5 100644 --- a/application/Espo/ORM/Entity.php +++ b/application/Espo/ORM/Entity.php @@ -24,287 +24,287 @@ namespace Espo\ORM; abstract class Entity implements IEntity { - public $id = null; - - private $isNew = false; + public $id = null; + + private $isNew = false; - /** - * Entity name. - * @var string - */ - protected $entityName; - - /** - * @var array Defenition of fields. - * @todo make protected - */ - public $fields = array(); - - /** - * @var array Defenition of relations. - * @todo make protected - */ - public $relations = array(); - - /** - * @var array Field-Value pairs. - */ - protected $valuesContainer = array(); - - /** - * @var array Field-Value pairs of initial values (fetched from DB). - */ - protected $fetchedValuesContainer = array(); - - /** - * @var EntityManager Entity Manager. - */ - protected $entityManager; - - protected $isFetched = false; - - public function __construct($defs = array(), EntityManager $entityManager = null) - { - if (empty($this->entityName)) { - $classNames = explode('\\', get_class($this)); - $this->entityName = end($classNames); - } - - $this->entityManager = $entityManager; - - if (!empty($defs['fields'])) { - $this->fields = $defs['fields']; - } - - if (!empty($defs['relations'])) { - $this->relations = $defs['relations']; - } - } - - public function clear($name = null) - { - if (is_null($name)) { - $this->reset(); - } - unset($this->valuesContainer[$name]); - } - - public function reset() - { - $this->valuesContainer = array(); - } - - protected function _setValue($name, $value) - { - $this->valuesContainer[$name] = $value; - } - - public function set($p1, $p2 = null) - { - if (is_array($p1)) { - if ($p2 === null) { - $p2 = false; - } - $this->populateFromArray($p1, $p2); - } else { - $name = $p1; - $value = $p2; - if ($name == 'id') { - $this->id = $value; - } - if ($this->hasField($name)) { - $method = 'set' . ucfirst($name); - if (method_exists($this, $method)) { - $this->$method($value); - } else { - $this->valuesContainer[$name] = $value; - } - } - } - } - - public function get($name, $params = array()) - { - if ($name == 'id') { - return $this->id; - } - $method = 'get' . ucfirst($name); - if (method_exists($this, $method)) { - return $this->$method(); - } - - if (isset($this->valuesContainer[$name])) { - return $this->valuesContainer[$name]; - } - - if (!empty($this->relations[$name])) { - $value = $this->entityManager->getRepository($this->entityName)->findRelated($this, $name, $params); - return $value; - } - - return null; - } - - public function has($name) - { - if ($name == 'id') { - return isset($this->id); - } - if (array_key_exists($name, $this->valuesContainer)) { - return true; - } - return false; - } - - public function populateFromArray(array $arr, $onlyAccessible = true, $reset = false) - { - if ($reset) { - $this->reset(); - } - - foreach ($this->fields as $field => $fieldDefs) { - if (array_key_exists($field, $arr)) { - if ($field == 'id') { - $this->id = $arr[$field]; - continue; - } - if ($onlyAccessible) { - if (isset($fieldDefs['notAccessible']) && $fieldDefs['notAccessible'] == true) { - continue; - } - } - - $value = $arr[$field]; - - if (!is_null($value)) { - switch ($fieldDefs['type']) { - case self::VARCHAR: - break; - case self::BOOL: - $value = ($value === 'true' || $value === '1' || $value === true); - break; - case self::INT: - $value = intval($value); - break; - case self::FLOAT: - $value = floatval($value); - break; - case self::JSON_ARRAY: - $value = is_string($value) ? json_decode($value) : $value; - if (!is_array($value)) { - $value = null; - } - break; - case self::JSON_OBJECT: - $value = is_string($value) ? json_decode($value) : $value; - if (!($value instanceof \stdClass) && !is_array($value)) { - $value = null; - } - break; - default: - break; - } - } - - $method = 'set' . ucfirst($field); - if (method_exists($this, $method)) { - $this->$method($value); - } else { - $this->valuesContainer[$field] = $value; - } - } - } - } - - public function isNew() - { - return $this->isNew; - } - - public function setIsNew($isNew) - { - $this->isNew = $isNew; - } - - public function getEntityName() - { - return $this->entityName; - } - - public function hasField($fieldName) - { - return isset($this->fields[$fieldName]); - } - - public function hasRelation($relationName) - { - return isset($this->relations[$relationName]); - } - - public function toArray() - { - $arr = array(); - if (isset($this->id)) { - $arr['id'] = $this->id; - } - foreach ($this->fields as $field => $defs) { - if ($field == 'id') { - continue; - } - if ($this->has($field)) { - $arr[$field] = $this->get($field); - } + /** + * Entity name. + * @var string + */ + protected $entityName; + + /** + * @var array Defenition of fields. + * @todo make protected + */ + public $fields = array(); + + /** + * @var array Defenition of relations. + * @todo make protected + */ + public $relations = array(); + + /** + * @var array Field-Value pairs. + */ + protected $valuesContainer = array(); + + /** + * @var array Field-Value pairs of initial values (fetched from DB). + */ + protected $fetchedValuesContainer = array(); + + /** + * @var EntityManager Entity Manager. + */ + protected $entityManager; + + protected $isFetched = false; + + public function __construct($defs = array(), EntityManager $entityManager = null) + { + if (empty($this->entityName)) { + $classNames = explode('\\', get_class($this)); + $this->entityName = end($classNames); + } + + $this->entityManager = $entityManager; + + if (!empty($defs['fields'])) { + $this->fields = $defs['fields']; + } + + if (!empty($defs['relations'])) { + $this->relations = $defs['relations']; + } + } + + public function clear($name = null) + { + if (is_null($name)) { + $this->reset(); + } + unset($this->valuesContainer[$name]); + } + + public function reset() + { + $this->valuesContainer = array(); + } + + protected function _setValue($name, $value) + { + $this->valuesContainer[$name] = $value; + } + + public function set($p1, $p2 = null) + { + if (is_array($p1)) { + if ($p2 === null) { + $p2 = false; + } + $this->populateFromArray($p1, $p2); + } else { + $name = $p1; + $value = $p2; + if ($name == 'id') { + $this->id = $value; + } + if ($this->hasField($name)) { + $method = 'set' . ucfirst($name); + if (method_exists($this, $method)) { + $this->$method($value); + } else { + $this->valuesContainer[$name] = $value; + } + } + } + } + + public function get($name, $params = array()) + { + if ($name == 'id') { + return $this->id; + } + $method = 'get' . ucfirst($name); + if (method_exists($this, $method)) { + return $this->$method(); + } + + if (isset($this->valuesContainer[$name])) { + return $this->valuesContainer[$name]; + } + + if (!empty($this->relations[$name])) { + $value = $this->entityManager->getRepository($this->entityName)->findRelated($this, $name, $params); + return $value; + } + + return null; + } + + public function has($name) + { + if ($name == 'id') { + return isset($this->id); + } + if (array_key_exists($name, $this->valuesContainer)) { + return true; + } + return false; + } + + public function populateFromArray(array $arr, $onlyAccessible = true, $reset = false) + { + if ($reset) { + $this->reset(); + } + + foreach ($this->fields as $field => $fieldDefs) { + if (array_key_exists($field, $arr)) { + if ($field == 'id') { + $this->id = $arr[$field]; + continue; + } + if ($onlyAccessible) { + if (isset($fieldDefs['notAccessible']) && $fieldDefs['notAccessible'] == true) { + continue; + } + } + + $value = $arr[$field]; + + if (!is_null($value)) { + switch ($fieldDefs['type']) { + case self::VARCHAR: + break; + case self::BOOL: + $value = ($value === 'true' || $value === '1' || $value === true); + break; + case self::INT: + $value = intval($value); + break; + case self::FLOAT: + $value = floatval($value); + break; + case self::JSON_ARRAY: + $value = is_string($value) ? json_decode($value) : $value; + if (!is_array($value)) { + $value = null; + } + break; + case self::JSON_OBJECT: + $value = is_string($value) ? json_decode($value) : $value; + if (!($value instanceof \stdClass) && !is_array($value)) { + $value = null; + } + break; + default: + break; + } + } + + $method = 'set' . ucfirst($field); + if (method_exists($this, $method)) { + $this->$method($value); + } else { + $this->valuesContainer[$field] = $value; + } + } + } + } + + public function isNew() + { + return $this->isNew; + } + + public function setIsNew($isNew) + { + $this->isNew = $isNew; + } + + public function getEntityName() + { + return $this->entityName; + } + + public function hasField($fieldName) + { + return isset($this->fields[$fieldName]); + } + + public function hasRelation($relationName) + { + return isset($this->relations[$relationName]); + } + + public function toArray() + { + $arr = array(); + if (isset($this->id)) { + $arr['id'] = $this->id; + } + foreach ($this->fields as $field => $defs) { + if ($field == 'id') { + continue; + } + if ($this->has($field)) { + $arr[$field] = $this->get($field); + } - } - return $arr; - } - - public function getFields() - { - return $this->fields; - } - - public function getRelations() - { - return $this->relations; - } - - public function isFetched() - { - return $this->isFetched; - } - - public function isFieldChanged($fieldName) - { - return $this->has($fieldName) && ($this->get($fieldName) != $this->getFetched($fieldName)); - } - - public function getFetched($fieldName) - { - if (isset($this->fetchedValuesContainer[$fieldName])) { - return $this->fetchedValuesContainer[$fieldName]; - } - return null; - } - - public function resetFetchedValues() - { - $this->fetchedValuesContainer = array(); - } - - public function setAsFetched() - { - $this->isFetched = true; - $this->fetchedValuesContainer = $this->valuesContainer; - } - - public function populateDefaults() - { - foreach ($this->fields as $field => $defs) { - if (array_key_exists('default', $defs)) { - $this->valuesContainer[$field] = $defs['default']; - } - } - } + } + return $arr; + } + + public function getFields() + { + return $this->fields; + } + + public function getRelations() + { + return $this->relations; + } + + public function isFetched() + { + return $this->isFetched; + } + + public function isFieldChanged($fieldName) + { + return $this->has($fieldName) && ($this->get($fieldName) != $this->getFetched($fieldName)); + } + + public function getFetched($fieldName) + { + if (isset($this->fetchedValuesContainer[$fieldName])) { + return $this->fetchedValuesContainer[$fieldName]; + } + return null; + } + + public function resetFetchedValues() + { + $this->fetchedValuesContainer = array(); + } + + public function setAsFetched() + { + $this->isFetched = true; + $this->fetchedValuesContainer = $this->valuesContainer; + } + + public function populateDefaults() + { + foreach ($this->fields as $field => $defs) { + if (array_key_exists('default', $defs)) { + $this->valuesContainer[$field] = $defs['default']; + } + } + } } diff --git a/application/Espo/ORM/EntityCollection.php b/application/Espo/ORM/EntityCollection.php index f89aaa76fc..c7eb29b51d 100644 --- a/application/Espo/ORM/EntityCollection.php +++ b/application/Espo/ORM/EntityCollection.php @@ -24,201 +24,201 @@ namespace Espo\ORM; class EntityCollection implements \Iterator, \Countable, \ArrayAccess, \SeekableIterator { - private $entityFactory = null; - - private $entityName; - - private $position = 0; - - protected $container = array(); - - public function __construct($data = array(), $entityName, EntityFactory $entityFactory = null) - { - $this->container = $data; - $this->entityName = $entityName; - $this->entityFactory = $entityFactory; - } - - public function rewind() - { - $this->position = 0; + private $entityFactory = null; + + private $entityName; + + private $position = 0; + + protected $container = array(); + + public function __construct($data = array(), $entityName, EntityFactory $entityFactory = null) + { + $this->container = $data; + $this->entityName = $entityName; + $this->entityFactory = $entityFactory; + } + + public function rewind() + { + $this->position = 0; - while (!$this->valid() && $this->position < count($this->container)) { - $this->position ++; - } - } - - public function current() - { - return $this->getEntityByOffset($this->position); - } - - public function key() - { - return $this->position; - } - - public function next() - { - do { - $this->position ++; - $next = false; - if (!$this->valid() && $this->position < count($this->container)) { - $next = true; - } - } while ($next); - } - - public function valid() - { - return isset($this->container[$this->position]); - } - - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - public function offsetGet($offset) - { - if (!isset($this->container[$offset])) { - return null; - } - return $this->getEntityByOffset($offset); - } - - public function offsetSet($offset, $value) - { - if (!($value instanceof Entity)) { - throw new \InvalidArgumentException('Only Entity is allowed to be added to EntityCollection.'); - } - - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } + while (!$this->valid() && $this->position < count($this->container)) { + $this->position ++; + } + } + + public function current() + { + return $this->getEntityByOffset($this->position); + } + + public function key() + { + return $this->position; + } + + public function next() + { + do { + $this->position ++; + $next = false; + if (!$this->valid() && $this->position < count($this->container)) { + $next = true; + } + } while ($next); + } + + public function valid() + { + return isset($this->container[$this->position]); + } + + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + public function offsetGet($offset) + { + if (!isset($this->container[$offset])) { + return null; + } + return $this->getEntityByOffset($offset); + } + + public function offsetSet($offset, $value) + { + if (!($value instanceof Entity)) { + throw new \InvalidArgumentException('Only Entity is allowed to be added to EntityCollection.'); + } + + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } - public function count() - { - return count($this->container); - } - - public function seek($offset) - { - $this->position = $offset; - if (!$this->valid()) { - throw new \OutOfBoundsException("Invalid seek offset ($offset)."); - } - } + public function count() + { + return count($this->container); + } + + public function seek($offset) + { + $this->position = $offset; + if (!$this->valid()) { + throw new \OutOfBoundsException("Invalid seek offset ($offset)."); + } + } - public function append(Entity $entity) - { - $this->container[] = $entity; - } - - private function getEntityByOffset($offset) - { - $value = $this->container[$offset]; + public function append(Entity $entity) + { + $this->container[] = $entity; + } + + private function getEntityByOffset($offset) + { + $value = $this->container[$offset]; - if ($value instanceof Entity) { - return $value; - } else if (is_array($value)) { - $this->container[$offset] = $this->buildEntityFromArray($value); - } else { - return null; - } - - return $this->container[$offset]; - } - - protected function buildEntityFromArray(array $dataArray) - { - $entity = $this->entityFactory->create($this->entityName); - if ($entity) { - $entity->set($dataArray); - $entity->setAsFetched(); - return $entity; - } - } + if ($value instanceof Entity) { + return $value; + } else if (is_array($value)) { + $this->container[$offset] = $this->buildEntityFromArray($value); + } else { + return null; + } + + return $this->container[$offset]; + } + + protected function buildEntityFromArray(array $dataArray) + { + $entity = $this->entityFactory->create($this->entityName); + if ($entity) { + $entity->set($dataArray); + $entity->setAsFetched(); + return $entity; + } + } - public function getEntityName() - { - return $this->entityName; - } + public function getEntityName() + { + return $this->entityName; + } - public function getInnerContainer() - { - return $this->container; - } - - public function merge(EntityCollection $collection) - { - $newData = $this->container; - $incomingData = $collection->getInnerContainer(); - - foreach ($incomingData as $v) { - if (!$this->contains($v)) { - $this->container[] = $v; - } - } - } - - public function contains($value) - { - if ($this->indexOf($value) !== false) { - return true; - } - return false; - } - - public function indexOf($value) - { - $index = 0; - if (is_array($value)) { - foreach ($this->container as $v) { - if (is_array($v)) { - if ($value['id'] == $v['id']) { - return $index; - } - } else if ($v instanceof Entity) { - if ($value['id'] == $v->id) { - return $index; - } - } - $index ++; - } - } else if ($value instanceof Entity) { - foreach ($this->container as $v) { - if (is_array($v)) { - if ($value->id == $v['id']) { - return $index; - } - } else if ($v instanceof Entity) { - if ($value === $v) { - return $index; - } - } - $index ++; - } - } - return false; - } - - public function toArray() - { - $arr = array(); - foreach ($this as $entity) { - $arr[] = $entity->toArray(); - } - return $arr; - } + public function getInnerContainer() + { + return $this->container; + } + + public function merge(EntityCollection $collection) + { + $newData = $this->container; + $incomingData = $collection->getInnerContainer(); + + foreach ($incomingData as $v) { + if (!$this->contains($v)) { + $this->container[] = $v; + } + } + } + + public function contains($value) + { + if ($this->indexOf($value) !== false) { + return true; + } + return false; + } + + public function indexOf($value) + { + $index = 0; + if (is_array($value)) { + foreach ($this->container as $v) { + if (is_array($v)) { + if ($value['id'] == $v['id']) { + return $index; + } + } else if ($v instanceof Entity) { + if ($value['id'] == $v->id) { + return $index; + } + } + $index ++; + } + } else if ($value instanceof Entity) { + foreach ($this->container as $v) { + if (is_array($v)) { + if ($value->id == $v['id']) { + return $index; + } + } else if ($v instanceof Entity) { + if ($value === $v) { + return $index; + } + } + $index ++; + } + } + return false; + } + + public function toArray() + { + $arr = array(); + foreach ($this as $entity) { + $arr[] = $entity->toArray(); + } + return $arr; + } } diff --git a/application/Espo/ORM/EntityFactory.php b/application/Espo/ORM/EntityFactory.php index d02bb5182d..423ae82b00 100644 --- a/application/Espo/ORM/EntityFactory.php +++ b/application/Espo/ORM/EntityFactory.php @@ -23,26 +23,26 @@ namespace Espo\ORM; class EntityFactory -{ - protected $metadata; - - protected $entityManager; - - public function __construct(EntityManager $entityManager, Metadata $metadata) - { - $this->entityManager = $entityManager; - $this->metadata = $metadata; - } - public function create($name) - { - $className = $this->entityManager->normalizeEntityName($name); - $defs = $this->metadata->get($name); - if (!class_exists($className)) { - return null; - } - $entity = new $className($defs, $this->entityManager); - return $entity; - } +{ + protected $metadata; + + protected $entityManager; + + public function __construct(EntityManager $entityManager, Metadata $metadata) + { + $this->entityManager = $entityManager; + $this->metadata = $metadata; + } + public function create($name) + { + $className = $this->entityManager->normalizeEntityName($name); + $defs = $this->metadata->get($name); + if (!class_exists($className)) { + return null; + } + $entity = new $className($defs, $this->entityManager); + return $entity; + } } diff --git a/application/Espo/ORM/EntityManager.php b/application/Espo/ORM/EntityManager.php index 6adcb8cd1f..4433690917 100644 --- a/application/Espo/ORM/EntityManager.php +++ b/application/Espo/ORM/EntityManager.php @@ -25,137 +25,137 @@ namespace Espo\ORM; class EntityManager { - protected $pdo; + protected $pdo; - protected $entityFactory; + protected $entityFactory; - protected $repositoryFactory; + protected $repositoryFactory; - protected $mappers = array(); + protected $mappers = array(); - protected $metadata; + protected $metadata; - protected $repositoryHash = array(); + protected $repositoryHash = array(); - protected $params = array(); - - protected $query; + protected $params = array(); + + protected $query; - public function __construct($params) - { - $this->params = $params; + public function __construct($params) + { + $this->params = $params; - $this->metadata = new Metadata(); + $this->metadata = new Metadata(); - if (!empty($params['metadata'])) { - $this->setMetadata($params['metadata']); - } + if (!empty($params['metadata'])) { + $this->setMetadata($params['metadata']); + } - $entityFactoryClassName = '\\Espo\\ORM\\EntityFactory'; - if (!empty($params['entityFactoryClassName'])) { - $entityFactoryClassName = $params['entityFactoryClassName']; - } - $this->entityFactory = new $entityFactoryClassName($this, $this->metadata); + $entityFactoryClassName = '\\Espo\\ORM\\EntityFactory'; + if (!empty($params['entityFactoryClassName'])) { + $entityFactoryClassName = $params['entityFactoryClassName']; + } + $this->entityFactory = new $entityFactoryClassName($this, $this->metadata); - $repositoryFactoryClassName = '\\Espo\\ORM\\RepositoryFactory'; - if (!empty($params['repositoryFactoryClassName'])) { - $repositoryFactoryClassName = $params['repositoryFactoryClassName']; - } - $this->repositoryFactory = new $repositoryFactoryClassName($this, $this->entityFactory); + $repositoryFactoryClassName = '\\Espo\\ORM\\RepositoryFactory'; + if (!empty($params['repositoryFactoryClassName'])) { + $repositoryFactoryClassName = $params['repositoryFactoryClassName']; + } + $this->repositoryFactory = new $repositoryFactoryClassName($this, $this->entityFactory); - $this->init(); - } - - public function getQuery() - { - if (empty($this->query)) { - $this->query = new DB\Query($this->getPDO(), $this->entityFactory); - } - return $this->query; - } + $this->init(); + } + + public function getQuery() + { + if (empty($this->query)) { + $this->query = new DB\Query($this->getPDO(), $this->entityFactory); + } + return $this->query; + } - public function getMapper($className) - { - if (empty($this->mappers[$className])) { - // TODO use factory - - $this->mappers[$className] = new $className($this->getPDO(), $this->entityFactory, $this->getQuery()); - } - return $this->mappers[$className]; - } + public function getMapper($className) + { + if (empty($this->mappers[$className])) { + // TODO use factory + + $this->mappers[$className] = new $className($this->getPDO(), $this->entityFactory, $this->getQuery()); + } + return $this->mappers[$className]; + } - protected function initPDO() - { - $params = $this->params; + protected function initPDO() + { + $params = $this->params; - $port = empty($params['port']) ? '' : 'port=' . $params['port'] . ';'; + $port = empty($params['port']) ? '' : 'port=' . $params['port'] . ';'; - $this->pdo = new \PDO('mysql:host='.$params['host'].';'.$port.'dbname=' . $params['dbname'] . ';charset=utf8', $params['user'], $params['password']); - $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - } + $this->pdo = new \PDO('mysql:host='.$params['host'].';'.$port.'dbname=' . $params['dbname'] . ';charset=utf8', $params['user'], $params['password']); + $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + } - public function getEntity($name, $id = null) - { - return $this->getRepository($name)->get($id); - } + public function getEntity($name, $id = null) + { + return $this->getRepository($name)->get($id); + } - public function saveEntity(Entity $entity) - { - $entityName = $entity->getEntityName(); - return $this->getRepository($entityName)->save($entity); - } + public function saveEntity(Entity $entity) + { + $entityName = $entity->getEntityName(); + return $this->getRepository($entityName)->save($entity); + } - public function removeEntity(Entity $entity) - { - $entityName = $entity->getEntityName(); - return $this->getRepository($entityName)->remove($entity); - } + public function removeEntity(Entity $entity) + { + $entityName = $entity->getEntityName(); + return $this->getRepository($entityName)->remove($entity); + } - public function getRepository($name) - { - if (empty($this->repositoryHash[$name])) { - $this->repositoryHash[$name] = $this->repositoryFactory->create($name); - } - return $this->repositoryHash[$name]; - } + public function getRepository($name) + { + if (empty($this->repositoryHash[$name])) { + $this->repositoryHash[$name] = $this->repositoryFactory->create($name); + } + return $this->repositoryHash[$name]; + } - public function setMetadata(array $data) - { - $this->metadata->setData($data); - } + public function setMetadata(array $data) + { + $this->metadata->setData($data); + } - public function getMetadata() - { - return $this->metadata; - } + public function getMetadata() + { + return $this->metadata; + } - public function getPDO() - { - if (empty($this->pdo)) { - $this->initPDO(); - } - return $this->pdo; - } + public function getPDO() + { + if (empty($this->pdo)) { + $this->initPDO(); + } + return $this->pdo; + } - public function normalizeRepositoryName($name) - { - return $name; - } + public function normalizeRepositoryName($name) + { + return $name; + } - public function normalizeEntityName($name) - { - return $name; - } + public function normalizeEntityName($name) + { + return $name; + } - public function createCollection($entityName, $data = array()) - { - $seed = $this->getEntity($entityName); - $collection = new EntityCollection($data, $seed, $this->entityFactory); - return $collection; - } + public function createCollection($entityName, $data = array()) + { + $seed = $this->getEntity($entityName); + $collection = new EntityCollection($data, $seed, $this->entityFactory); + return $collection; + } - protected function init() - { - } + protected function init() + { + } } diff --git a/application/Espo/ORM/IEntity.php b/application/Espo/ORM/IEntity.php index cb81fe712e..2e14d552d6 100644 --- a/application/Espo/ORM/IEntity.php +++ b/application/Espo/ORM/IEntity.php @@ -27,59 +27,59 @@ namespace Espo\ORM; */ interface IEntity { - const ID = 'id'; - const VARCHAR = 'varchar'; - const INT = 'int'; - const FLOAT = 'float'; - const TEXT = 'text'; - const BOOL = 'bool'; - const FOREIGN_ID = 'foreignId'; - const FOREIGN = 'foreign'; - const FOREIGN_TYPE = 'foreignType'; - const DATE = 'date'; - const DATETIME = 'datetime'; - const JSON_ARRAY = 'jsonArray'; - const JSON_OBJECT = 'jsonObject'; - - const MANY_MANY = 'manyMany'; - const HAS_MANY = 'hasMany'; - const BELONGS_TO = 'belongsTo'; - const HAS_ONE = 'hasOne'; - const BELONGS_TO_PARENT = 'belongsToParent'; - const HAS_CHILDREN = 'hasChildren'; - - /** - * Push values from the array. - * E.g. insert values into the bean from a request data. - * @param array $arr Array of field - value pairs - */ - function populateFromArray(array $arr); - - /** - * Resets all fields in the current model. - */ - function reset(); - - /** - * Set field. - */ - function set($name, $value); - - /** - * Get field. - */ - function get($name); - - /** - * Check field is set. - */ - function has($name); - - /** - * Clear field. - */ - function clear($name); - + const ID = 'id'; + const VARCHAR = 'varchar'; + const INT = 'int'; + const FLOAT = 'float'; + const TEXT = 'text'; + const BOOL = 'bool'; + const FOREIGN_ID = 'foreignId'; + const FOREIGN = 'foreign'; + const FOREIGN_TYPE = 'foreignType'; + const DATE = 'date'; + const DATETIME = 'datetime'; + const JSON_ARRAY = 'jsonArray'; + const JSON_OBJECT = 'jsonObject'; + + const MANY_MANY = 'manyMany'; + const HAS_MANY = 'hasMany'; + const BELONGS_TO = 'belongsTo'; + const HAS_ONE = 'hasOne'; + const BELONGS_TO_PARENT = 'belongsToParent'; + const HAS_CHILDREN = 'hasChildren'; + + /** + * Push values from the array. + * E.g. insert values into the bean from a request data. + * @param array $arr Array of field - value pairs + */ + function populateFromArray(array $arr); + + /** + * Resets all fields in the current model. + */ + function reset(); + + /** + * Set field. + */ + function set($name, $value); + + /** + * Get field. + */ + function get($name); + + /** + * Check field is set. + */ + function has($name); + + /** + * Clear field. + */ + function clear($name); + } diff --git a/application/Espo/ORM/Metadata.php b/application/Espo/ORM/Metadata.php index 02eb63b6bc..a97920544d 100644 --- a/application/Espo/ORM/Metadata.php +++ b/application/Espo/ORM/Metadata.php @@ -24,17 +24,17 @@ namespace Espo\ORM; class Metadata { - protected $data = array(); - - public function setData($data) - { - $this->data = $data; - } - - public function get($entityName) - { - return $this->data[$entityName]; - } + protected $data = array(); + + public function setData($data) + { + $this->data = $data; + } + + public function get($entityName) + { + return $this->data[$entityName]; + } } diff --git a/application/Espo/ORM/Repositories/RDB.php b/application/Espo/ORM/Repositories/RDB.php index ef3afc36f7..38591ca219 100644 --- a/application/Espo/ORM/Repositories/RDB.php +++ b/application/Espo/ORM/Repositories/RDB.php @@ -31,349 +31,349 @@ use \Espo\ORM\IEntity; class RDB extends \Espo\ORM\Repository { - - public static $mapperClassName = '\\Espo\\ORM\\DB\\MysqlMapper'; - - /** - * @var Object Mapper. - */ - protected $mapper; - - /** - * @var array Where clause array. To be used in further find operation. - */ - protected $whereClause = array(); + + public static $mapperClassName = '\\Espo\\ORM\\DB\\MysqlMapper'; + + /** + * @var Object Mapper. + */ + protected $mapper; + + /** + * @var array Where clause array. To be used in further find operation. + */ + protected $whereClause = array(); - /** - * @var array Parameters to be used in further find operations. - */ - protected $listParams = array(); - - public function __construct($entityName, EntityManager $entityManager, EntityFactory $entityFactory) - { - $this->entityName = $entityName; - $this->entityFactory = $entityFactory; - $this->seed = $this->entityFactory->create($entityName); - $this->entityClassName = get_class($this->seed); - $this->entityManager = $entityManager; - } - - protected function getMapper() - { - if (empty($this->mapper)) { - $this->mapper = $this->getEntityManager()->getMapper(self::$mapperClassName); - } - return $this->mapper; - } - - public function handleSelectParams(&$params) - { - } - - protected function getEntityFactory() - { - return $this->entityFactory; - } - - protected function getEntityManager() - { - return $this->entityManager; - } - - public function reset() - { - $this->whereClause = array(); - $this->listParams = array(); - } - - protected function getNewEntity() - { - $entity = $this->entityFactory->create($this->entityName); - if ($entity) { - $entity->setIsNew(true); - $entity->populateDefaults(); - return $entity; - } - } - - protected function getEntityById($id) - { - $params = array(); - $this->handleSelectParams($params); - - $entity = $this->entityFactory->create($this->entityName); - if ($entity) { - if ($this->getMapper()->selectById($entity, $id, $params)) { - $entity->setAsFetched(); - return $entity; - } - } - return null; - } - - public function get($id = null) - { - if (empty($id)) { - return $this->getNewEntity(); - } - return $this->getEntityById($id); - } - - protected function beforeSave(Entity $entity) - { - } - - protected function afterSave(Entity $entity) - { - } - - public function save(Entity $entity) - { - $this->beforeSave($entity); - if ($entity->isNew()) { - $result = $this->getMapper()->insert($entity); - if ($result) { - $entity->setIsNew(false); - } - } else { - $result = $this->getMapper()->update($entity); - } - if ($result) { - $this->afterSave($entity); - } - return $result; - } - - protected function beforeRemove(Entity $entity) - { - } - - protected function afterRemove(Entity $entity) - { - } - - public function remove(Entity $entity) - { - $this->beforeRemove($entity); - $result = $this->getMapper()->delete($entity); - if ($result) { - $this->afterRemove($entity); - } - return $result; - } - - public function deleteFromDb($id) - { - return $this->getMapper()->deleteFromDb($this->entityName, $id); - } + /** + * @var array Parameters to be used in further find operations. + */ + protected $listParams = array(); + + public function __construct($entityName, EntityManager $entityManager, EntityFactory $entityFactory) + { + $this->entityName = $entityName; + $this->entityFactory = $entityFactory; + $this->seed = $this->entityFactory->create($entityName); + $this->entityClassName = get_class($this->seed); + $this->entityManager = $entityManager; + } + + protected function getMapper() + { + if (empty($this->mapper)) { + $this->mapper = $this->getEntityManager()->getMapper(self::$mapperClassName); + } + return $this->mapper; + } + + public function handleSelectParams(&$params) + { + } + + protected function getEntityFactory() + { + return $this->entityFactory; + } + + protected function getEntityManager() + { + return $this->entityManager; + } + + public function reset() + { + $this->whereClause = array(); + $this->listParams = array(); + } + + protected function getNewEntity() + { + $entity = $this->entityFactory->create($this->entityName); + if ($entity) { + $entity->setIsNew(true); + $entity->populateDefaults(); + return $entity; + } + } + + protected function getEntityById($id) + { + $params = array(); + $this->handleSelectParams($params); + + $entity = $this->entityFactory->create($this->entityName); + if ($entity) { + if ($this->getMapper()->selectById($entity, $id, $params)) { + $entity->setAsFetched(); + return $entity; + } + } + return null; + } + + public function get($id = null) + { + if (empty($id)) { + return $this->getNewEntity(); + } + return $this->getEntityById($id); + } + + protected function beforeSave(Entity $entity) + { + } + + protected function afterSave(Entity $entity) + { + } + + public function save(Entity $entity) + { + $this->beforeSave($entity); + if ($entity->isNew()) { + $result = $this->getMapper()->insert($entity); + if ($result) { + $entity->setIsNew(false); + } + } else { + $result = $this->getMapper()->update($entity); + } + if ($result) { + $this->afterSave($entity); + } + return $result; + } + + protected function beforeRemove(Entity $entity) + { + } + + protected function afterRemove(Entity $entity) + { + } + + public function remove(Entity $entity) + { + $this->beforeRemove($entity); + $result = $this->getMapper()->delete($entity); + if ($result) { + $this->afterRemove($entity); + } + return $result; + } + + public function deleteFromDb($id) + { + return $this->getMapper()->deleteFromDb($this->entityName, $id); + } - public function find(array $params = array()) - { - $this->handleSelectParams($params); - $params = $this->getSelectParams($params); + public function find(array $params = array()) + { + $this->handleSelectParams($params); + $params = $this->getSelectParams($params); - $dataArr = $this->getMapper()->select($this->seed, $params); - - $collection = new EntityCollection($dataArr, $this->entityName, $this->entityFactory); - $this->reset(); - - return $collection; - } - - public function findOne(array $params = array()) - { - $collection = $this->limit(0, 1)->find($params); - if (count($collection)) { - return $collection[0]; - } - return null; - } - - public function findRelated(Entity $entity, $relationName, array $params = array()) - { - $entityName = $entity->relations[$relationName]['entity']; - $this->getEntityManager()->getRepository($entityName)->handleSelectParams($params); - - $result = $this->getMapper()->selectRelated($entity, $relationName, $params); + $dataArr = $this->getMapper()->select($this->seed, $params); + + $collection = new EntityCollection($dataArr, $this->entityName, $this->entityFactory); + $this->reset(); + + return $collection; + } + + public function findOne(array $params = array()) + { + $collection = $this->limit(0, 1)->find($params); + if (count($collection)) { + return $collection[0]; + } + return null; + } + + public function findRelated(Entity $entity, $relationName, array $params = array()) + { + $entityName = $entity->relations[$relationName]['entity']; + $this->getEntityManager()->getRepository($entityName)->handleSelectParams($params); + + $result = $this->getMapper()->selectRelated($entity, $relationName, $params); - if (is_array($result)) { - $collection = new EntityCollection($result, $entityName, $this->entityFactory); - return $collection; - } else { - return $result; - } - - } - - public function countRelated(Entity $entity, $relationName, array $params = array()) - { - $entityName = $entity->relations[$relationName]['entity']; - $this->getEntityManager()->getRepository($entityName)->handleSelectParams($params); - - return $this->getMapper()->countRelated($entity, $relationName, $params); - } - - public function relate(Entity $entity, $relationName, $foreign, $data) - { - if ($data instanceof \stdClass) { - $data = get_object_vars($data); - } - if ($foreign instanceof Entity) { - return $this->getMapper()->relate($entity, $relationName, $foreign, $data); - } - if (is_string($foreign)) { - return $this->getMapper()->addRelation($entity, $relationName, $foreign, null, $data); - } - return false; - } - - public function unrelate(Entity $entity, $relationName, $foreign) - { - if ($foreign instanceof Entity) { - return $this->getMapper()->unrelate($entity, $relationName, $foreign); - } - if (is_string($foreign)) { - return $this->getMapper()->removeRelation($entity, $relationName, $foreign); - } - if ($foreign === true) { - return $this->getMapper()->removeAllRelations($entity, $relationName); - } - return false; - } - - public function updateRelation(Entity $entity, $relationName, $foreign, $data) - { - if ($data instanceof \stdClass) { - $data = get_object_vars($data); - } - if ($foreign instanceof Entity) { - $id = $foreign->id; - } else { - $id = $foreign; - } - if (is_string($foreign)) { - return $this->getMapper()->updateRelation($entity, $relationName, $id, $data); - } - return false; - } - - - public function getAll() - { - $this->reset(); - return $this->find(); - } - - public function count(array $params = array()) - { - $this->handleSelectParams($params); - - $params = $this->getSelectParams($params); - return $this->getMapper()->count($this->seed, $params); - } - - public function max($field) - { - $params = $this->getSelectParams(); - return $this->getMapper()->max($this->seed, $params, $field); - } - - public function min($field) - { - $params = $this->getSelectParams(); - return $this->getMapper()->min($this->seed, $params, $field); - } - - public function sum($field) - { - $params = $this->getSelectParams(); - return $this->getMapper()->sum($this->seed, $params, $field); - } + if (is_array($result)) { + $collection = new EntityCollection($result, $entityName, $this->entityFactory); + return $collection; + } else { + return $result; + } + + } + + public function countRelated(Entity $entity, $relationName, array $params = array()) + { + $entityName = $entity->relations[$relationName]['entity']; + $this->getEntityManager()->getRepository($entityName)->handleSelectParams($params); + + return $this->getMapper()->countRelated($entity, $relationName, $params); + } + + public function relate(Entity $entity, $relationName, $foreign, $data) + { + if ($data instanceof \stdClass) { + $data = get_object_vars($data); + } + if ($foreign instanceof Entity) { + return $this->getMapper()->relate($entity, $relationName, $foreign, $data); + } + if (is_string($foreign)) { + return $this->getMapper()->addRelation($entity, $relationName, $foreign, null, $data); + } + return false; + } + + public function unrelate(Entity $entity, $relationName, $foreign) + { + if ($foreign instanceof Entity) { + return $this->getMapper()->unrelate($entity, $relationName, $foreign); + } + if (is_string($foreign)) { + return $this->getMapper()->removeRelation($entity, $relationName, $foreign); + } + if ($foreign === true) { + return $this->getMapper()->removeAllRelations($entity, $relationName); + } + return false; + } + + public function updateRelation(Entity $entity, $relationName, $foreign, $data) + { + if ($data instanceof \stdClass) { + $data = get_object_vars($data); + } + if ($foreign instanceof Entity) { + $id = $foreign->id; + } else { + $id = $foreign; + } + if (is_string($foreign)) { + return $this->getMapper()->updateRelation($entity, $relationName, $id, $data); + } + return false; + } + + + public function getAll() + { + $this->reset(); + return $this->find(); + } + + public function count(array $params = array()) + { + $this->handleSelectParams($params); + + $params = $this->getSelectParams($params); + return $this->getMapper()->count($this->seed, $params); + } + + public function max($field) + { + $params = $this->getSelectParams(); + return $this->getMapper()->max($this->seed, $params, $field); + } + + public function min($field) + { + $params = $this->getSelectParams(); + return $this->getMapper()->min($this->seed, $params, $field); + } + + public function sum($field) + { + $params = $this->getSelectParams(); + return $this->getMapper()->sum($this->seed, $params, $field); + } - // @TODO use abstract class for list params - // @TODO join conditions - public function join() - { - $args = func_get_args(); - - if (empty($this->listParams['joins'])) { - $this->listParams['joins'] = array(); - } - - foreach ($args as &$param) { - if (is_array($param)) { - foreach ($param as $k => $v) { - $this->listParams['joins'][] = $v; - } - } else { - $this->listParams['joins'][] = $param; - } - } - - return $this; - } - - public function distinct() - { - $this->listParams['distinct'] = true; - return $this; - } - - public function where($param1 = array(), $param2 = null) - { - if (is_array($param1)) { - $this->whereClause = $param1 + $this->whereClause; - - } else { - if (!is_null($param2)) { - $this->whereClause[$param1] = $param2; - } - } - - return $this; - } - - public function order($field = 'id', $direction = "ASC") - { - $this->listParams['orderBy'] = $field; - $this->listParams['order'] = $direction; - - return $this; - } - - public function limit($offset, $limit) - { - $this->listParams['offset'] = $offset; - $this->listParams['limit'] = $limit; - - return $this; - } - - public function setListParams(array $params = array()) - { - $this->listParams = $params; - } - - public function getListParams() - { - return $this->listParams; - } - - protected function getSelectParams(array $params = array()) - { - if (isset($params['whereClause'])) { - $params['whereClause'] = $params['whereClause'] + $this->whereClause; - } else { - $params['whereClause'] = $this->whereClause; - } - $params = $params + $this->listParams; - - return $params; - } - - protected function getPDO() - { - return $this->getEntityManager()->getPDO(); - } + // @TODO use abstract class for list params + // @TODO join conditions + public function join() + { + $args = func_get_args(); + + if (empty($this->listParams['joins'])) { + $this->listParams['joins'] = array(); + } + + foreach ($args as &$param) { + if (is_array($param)) { + foreach ($param as $k => $v) { + $this->listParams['joins'][] = $v; + } + } else { + $this->listParams['joins'][] = $param; + } + } + + return $this; + } + + public function distinct() + { + $this->listParams['distinct'] = true; + return $this; + } + + public function where($param1 = array(), $param2 = null) + { + if (is_array($param1)) { + $this->whereClause = $param1 + $this->whereClause; + + } else { + if (!is_null($param2)) { + $this->whereClause[$param1] = $param2; + } + } + + return $this; + } + + public function order($field = 'id', $direction = "ASC") + { + $this->listParams['orderBy'] = $field; + $this->listParams['order'] = $direction; + + return $this; + } + + public function limit($offset, $limit) + { + $this->listParams['offset'] = $offset; + $this->listParams['limit'] = $limit; + + return $this; + } + + public function setListParams(array $params = array()) + { + $this->listParams = $params; + } + + public function getListParams() + { + return $this->listParams; + } + + protected function getSelectParams(array $params = array()) + { + if (isset($params['whereClause'])) { + $params['whereClause'] = $params['whereClause'] + $this->whereClause; + } else { + $params['whereClause'] = $this->whereClause; + } + $params = $params + $this->listParams; + + return $params; + } + + protected function getPDO() + { + return $this->getEntityManager()->getPDO(); + } } diff --git a/application/Espo/ORM/Repository.php b/application/Espo/ORM/Repository.php index 9b9ee0d4ca..b20f469106 100644 --- a/application/Espo/ORM/Repository.php +++ b/application/Espo/ORM/Repository.php @@ -23,64 +23,64 @@ namespace Espo\ORM; abstract class Repository -{ - /** - * @var EntityFactory EntityFactory object. - */ - protected $entityFactory; - - /** - * @var EntityManager EntityManager object. - */ - protected $entityManager; - - - /** - * @var iModel Seed entity. - */ - protected $seed; - - /** - * @var string Class Name of aggregate root. - */ - protected $entityClassName; - - /** - * @var string Model Name of aggregate root. - */ - protected $entityName; - - public function __construct($entityName, EntityManager $entityManager, EntityFactory $entityFactory) - { - $this->entityName = $entityName; - $this->entityFactory = $entityFactory; - $this->seed = $this->entityFactory->create($entityName); - $this->entityClassName = get_class($this->seed); - $this->entityManager = $entityManager; - } - - protected function getEntityFactory() - { - return $this->entityFactory; - } - - protected function getEntityManager() - { - return $this->entityManager; - } - - abstract public function get($id = null); - - abstract public function save(Entity $entity); - - abstract public function remove(Entity $entity); +{ + /** + * @var EntityFactory EntityFactory object. + */ + protected $entityFactory; + + /** + * @var EntityManager EntityManager object. + */ + protected $entityManager; + + + /** + * @var iModel Seed entity. + */ + protected $seed; + + /** + * @var string Class Name of aggregate root. + */ + protected $entityClassName; + + /** + * @var string Model Name of aggregate root. + */ + protected $entityName; + + public function __construct($entityName, EntityManager $entityManager, EntityFactory $entityFactory) + { + $this->entityName = $entityName; + $this->entityFactory = $entityFactory; + $this->seed = $this->entityFactory->create($entityName); + $this->entityClassName = get_class($this->seed); + $this->entityManager = $entityManager; + } + + protected function getEntityFactory() + { + return $this->entityFactory; + } + + protected function getEntityManager() + { + return $this->entityManager; + } + + abstract public function get($id = null); + + abstract public function save(Entity $entity); + + abstract public function remove(Entity $entity); - abstract public function find(array $params); - - abstract public function findOne(array $params); + abstract public function find(array $params); + + abstract public function findOne(array $params); - abstract public function getAll(); - - abstract public function count(array $params); + abstract public function getAll(); + + abstract public function count(array $params); } diff --git a/application/Espo/ORM/RepositoryFactory.php b/application/Espo/ORM/RepositoryFactory.php index 13b7c1fdcb..b703d974c4 100644 --- a/application/Espo/ORM/RepositoryFactory.php +++ b/application/Espo/ORM/RepositoryFactory.php @@ -24,38 +24,38 @@ namespace Espo\ORM; class RepositoryFactory { - protected $entityFactroy; - - protected $entityManager; - - protected $defaultRepositoryClassName = '\\Espo\\ORM\\Repository'; + protected $entityFactroy; + + protected $entityManager; + + protected $defaultRepositoryClassName = '\\Espo\\ORM\\Repository'; - public function __construct(EntityManager $entityManager, EntityFactory $entityFactroy) - { - $this->entityManager = $entityManager; - $this->entityFactroy = $entityFactroy; - } - - public function create($name) - { - $className = $this->entityManager->normalizeRepositoryName($name); - - if (!class_exists($className)) { - $className = $this->defaultRepositoryClassName; - } - - $repository = new $className($name, $this->entityManager, $this->entityFactroy); - return $repository; - } - - protected function normalizeName($name) - { - return $name; - } - - public function setDefaultRepositoryClassName($defaultRepositoryClassName) - { - $this->defaultRepositoryClassName = $defaultRepositoryClassName; - } + public function __construct(EntityManager $entityManager, EntityFactory $entityFactroy) + { + $this->entityManager = $entityManager; + $this->entityFactroy = $entityFactroy; + } + + public function create($name) + { + $className = $this->entityManager->normalizeRepositoryName($name); + + if (!class_exists($className)) { + $className = $this->defaultRepositoryClassName; + } + + $repository = new $className($name, $this->entityManager, $this->entityFactroy); + return $repository; + } + + protected function normalizeName($name) + { + return $name; + } + + public function setDefaultRepositoryClassName($defaultRepositoryClassName) + { + $this->defaultRepositoryClassName = $defaultRepositoryClassName; + } } diff --git a/application/Espo/Repositories/Attachment.php b/application/Espo/Repositories/Attachment.php index d141af85c0..6e408b60fb 100644 --- a/application/Espo/Repositories/Attachment.php +++ b/application/Espo/Repositories/Attachment.php @@ -26,35 +26,35 @@ use Espo\ORM\Entity; class Attachment extends \Espo\Core\ORM\Repositories\RDB { - protected $dependencies = array( - 'fileManager', - ); - - protected function getFileManager() - { - return $this->getInjection('fileManager'); - } - - public function save(Entity $entity) - { - $isNew = $entity->isNew(); - $result = parent::save($entity); - - if ($isNew) { - if (!empty($entity->id) && $entity->has('contents')) { - $contents = $entity->get('contents'); - $this->getFileManager()->putContents('data/upload/' . $entity->id, $contents); - } - } - - return $result; - } - - protected function afterRemove(Entity $entity) - { - parent::afterRemove($entity); - $this->getFileManager()->removeFile('data/upload/' . $entity->id); - } + protected $dependencies = array( + 'fileManager', + ); + + protected function getFileManager() + { + return $this->getInjection('fileManager'); + } + + public function save(Entity $entity) + { + $isNew = $entity->isNew(); + $result = parent::save($entity); + + if ($isNew) { + if (!empty($entity->id) && $entity->has('contents')) { + $contents = $entity->get('contents'); + $this->getFileManager()->putContents('data/upload/' . $entity->id, $contents); + } + } + + return $result; + } + + protected function afterRemove(Entity $entity) + { + parent::afterRemove($entity); + $this->getFileManager()->removeFile('data/upload/' . $entity->id); + } } diff --git a/application/Espo/Repositories/Email.php b/application/Espo/Repositories/Email.php index 03d97b593a..2317b36361 100644 --- a/application/Espo/Repositories/Email.php +++ b/application/Espo/Repositories/Email.php @@ -25,69 +25,69 @@ namespace Espo\Repositories; use Espo\ORM\Entity; class Email extends \Espo\Core\ORM\Repositories\RDB -{ - protected function prepareAddressess(Entity $entity, $type) - { - $eaRepositoty = $this->getEntityManager()->getRepository('EmailAddress'); - - $address = $entity->get($type); - $ids = array(); - if (!empty($address) || !filter_var($address, FILTER_VALIDATE_EMAIL)) { - $arr = array_map(function ($e) { - return trim($e); - }, explode(';', $address)); - - $ids = $eaRepositoty->getIds($arr); - } - $entity->set($type . 'EmailAddressesIds', $ids); - } - - protected function beforeSave(Entity $entity) - { - $eaRepositoty = $this->getEntityManager()->getRepository('EmailAddress'); - - $from = trim($entity->get('from')); - if (!empty($from)) { - $ids = $eaRepositoty->getIds(array($from)); - if (!empty($ids)) { - $entity->set('fromEmailAddressId', $ids[0]); - } - } else { - $entity->set('fromEmailAddressId', null); - } - - $this->prepareAddressess($entity, 'to'); - $this->prepareAddressess($entity, 'cc'); - $this->prepareAddressess($entity, 'bcc'); - - parent::beforeSave($entity); - - $parentId = $entity->get('parentId'); - $parentType = $entity->get('parentType'); - if (!empty($parentId) || !empty($parentType)) { - $parent = $this->getEntityManager()->getEntity($parentType, $parentId); - if (!empty($parent)) { - if ($parent->getEntityName() == 'Account') { - $accountId = $parent->id; - } else if ($parent->has('accountId')) { - $accountId = $parent->get('accountId'); - } - if (!empty($accountId)) { - $entity->set('accountId', $accountId); - } - } - } else { - // TODO find account by from address - } - } - - protected function beforeRemove(Entity $entity) - { - parent::beforeRemove($entity); - $attachments = $entity->get('attachments'); - foreach ($attachments as $attachment) { - $this->getEntityManager()->removeEntity($attachment); - } - } +{ + protected function prepareAddressess(Entity $entity, $type) + { + $eaRepositoty = $this->getEntityManager()->getRepository('EmailAddress'); + + $address = $entity->get($type); + $ids = array(); + if (!empty($address) || !filter_var($address, FILTER_VALIDATE_EMAIL)) { + $arr = array_map(function ($e) { + return trim($e); + }, explode(';', $address)); + + $ids = $eaRepositoty->getIds($arr); + } + $entity->set($type . 'EmailAddressesIds', $ids); + } + + protected function beforeSave(Entity $entity) + { + $eaRepositoty = $this->getEntityManager()->getRepository('EmailAddress'); + + $from = trim($entity->get('from')); + if (!empty($from)) { + $ids = $eaRepositoty->getIds(array($from)); + if (!empty($ids)) { + $entity->set('fromEmailAddressId', $ids[0]); + } + } else { + $entity->set('fromEmailAddressId', null); + } + + $this->prepareAddressess($entity, 'to'); + $this->prepareAddressess($entity, 'cc'); + $this->prepareAddressess($entity, 'bcc'); + + parent::beforeSave($entity); + + $parentId = $entity->get('parentId'); + $parentType = $entity->get('parentType'); + if (!empty($parentId) || !empty($parentType)) { + $parent = $this->getEntityManager()->getEntity($parentType, $parentId); + if (!empty($parent)) { + if ($parent->getEntityName() == 'Account') { + $accountId = $parent->id; + } else if ($parent->has('accountId')) { + $accountId = $parent->get('accountId'); + } + if (!empty($accountId)) { + $entity->set('accountId', $accountId); + } + } + } else { + // TODO find account by from address + } + } + + protected function beforeRemove(Entity $entity) + { + parent::beforeRemove($entity); + $attachments = $entity->get('attachments'); + foreach ($attachments as $attachment) { + $this->getEntityManager()->removeEntity($attachment); + } + } } diff --git a/application/Espo/Repositories/EmailAddress.php b/application/Espo/Repositories/EmailAddress.php index 837b290a5a..088bb9e0a8 100644 --- a/application/Espo/Repositories/EmailAddress.php +++ b/application/Espo/Repositories/EmailAddress.php @@ -26,312 +26,312 @@ use Espo\ORM\Entity; class EmailAddress extends \Espo\Core\ORM\Repositories\RDB { - public function getIds($arr = array()) - { - $ids = array(); - if (!empty($arr)) { - $a = array_map(function ($item) { - return strtolower($item); - }, $arr); - $eas = $this->where(array( - 'lower' => array_map(function ($item) { - return strtolower($item); - }, $arr) - ))->find(); - $ids = array(); - $exist = array(); - foreach ($eas as $ea) { - $ids[] = $ea->id; - $exist[] = $ea->get('lower'); - } - foreach ($arr as $address) { - if (empty($address) || !filter_var($address, FILTER_VALIDATE_EMAIL)) { - continue; - } - if (!in_array(strtolower($address), $exist)) { - $ea = $this->get(); - $ea->set('name', $address); - $this->save($ea); - $ids[] = $ea->id; - } - } - } - return $ids; - } - - public function getEmailAddressData(Entity $entity) - { - $data = array(); - - $pdo = $this->getEntityManager()->getPDO(); - $sql = " - SELECT email_address.name, email_address.invalid, email_address.opt_out AS optOut, entity_email_address.primary - FROM entity_email_address - JOIN email_address ON email_address.id = entity_email_address.email_address_id AND email_address.deleted = 0 - WHERE - entity_email_address.entity_id = ".$pdo->quote($entity->id)." AND - entity_email_address.entity_type = ".$pdo->quote($entity->getEntityName())." AND - entity_email_address.deleted = 0 - ORDER BY entity_email_address.primary DESC - "; - $sth = $pdo->prepare($sql); - $sth->execute(); - if ($rows = $sth->fetchAll()) { - foreach ($rows as $row) { - $obj = new \StdClass(); - $obj->emailAddress = $row['name']; - $obj->primary = ($row['primary'] == '1') ? true : false; - $obj->optOut = ($row['optOut'] == '1') ? true : false; - $obj->invalid = ($row['invalid'] == '1') ? true : false; - $data[] = $obj; - } - } - - return $data; - } - - public function getByAddress($address) - { - return $this->where(array('lower' => strtolower($address)))->findOne(); - } - - public function getEntityByAddress($address) - { - $pdo = $this->getEntityManager()->getPDO(); - $sql = " - SELECT entity_email_address.entity_type AS 'entityType', entity_email_address.entity_id AS 'entityId' - FROM entity_email_address - JOIN email_address ON email_address.id = entity_email_address.email_address_id AND email_address.deleted = 0 - WHERE - email_address.lower = ".$pdo->quote(strtolower($address))." AND - entity_email_address.deleted = 0 - ORDER BY entity_email_address.primary DESC, FIELD(entity_email_address.entity_type, 'User', 'Contact', 'Lead', 'Account') - "; + public function getIds($arr = array()) + { + $ids = array(); + if (!empty($arr)) { + $a = array_map(function ($item) { + return strtolower($item); + }, $arr); + $eas = $this->where(array( + 'lower' => array_map(function ($item) { + return strtolower($item); + }, $arr) + ))->find(); + $ids = array(); + $exist = array(); + foreach ($eas as $ea) { + $ids[] = $ea->id; + $exist[] = $ea->get('lower'); + } + foreach ($arr as $address) { + if (empty($address) || !filter_var($address, FILTER_VALIDATE_EMAIL)) { + continue; + } + if (!in_array(strtolower($address), $exist)) { + $ea = $this->get(); + $ea->set('name', $address); + $this->save($ea); + $ids[] = $ea->id; + } + } + } + return $ids; + } + + public function getEmailAddressData(Entity $entity) + { + $data = array(); + + $pdo = $this->getEntityManager()->getPDO(); + $sql = " + SELECT email_address.name, email_address.invalid, email_address.opt_out AS optOut, entity_email_address.primary + FROM entity_email_address + JOIN email_address ON email_address.id = entity_email_address.email_address_id AND email_address.deleted = 0 + WHERE + entity_email_address.entity_id = ".$pdo->quote($entity->id)." AND + entity_email_address.entity_type = ".$pdo->quote($entity->getEntityName())." AND + entity_email_address.deleted = 0 + ORDER BY entity_email_address.primary DESC + "; + $sth = $pdo->prepare($sql); + $sth->execute(); + if ($rows = $sth->fetchAll()) { + foreach ($rows as $row) { + $obj = new \StdClass(); + $obj->emailAddress = $row['name']; + $obj->primary = ($row['primary'] == '1') ? true : false; + $obj->optOut = ($row['optOut'] == '1') ? true : false; + $obj->invalid = ($row['invalid'] == '1') ? true : false; + $data[] = $obj; + } + } + + return $data; + } + + public function getByAddress($address) + { + return $this->where(array('lower' => strtolower($address)))->findOne(); + } + + public function getEntityByAddress($address) + { + $pdo = $this->getEntityManager()->getPDO(); + $sql = " + SELECT entity_email_address.entity_type AS 'entityType', entity_email_address.entity_id AS 'entityId' + FROM entity_email_address + JOIN email_address ON email_address.id = entity_email_address.email_address_id AND email_address.deleted = 0 + WHERE + email_address.lower = ".$pdo->quote(strtolower($address))." AND + entity_email_address.deleted = 0 + ORDER BY entity_email_address.primary DESC, FIELD(entity_email_address.entity_type, 'User', 'Contact', 'Lead', 'Account') + "; - $sth = $pdo->prepare($sql); - $sth->execute(); - while ($row = $sth->fetch()) { - if (!empty($row['entityType']) && !empty($row['entityId'])) { - $entity = $this->getEntityManager()->getEntity($row['entityType'], $row['entityId']); - if ($entity) { - return $entity; - } - } - } - } - - public function storeEntityEmailAddress(Entity $entity) - { - $email = trim($entity->get('emailAddress')); - $emailAddressData = null; - - if ($entity->has('emailAddressData')) { - $emailAddressData = $entity->get('emailAddressData'); - } - - $pdo = $this->getEntityManager()->getPDO(); - - if ($emailAddressData !== null && is_array($emailAddressData)) { - $previousEmailAddressData = array(); - if (!$entity->isNew()) { - $previousEmailAddressData = $this->getEmailAddressData($entity); - } - - $hash = array(); - foreach ($emailAddressData as $row) { - $key = $row->emailAddress; - if (!empty($key)) { - $hash[$key] = array( - 'primary' => $row->primary ? true : false, - 'optOut' => $row->optOut ? true : false, - 'invalid' => $row->invalid ? true : false, - ); - } - } - - $hashPrev = array(); - foreach ($previousEmailAddressData as $row) { - $key = $row->emailAddress; - if (!empty($key)) { - $hashPrev[$key] = array( - 'primary' => $row->primary ? true : false, - 'optOut' => $row->optOut ? true : false, - 'invalid' => $row->invalid ? true : false, - ); - } - } - - $primary = false; - $toCreate = array(); - $toUpdate = array(); - $toRemove = array(); + $sth = $pdo->prepare($sql); + $sth->execute(); + while ($row = $sth->fetch()) { + if (!empty($row['entityType']) && !empty($row['entityId'])) { + $entity = $this->getEntityManager()->getEntity($row['entityType'], $row['entityId']); + if ($entity) { + return $entity; + } + } + } + } + + public function storeEntityEmailAddress(Entity $entity) + { + $email = trim($entity->get('emailAddress')); + $emailAddressData = null; + + if ($entity->has('emailAddressData')) { + $emailAddressData = $entity->get('emailAddressData'); + } + + $pdo = $this->getEntityManager()->getPDO(); + + if ($emailAddressData !== null && is_array($emailAddressData)) { + $previousEmailAddressData = array(); + if (!$entity->isNew()) { + $previousEmailAddressData = $this->getEmailAddressData($entity); + } + + $hash = array(); + foreach ($emailAddressData as $row) { + $key = $row->emailAddress; + if (!empty($key)) { + $hash[$key] = array( + 'primary' => $row->primary ? true : false, + 'optOut' => $row->optOut ? true : false, + 'invalid' => $row->invalid ? true : false, + ); + } + } + + $hashPrev = array(); + foreach ($previousEmailAddressData as $row) { + $key = $row->emailAddress; + if (!empty($key)) { + $hashPrev[$key] = array( + 'primary' => $row->primary ? true : false, + 'optOut' => $row->optOut ? true : false, + 'invalid' => $row->invalid ? true : false, + ); + } + } + + $primary = false; + $toCreate = array(); + $toUpdate = array(); + $toRemove = array(); - - foreach ($hash as $key => $data) { - $new = true; - $changed = false; - - if ($hash[$key]['primary']) { - $primary = $key; - } - - if (array_key_exists($key, $hashPrev)) { - $new = false; - $changed = $hash[$key]['optOut'] != $hashPrev[$key]['optOut'] || $hash[$key]['invalid'] != $hashPrev[$key]['invalid']; - if ($hash[$key]['primary']) { - if ($hash[$key]['primary'] == $hashPrev[$key]['primary']) { - $primary = false; - } - } - } - - if ($new) { - $toCreate[] = $key; - } - if ($changed) { - $toUpdate[] = $key; - } - } - - foreach ($hashPrev as $key => $data) { - if (!array_key_exists($key, $hash)) { - $toRemove[] = $key; - } - } - - foreach ($toRemove as $address) { - $emailAddress = $this->getByAddress($address); - if ($emailAddress) { - $query = " - UPDATE entity_email_address - SET `deleted` = 1, `primary` = 0 - WHERE - entity_id = ".$pdo->quote($entity->id)." AND - entity_type = ".$pdo->quote($entity->getEntityName())." AND - email_address_id = ".$pdo->quote($emailAddress->id)." - "; - $sth = $pdo->prepare($query); - $sth->execute(); - } - } - - foreach ($toUpdate as $address) { - $emailAddress = $this->getByAddress($address); - if ($emailAddress) { - $emailAddress->set(array( - 'optOut' => $hash[$address]['optOut'], - 'invalid' => $hash[$address]['invalid'], - )); - $this->save($emailAddress); - } - } - - foreach ($toCreate as $address) { - $emailAddress = $this->getByAddress($address); - if (!$emailAddress) { - $emailAddress = $this->get(); - - $emailAddress->set(array( - 'name' => $address, - 'optOut' => $hash[$address]['optOut'], - 'invalid' => $hash[$address]['invalid'], - )); - $this->save($emailAddress); - } else { - if ($emailAddress->get('optOut') != $hash[$address]['optOut'] || $emailAddress->get('invalid') != $hash[$address]['invalid']) { - $emailAddress->set(array( - 'optOut' => $hash[$address]['optOut'], - 'invalid' => $hash[$address]['invalid'], - )); - $this->save($emailAddress); - } - } - - $query = " - INSERT entity_email_address - (entity_id, entity_type, email_address_id, `primary`) - VALUES - ( - ".$pdo->quote($entity->id).", - ".$pdo->quote($entity->getEntityName()).", - ".$pdo->quote($emailAddress->id).", - ".$pdo->quote($address === $primary)." - ) - "; - $sth = $pdo->prepare($query); - $sth->execute(); - } - - if ($primary) { - $emailAddress = $this->getByAddress($primary); - if ($emailAddress) { - $query = " - UPDATE entity_email_address - SET `primary` = 0 - WHERE - entity_id = ".$pdo->quote($entity->id)." AND - entity_type = ".$pdo->quote($entity->getEntityName())." AND - `primary` = 1 AND - deleted = 0 - "; - $sth = $pdo->prepare($query); - $sth->execute(); - - $query = " - UPDATE entity_email_address - SET `primary` = 1 - WHERE - entity_id = ".$pdo->quote($entity->id)." AND - entity_type = ".$pdo->quote($entity->getEntityName())." AND - email_address_id = ".$pdo->quote($emailAddress->id)." AND - deleted = 0 - "; - $sth = $pdo->prepare($query); - $sth->execute(); - } - } - - - } else { - $entityRepository = $this->getEntityManager()->getRepository($entity->getEntityName()); - if (!empty($email)) { - if ($email != $entity->getFetched('emailAddress')) { + + foreach ($hash as $key => $data) { + $new = true; + $changed = false; + + if ($hash[$key]['primary']) { + $primary = $key; + } + + if (array_key_exists($key, $hashPrev)) { + $new = false; + $changed = $hash[$key]['optOut'] != $hashPrev[$key]['optOut'] || $hash[$key]['invalid'] != $hashPrev[$key]['invalid']; + if ($hash[$key]['primary']) { + if ($hash[$key]['primary'] == $hashPrev[$key]['primary']) { + $primary = false; + } + } + } + + if ($new) { + $toCreate[] = $key; + } + if ($changed) { + $toUpdate[] = $key; + } + } + + foreach ($hashPrev as $key => $data) { + if (!array_key_exists($key, $hash)) { + $toRemove[] = $key; + } + } + + foreach ($toRemove as $address) { + $emailAddress = $this->getByAddress($address); + if ($emailAddress) { + $query = " + UPDATE entity_email_address + SET `deleted` = 1, `primary` = 0 + WHERE + entity_id = ".$pdo->quote($entity->id)." AND + entity_type = ".$pdo->quote($entity->getEntityName())." AND + email_address_id = ".$pdo->quote($emailAddress->id)." + "; + $sth = $pdo->prepare($query); + $sth->execute(); + } + } + + foreach ($toUpdate as $address) { + $emailAddress = $this->getByAddress($address); + if ($emailAddress) { + $emailAddress->set(array( + 'optOut' => $hash[$address]['optOut'], + 'invalid' => $hash[$address]['invalid'], + )); + $this->save($emailAddress); + } + } + + foreach ($toCreate as $address) { + $emailAddress = $this->getByAddress($address); + if (!$emailAddress) { + $emailAddress = $this->get(); + + $emailAddress->set(array( + 'name' => $address, + 'optOut' => $hash[$address]['optOut'], + 'invalid' => $hash[$address]['invalid'], + )); + $this->save($emailAddress); + } else { + if ($emailAddress->get('optOut') != $hash[$address]['optOut'] || $emailAddress->get('invalid') != $hash[$address]['invalid']) { + $emailAddress->set(array( + 'optOut' => $hash[$address]['optOut'], + 'invalid' => $hash[$address]['invalid'], + )); + $this->save($emailAddress); + } + } + + $query = " + INSERT entity_email_address + (entity_id, entity_type, email_address_id, `primary`) + VALUES + ( + ".$pdo->quote($entity->id).", + ".$pdo->quote($entity->getEntityName()).", + ".$pdo->quote($emailAddress->id).", + ".$pdo->quote($address === $primary)." + ) + "; + $sth = $pdo->prepare($query); + $sth->execute(); + } + + if ($primary) { + $emailAddress = $this->getByAddress($primary); + if ($emailAddress) { + $query = " + UPDATE entity_email_address + SET `primary` = 0 + WHERE + entity_id = ".$pdo->quote($entity->id)." AND + entity_type = ".$pdo->quote($entity->getEntityName())." AND + `primary` = 1 AND + deleted = 0 + "; + $sth = $pdo->prepare($query); + $sth->execute(); + + $query = " + UPDATE entity_email_address + SET `primary` = 1 + WHERE + entity_id = ".$pdo->quote($entity->id)." AND + entity_type = ".$pdo->quote($entity->getEntityName())." AND + email_address_id = ".$pdo->quote($emailAddress->id)." AND + deleted = 0 + "; + $sth = $pdo->prepare($query); + $sth->execute(); + } + } + + + } else { + $entityRepository = $this->getEntityManager()->getRepository($entity->getEntityName()); + if (!empty($email)) { + if ($email != $entity->getFetched('emailAddress')) { - $emailAddressNew = $this->where(array('lower' => strtolower($email)))->findOne(); - $isNewEmailAddress = false; - if (!$emailAddressNew) { - $emailAddressNew = $this->get(); - $emailAddressNew->set('name', $email); - $this->save($emailAddressNew); - $isNewEmailAddress = true; - } + $emailAddressNew = $this->where(array('lower' => strtolower($email)))->findOne(); + $isNewEmailAddress = false; + if (!$emailAddressNew) { + $emailAddressNew = $this->get(); + $emailAddressNew->set('name', $email); + $this->save($emailAddressNew); + $isNewEmailAddress = true; + } - $emailOld = $entity->getFetched('emailAddress'); - if (!empty($emailOld)) { - $emailAddressOld = $this->getByAddress($emailOld); - $entityRepository->unrelate($entity, 'emailAddresses', $emailAddressOld); - } - $entityRepository->relate($entity, 'emailAddresses', $emailAddressNew); + $emailOld = $entity->getFetched('emailAddress'); + if (!empty($emailOld)) { + $emailAddressOld = $this->getByAddress($emailOld); + $entityRepository->unrelate($entity, 'emailAddresses', $emailAddressOld); + } + $entityRepository->relate($entity, 'emailAddresses', $emailAddressNew); - $query = " - UPDATE entity_email_address - SET `primary` = 1 - WHERE - entity_id = ".$pdo->quote($entity->id)." AND - entity_type = ".$pdo->quote($entity->getEntityName())." AND - email_address_id = ".$pdo->quote($emailAddressNew->id)." - "; - $sth = $pdo->prepare($query); - $sth->execute(); - } - } else { - $emailOld = $entity->getFetched('emailAddress'); - if (!empty($emailOld)) { - $emailAddressOld = $this->getByAddress($emailOld); - $entityRepository->unrelate($entity, 'emailAddresses', $emailAddressOld); - } - } - } - } + $query = " + UPDATE entity_email_address + SET `primary` = 1 + WHERE + entity_id = ".$pdo->quote($entity->id)." AND + entity_type = ".$pdo->quote($entity->getEntityName())." AND + email_address_id = ".$pdo->quote($emailAddressNew->id)." + "; + $sth = $pdo->prepare($query); + $sth->execute(); + } + } else { + $emailOld = $entity->getFetched('emailAddress'); + if (!empty($emailOld)) { + $emailAddressOld = $this->getByAddress($emailOld); + $entityRepository->unrelate($entity, 'emailAddresses', $emailAddressOld); + } + } + } + } } diff --git a/application/Espo/Repositories/ExternalAccount.php b/application/Espo/Repositories/ExternalAccount.php index 1f029ab73c..a010221b20 100644 --- a/application/Espo/Repositories/ExternalAccount.php +++ b/application/Espo/Repositories/ExternalAccount.php @@ -26,14 +26,14 @@ use Espo\ORM\Entity; class ExternalAccount extends \Espo\Core\ORM\Repositories\RDB { - public function get($id = null) - { - $entity = parent::get($id); - if (empty($entity) && !empty($id)) { - $entity = $this->get(); - $entity->id = $id; - } - return $entity; - } + public function get($id = null) + { + $entity = parent::get($id); + if (empty($entity) && !empty($id)) { + $entity = $this->get(); + $entity->id = $id; + } + return $entity; + } } diff --git a/application/Espo/Repositories/Integration.php b/application/Espo/Repositories/Integration.php index 63840582f9..47c06f8cc9 100644 --- a/application/Espo/Repositories/Integration.php +++ b/application/Espo/Repositories/Integration.php @@ -26,14 +26,14 @@ use Espo\ORM\Entity; class Integration extends \Espo\Core\ORM\Repositories\RDB { - public function get($id = null) - { - $entity = parent::get($id); - if (empty($entity) && !empty($id)) { - $entity = $this->get(); - $entity->id = $id; - } - return $entity; - } + public function get($id = null) + { + $entity = parent::get($id); + if (empty($entity) && !empty($id)) { + $entity = $this->get(); + $entity->id = $id; + } + return $entity; + } } diff --git a/application/Espo/Repositories/PhoneNumber.php b/application/Espo/Repositories/PhoneNumber.php index ad079a05f6..8f5ff2e668 100644 --- a/application/Espo/Repositories/PhoneNumber.php +++ b/application/Espo/Repositories/PhoneNumber.php @@ -26,286 +26,286 @@ use Espo\ORM\Entity; class PhoneNumber extends \Espo\Core\ORM\Repositories\RDB { - public function getIds($arr = array()) - { - $ids = array(); - if (!empty($arr)) { - $a = array_map(function ($item) { - return $item; - }, $arr); - $phoneNumbers = $this->where(array( - 'name' => array_map(function ($item) { - return $item; - }, $arr) - ))->find(); - $ids = array(); - $exist = array(); - foreach ($phoneNumbers as $phoneNumber) { - $ids[] = $phoneNumber->id; - $exist[] = $phoneNumber->get('name'); - } - foreach ($arr as $phone) { - if (empty($phone)) { - continue; - } - if (!in_array($phone, $exist)) { - $phoneNumber = $this->get(); - $phoneNumber->set('name', $phone); - $this->save($phoneNumber); - $ids[] = $phoneNumber->id; - } - } - } - return $ids; - } - - public function getPhoneNumberData(Entity $entity) - { - $data = array(); - - $pdo = $this->getEntityManager()->getPDO(); - $sql = " - SELECT phone_number.name, phone_number.type, entity_phone_number.primary - FROM entity_phone_number - JOIN phone_number ON phone_number.id = entity_phone_number.phone_number_id AND phone_number.deleted = 0 - WHERE - entity_phone_number.entity_id = ".$pdo->quote($entity->id)." AND - entity_phone_number.entity_type = ".$pdo->quote($entity->getEntityName())." AND - entity_phone_number.deleted = 0 - ORDER BY entity_phone_number.primary DESC - "; - $sth = $pdo->prepare($sql); - $sth->execute(); - if ($rows = $sth->fetchAll()) { - foreach ($rows as $row) { - $obj = new \StdClass(); - $obj->phoneNumber = $row['name']; - $obj->primary = ($row['primary'] == '1') ? true : false; - $obj->type = $row['type']; - - $data[] = $obj; - } - } - - return $data; - } - - public function getByNumber($number) - { - return $this->where(array('name' => $number))->findOne(); - } - - public function storeEntityPhoneNumber(Entity $entity) - { - $phone = trim($entity->get('phoneNumber')); - $phoneNumberData = null; - - if ($entity->has('phoneNumberData')) { - $phoneNumberData = $entity->get('phoneNumberData'); - } - - $pdo = $this->getEntityManager()->getPDO(); - - if ($phoneNumberData !== null && is_array($phoneNumberData)) { - $previousPhoneNumberData = array(); - if (!$entity->isNew()) { - $previousPhoneNumberData = $this->getPhoneNumberData($entity); - } - - $hash = array(); - foreach ($phoneNumberData as $row) { - $key = $row->phoneNumber; - if (!empty($key)) { - $hash[$key] = array( - 'primary' => $row->primary ? true : false, - 'type' => $row->type, - ); - } - } - - $hashPrev = array(); - foreach ($previousPhoneNumberData as $row) { - $key = $row->phoneNumber; - if (!empty($key)) { - $hashPrev[$key] = array( - 'primary' => $row->primary ? true : false, - 'type' => $row->type, - ); - } - } - - $primary = false; - $toCreate = array(); - $toUpdate = array(); - $toRemove = array(); + public function getIds($arr = array()) + { + $ids = array(); + if (!empty($arr)) { + $a = array_map(function ($item) { + return $item; + }, $arr); + $phoneNumbers = $this->where(array( + 'name' => array_map(function ($item) { + return $item; + }, $arr) + ))->find(); + $ids = array(); + $exist = array(); + foreach ($phoneNumbers as $phoneNumber) { + $ids[] = $phoneNumber->id; + $exist[] = $phoneNumber->get('name'); + } + foreach ($arr as $phone) { + if (empty($phone)) { + continue; + } + if (!in_array($phone, $exist)) { + $phoneNumber = $this->get(); + $phoneNumber->set('name', $phone); + $this->save($phoneNumber); + $ids[] = $phoneNumber->id; + } + } + } + return $ids; + } + + public function getPhoneNumberData(Entity $entity) + { + $data = array(); + + $pdo = $this->getEntityManager()->getPDO(); + $sql = " + SELECT phone_number.name, phone_number.type, entity_phone_number.primary + FROM entity_phone_number + JOIN phone_number ON phone_number.id = entity_phone_number.phone_number_id AND phone_number.deleted = 0 + WHERE + entity_phone_number.entity_id = ".$pdo->quote($entity->id)." AND + entity_phone_number.entity_type = ".$pdo->quote($entity->getEntityName())." AND + entity_phone_number.deleted = 0 + ORDER BY entity_phone_number.primary DESC + "; + $sth = $pdo->prepare($sql); + $sth->execute(); + if ($rows = $sth->fetchAll()) { + foreach ($rows as $row) { + $obj = new \StdClass(); + $obj->phoneNumber = $row['name']; + $obj->primary = ($row['primary'] == '1') ? true : false; + $obj->type = $row['type']; + + $data[] = $obj; + } + } + + return $data; + } + + public function getByNumber($number) + { + return $this->where(array('name' => $number))->findOne(); + } + + public function storeEntityPhoneNumber(Entity $entity) + { + $phone = trim($entity->get('phoneNumber')); + $phoneNumberData = null; + + if ($entity->has('phoneNumberData')) { + $phoneNumberData = $entity->get('phoneNumberData'); + } + + $pdo = $this->getEntityManager()->getPDO(); + + if ($phoneNumberData !== null && is_array($phoneNumberData)) { + $previousPhoneNumberData = array(); + if (!$entity->isNew()) { + $previousPhoneNumberData = $this->getPhoneNumberData($entity); + } + + $hash = array(); + foreach ($phoneNumberData as $row) { + $key = $row->phoneNumber; + if (!empty($key)) { + $hash[$key] = array( + 'primary' => $row->primary ? true : false, + 'type' => $row->type, + ); + } + } + + $hashPrev = array(); + foreach ($previousPhoneNumberData as $row) { + $key = $row->phoneNumber; + if (!empty($key)) { + $hashPrev[$key] = array( + 'primary' => $row->primary ? true : false, + 'type' => $row->type, + ); + } + } + + $primary = false; + $toCreate = array(); + $toUpdate = array(); + $toRemove = array(); - - foreach ($hash as $key => $data) { - $new = true; - $changed = false; - - if ($hash[$key]['primary']) { - $primary = $key; - } - - if (array_key_exists($key, $hashPrev)) { - $new = false; - $changed = $hash[$key]['type'] != $hashPrev[$key]['type']; - if ($hash[$key]['primary']) { - if ($hash[$key]['primary'] == $hashPrev[$key]['primary']) { - $primary = false; - } - } - } - - if ($new) { - $toCreate[] = $key; - } - if ($changed) { - $toUpdate[] = $key; - } - } - - foreach ($hashPrev as $key => $data) { - if (!array_key_exists($key, $hash)) { - $toRemove[] = $key; - } - } - - foreach ($toRemove as $number) { - $phoneNumber = $this->getByNumber($number); - if ($phoneNumber) { - $query = " - UPDATE entity_phone_number - SET `deleted` = 1, `primary` = 0 - WHERE - entity_id = ".$pdo->quote($entity->id)." AND - entity_type = ".$pdo->quote($entity->getEntityName())." AND - phone_number_id = ".$pdo->quote($phoneNumber->id)." - "; - $sth = $pdo->prepare($query); - $sth->execute(); - } - } - - foreach ($toUpdate as $number) { - $phoneNumber = $this->getByNumber($number); - if ($phoneNumber) { - $phoneNumber->set(array( - 'type' => $hash[$number]['type'], - )); - $this->save($phoneNumber); - } - } - - foreach ($toCreate as $number) { - $phoneNumber = $this->getByNumber($number); - if (!$phoneNumber) { - $phoneNumber = $this->get(); - - $phoneNumber->set(array( - 'name' => $number, - 'type' => $hash[$number]['type'], - )); - $this->save($phoneNumber); - } else { - if ($phoneNumber->get('type') != $hash[$number]['type']) { - $phoneNumber->set(array( - 'type' => $hash[$number]['type'], - )); - $this->save($phoneNumber); - } - } - - $query = " - INSERT entity_phone_number - (entity_id, entity_type, phone_number_id, `primary`) - VALUES - ( - ".$pdo->quote($entity->id).", - ".$pdo->quote($entity->getEntityName()).", - ".$pdo->quote($phoneNumber->id).", - ".$pdo->quote($number === $primary)." - ) - "; - $sth = $pdo->prepare($query); - $sth->execute(); - } - - if ($primary) { - $phoneNumber = $this->getByNumber($primary); - if ($phoneNumber) { - $query = " - UPDATE entity_phone_number - SET `primary` = 0 - WHERE - entity_id = ".$pdo->quote($entity->id)." AND - entity_type = ".$pdo->quote($entity->getEntityName())." AND - `primary` = 1 AND - deleted = 0 - "; - $sth = $pdo->prepare($query); - $sth->execute(); - - $query = " - UPDATE entity_phone_number - SET `primary` = 1 - WHERE - entity_id = ".$pdo->quote($entity->id)." AND - entity_type = ".$pdo->quote($entity->getEntityName())." AND - phone_number_id = ".$pdo->quote($phoneNumber->id)." AND - deleted = 0 - "; - $sth = $pdo->prepare($query); - $sth->execute(); - } - } - - - } else { - $entityRepository = $this->getEntityManager()->getRepository($entity->getEntityName()); - if (!empty($phone)) { - if ($phone != $entity->getFetched('phoneNumber')) { + + foreach ($hash as $key => $data) { + $new = true; + $changed = false; + + if ($hash[$key]['primary']) { + $primary = $key; + } + + if (array_key_exists($key, $hashPrev)) { + $new = false; + $changed = $hash[$key]['type'] != $hashPrev[$key]['type']; + if ($hash[$key]['primary']) { + if ($hash[$key]['primary'] == $hashPrev[$key]['primary']) { + $primary = false; + } + } + } + + if ($new) { + $toCreate[] = $key; + } + if ($changed) { + $toUpdate[] = $key; + } + } + + foreach ($hashPrev as $key => $data) { + if (!array_key_exists($key, $hash)) { + $toRemove[] = $key; + } + } + + foreach ($toRemove as $number) { + $phoneNumber = $this->getByNumber($number); + if ($phoneNumber) { + $query = " + UPDATE entity_phone_number + SET `deleted` = 1, `primary` = 0 + WHERE + entity_id = ".$pdo->quote($entity->id)." AND + entity_type = ".$pdo->quote($entity->getEntityName())." AND + phone_number_id = ".$pdo->quote($phoneNumber->id)." + "; + $sth = $pdo->prepare($query); + $sth->execute(); + } + } + + foreach ($toUpdate as $number) { + $phoneNumber = $this->getByNumber($number); + if ($phoneNumber) { + $phoneNumber->set(array( + 'type' => $hash[$number]['type'], + )); + $this->save($phoneNumber); + } + } + + foreach ($toCreate as $number) { + $phoneNumber = $this->getByNumber($number); + if (!$phoneNumber) { + $phoneNumber = $this->get(); + + $phoneNumber->set(array( + 'name' => $number, + 'type' => $hash[$number]['type'], + )); + $this->save($phoneNumber); + } else { + if ($phoneNumber->get('type') != $hash[$number]['type']) { + $phoneNumber->set(array( + 'type' => $hash[$number]['type'], + )); + $this->save($phoneNumber); + } + } + + $query = " + INSERT entity_phone_number + (entity_id, entity_type, phone_number_id, `primary`) + VALUES + ( + ".$pdo->quote($entity->id).", + ".$pdo->quote($entity->getEntityName()).", + ".$pdo->quote($phoneNumber->id).", + ".$pdo->quote($number === $primary)." + ) + "; + $sth = $pdo->prepare($query); + $sth->execute(); + } + + if ($primary) { + $phoneNumber = $this->getByNumber($primary); + if ($phoneNumber) { + $query = " + UPDATE entity_phone_number + SET `primary` = 0 + WHERE + entity_id = ".$pdo->quote($entity->id)." AND + entity_type = ".$pdo->quote($entity->getEntityName())." AND + `primary` = 1 AND + deleted = 0 + "; + $sth = $pdo->prepare($query); + $sth->execute(); + + $query = " + UPDATE entity_phone_number + SET `primary` = 1 + WHERE + entity_id = ".$pdo->quote($entity->id)." AND + entity_type = ".$pdo->quote($entity->getEntityName())." AND + phone_number_id = ".$pdo->quote($phoneNumber->id)." AND + deleted = 0 + "; + $sth = $pdo->prepare($query); + $sth->execute(); + } + } + + + } else { + $entityRepository = $this->getEntityManager()->getRepository($entity->getEntityName()); + if (!empty($phone)) { + if ($phone != $entity->getFetched('phoneNumber')) { - $phoneNumberNew = $this->where(array('name' => $phone))->findOne(); - $isNewPhoneNumber = false; - if (!$phoneNumberNew) { - $phoneNumberNew = $this->get(); - $phoneNumberNew->set('name', $phone); - $defaultType = $this->getEntityManager()->getEspoMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields.phoneNumber.defaultType'); - - $phoneNumberNew->set('type', $defaultType); - - $this->save($phoneNumberNew); - $isNewPhoneNumber = true; - } + $phoneNumberNew = $this->where(array('name' => $phone))->findOne(); + $isNewPhoneNumber = false; + if (!$phoneNumberNew) { + $phoneNumberNew = $this->get(); + $phoneNumberNew->set('name', $phone); + $defaultType = $this->getEntityManager()->getEspoMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields.phoneNumber.defaultType'); + + $phoneNumberNew->set('type', $defaultType); + + $this->save($phoneNumberNew); + $isNewPhoneNumber = true; + } - $phoneOld = $entity->getFetched('phoneNumber'); - if (!empty($phoneOld)) { - $phoneNumberOld = $this->getByNumber($phoneOld); - $entityRepository->unrelate($entity, 'phoneNumbers', $phoneNumberOld); - } - $entityRepository->relate($entity, 'phoneNumbers', $phoneNumberNew); + $phoneOld = $entity->getFetched('phoneNumber'); + if (!empty($phoneOld)) { + $phoneNumberOld = $this->getByNumber($phoneOld); + $entityRepository->unrelate($entity, 'phoneNumbers', $phoneNumberOld); + } + $entityRepository->relate($entity, 'phoneNumbers', $phoneNumberNew); - $query = " - UPDATE entity_phone_number - SET `primary` = 1 - WHERE - entity_id = ".$pdo->quote($entity->id)." AND - entity_type = ".$pdo->quote($entity->getEntityName())." AND - phone_number_id = ".$pdo->quote($phoneNumberNew->id)." - "; - $sth = $pdo->prepare($query); - $sth->execute(); - } - } else { - $phoneOld = $entity->getFetched('phoneNumber'); - if (!empty($phoneOld)) { - $phoneNumberOld = $this->getByNumber($phoneOld); - $entityRepository->unrelate($entity, 'phoneNumbers', $phoneNumberOld); - } - } - } - } + $query = " + UPDATE entity_phone_number + SET `primary` = 1 + WHERE + entity_id = ".$pdo->quote($entity->id)." AND + entity_type = ".$pdo->quote($entity->getEntityName())." AND + phone_number_id = ".$pdo->quote($phoneNumberNew->id)." + "; + $sth = $pdo->prepare($query); + $sth->execute(); + } + } else { + $phoneOld = $entity->getFetched('phoneNumber'); + if (!empty($phoneOld)) { + $phoneNumberOld = $this->getByNumber($phoneOld); + $entityRepository->unrelate($entity, 'phoneNumbers', $phoneNumberOld); + } + } + } + } } diff --git a/application/Espo/Repositories/Preferences.php b/application/Espo/Repositories/Preferences.php index 20386da253..b3412f485e 100644 --- a/application/Espo/Repositories/Preferences.php +++ b/application/Espo/Repositories/Preferences.php @@ -26,124 +26,124 @@ use Espo\ORM\Entity; class Preferences extends \Espo\Core\ORM\Repository { - protected $dependencies = array( - 'fileManager', - 'metadata', - 'config', - ); - - protected $defaultAttributesFromSettings = array( - 'defaultCurrency', - 'dateFormat', - 'timeFormat', - 'decimalMark', - 'thousandSeparator', - 'weekStart', - 'timeZone', - 'language', - 'exportDelimiter' - ); - - protected $data = array(); - - protected $entityName = 'Preferences'; - - protected function getFileManager() - { - return $this->getInjection('fileManager'); - } - - protected function getMetadata() - { - return $this->getInjection('metadata'); - } - - protected function getConfig() - { - return $this->getInjection('config'); - } - - protected function getFilePath($id) - { - return 'data/preferences/' . $id . '.json'; - } - - public function get($id = null) - { - if ($id) { - $entity = $this->entityFactory->create('Preferences'); - $entity->id = $id; - if (empty($this->data[$id])) { - $fileName = $this->getFilePath($id); - - if (file_exists($fileName)) { - $this->data[$id] = json_decode($this->getFileManager()->getContents($fileName), true); - } else { - $fields = $this->getMetadata()->get('entityDefs.Preferences.fields'); - $defaults = array(); - $defaults['dashboardLayout'] = $this->getMetadata()->get('app.defaultDashboardLayout'); - foreach ($fields as $field => $d) { - if (array_key_exists('default', $d)) { - $defaults[$field] = $d['default']; - } - } - foreach ($this->defaultAttributesFromSettings as $attr) { - $defaults[$attr] = $this->getConfig()->get($attr); - } - - $this->data[$id] = $defaults; - } - } - - $entity->set($this->data[$id]); - $d = $entity->toArray(); - return $entity; - } - } - - public function save(Entity $entity) - { - if ($entity->id) { - $this->data[$entity->id] = $entity->toArray(); - - $fileName = $this->getFilePath($entity->id); - $this->getFileManager()->putContents($fileName, json_encode($this->data[$entity->id])); - return $entity; - } - } - - public function remove(Entity $entity) - { - $fileName = $this->getFilePath($id); - unlink($fileName); - if (!file_exists($fileName)) { - return true; - } - } - - public function resetToDefaults($userId) - { - $fileName = $this->getFilePath($userId); - $this->getFileManager()->unlink($fileName); - if ($entity = $this->get($userId)) { - return $entity->toArray(); - } - } + protected $dependencies = array( + 'fileManager', + 'metadata', + 'config', + ); + + protected $defaultAttributesFromSettings = array( + 'defaultCurrency', + 'dateFormat', + 'timeFormat', + 'decimalMark', + 'thousandSeparator', + 'weekStart', + 'timeZone', + 'language', + 'exportDelimiter' + ); + + protected $data = array(); + + protected $entityName = 'Preferences'; + + protected function getFileManager() + { + return $this->getInjection('fileManager'); + } + + protected function getMetadata() + { + return $this->getInjection('metadata'); + } + + protected function getConfig() + { + return $this->getInjection('config'); + } + + protected function getFilePath($id) + { + return 'data/preferences/' . $id . '.json'; + } + + public function get($id = null) + { + if ($id) { + $entity = $this->entityFactory->create('Preferences'); + $entity->id = $id; + if (empty($this->data[$id])) { + $fileName = $this->getFilePath($id); + + if (file_exists($fileName)) { + $this->data[$id] = json_decode($this->getFileManager()->getContents($fileName), true); + } else { + $fields = $this->getMetadata()->get('entityDefs.Preferences.fields'); + $defaults = array(); + $defaults['dashboardLayout'] = $this->getMetadata()->get('app.defaultDashboardLayout'); + foreach ($fields as $field => $d) { + if (array_key_exists('default', $d)) { + $defaults[$field] = $d['default']; + } + } + foreach ($this->defaultAttributesFromSettings as $attr) { + $defaults[$attr] = $this->getConfig()->get($attr); + } + + $this->data[$id] = $defaults; + } + } + + $entity->set($this->data[$id]); + $d = $entity->toArray(); + return $entity; + } + } + + public function save(Entity $entity) + { + if ($entity->id) { + $this->data[$entity->id] = $entity->toArray(); + + $fileName = $this->getFilePath($entity->id); + $this->getFileManager()->putContents($fileName, json_encode($this->data[$entity->id])); + return $entity; + } + } + + public function remove(Entity $entity) + { + $fileName = $this->getFilePath($id); + unlink($fileName); + if (!file_exists($fileName)) { + return true; + } + } + + public function resetToDefaults($userId) + { + $fileName = $this->getFilePath($userId); + $this->getFileManager()->unlink($fileName); + if ($entity = $this->get($userId)) { + return $entity->toArray(); + } + } - public function find(array $params) - { - } - - public function findOne(array $params) - { - } + public function find(array $params) + { + } + + public function findOne(array $params) + { + } - public function getAll() - { - } - - public function count(array $params) - { - } + public function getAll() + { + } + + public function count(array $params) + { + } } diff --git a/application/Espo/Repositories/UniqueId.php b/application/Espo/Repositories/UniqueId.php index 20772a3640..2b82c61855 100644 --- a/application/Espo/Repositories/UniqueId.php +++ b/application/Espo/Repositories/UniqueId.php @@ -26,11 +26,11 @@ use Espo\ORM\Entity; class UniqueId extends \Espo\Core\ORM\Repositories\RDB { - protected function getNewEntity() - { - $entity = parent::getNewEntity(); - $entity->set('name', uniqid()); - return $entity; - } + protected function getNewEntity() + { + $entity = parent::getNewEntity(); + $entity->set('name', uniqid()); + return $entity; + } } diff --git a/application/Espo/Repositories/User.php b/application/Espo/Repositories/User.php index e5007a37c9..e78bfcd94f 100644 --- a/application/Espo/Repositories/User.php +++ b/application/Espo/Repositories/User.php @@ -28,37 +28,37 @@ use \Espo\Core\Exceptions\Error; class User extends \Espo\Core\ORM\Repositories\RDB { - protected function beforeSave(Entity $entity) - { - if ($entity->isNew()) { - $userName = $entity->get('userName'); - if (empty($userName)) { - throw new Error(); - } - - $user = $this->where(array( - 'userName' => $userName - ))->findOne(); - - if ($user) { - throw new Error(); - } - } else { - if ($entity->isFieldChanged('userName')) { - $userName = $entity->get('userName'); - if (empty($userName)) { - throw new Error(); - } - - $user = $this->where(array( - 'userName' => $userName, - 'id!=' => $entity->id - ))->findOne(); - if ($user) { - throw new Error(); - } - } - } - } + protected function beforeSave(Entity $entity) + { + if ($entity->isNew()) { + $userName = $entity->get('userName'); + if (empty($userName)) { + throw new Error(); + } + + $user = $this->where(array( + 'userName' => $userName + ))->findOne(); + + if ($user) { + throw new Error(); + } + } else { + if ($entity->isFieldChanged('userName')) { + $userName = $entity->get('userName'); + if (empty($userName)) { + throw new Error(); + } + + $user = $this->where(array( + 'userName' => $userName, + 'id!=' => $entity->id + ))->findOne(); + if ($user) { + throw new Error(); + } + } + } + } } diff --git a/application/Espo/Resources/i18n/de_DE/Admin.json b/application/Espo/Resources/i18n/de_DE/Admin.json index 4bdde3c7c5..4b1ec45fda 100644 --- a/application/Espo/Resources/i18n/de_DE/Admin.json +++ b/application/Espo/Resources/i18n/de_DE/Admin.json @@ -1,128 +1,128 @@ { - "labels": { - "Enabled": "Aktiv", - "Disabled": "Inaktiv", - "System": "System", - "Users": "Benutzer", - "Email": "E-Mail", - "Data": "Daten", - "Customization": "Anpassung", - "Available Fields": "Verfügbare Felder", - "Layout": "Aktuelles Layout", - "Enabled": "Aktiv", - "Disabled": "Inaktiv", - "Add Panel": "Panel hinzufügen", - "Add Field": "Feld hinzufügen", - "Settings": "Einstellungen", - "Scheduled Jobs": "Geplante Jobs", - "Upgrade": "Upgrade", - "Clear Cache": "Cache leeren", - "Rebuild": "Neu aufbauen", - "Users": "Benutzer", - "Teams": "Teams", - "Roles": "Rollen", - "Outbound Emails": "Ausgehende E-Mails", - "Inbound Emails": "Eingehende E-Mails", - "Email Templates": "E-Mail Vorlagen", - "Import": "Import", - "Layout Manager": "Layouts anpassen", - "Field Manager": "Felder anpassen", - "User Interface": "Benutzeroberfläche", - "Auth Tokens": "Auth Tokens", - "Authentication": "Authentifizierung:", - "Currency": "Währung" - }, - "layouts": { - "list": "Liste", - "detail": "Detail", - "listSmall": "Liste (Klein)", - "detailSmall": "Detail (Klein)", - "filters": "Suchfilter", - "massUpdate": "Massenänderung", - "relationships": "Beziehungen" - }, - "fieldTypes": { - "address": "Adresse", - "array": "Array", - "foreign": "Fremd", - "duration": "Dauer", - "password": "Passwort", - "parsonName": "Person Name", - "autoincrement": "Automatisch hochzählen", - "bool": "Bool", - "currency": "Währung", - "date": "Datum", - "datetime": "Datum\/Zeit", - "email": "E-Mail", - "enum": "Einfachauswahl", - "enumInt": "Einfachauswahl Ganzzahlwerte", - "enumFloat": "Einfachauswahl Fließkommawerte", - "float": "Fließkomma", - "int": "Ganzzahl", - "link": "Link", - "linkMultiple": "Mehrfachlinks", - "linkParent": "Mutterlink", - "multienim": "Mehrfachauswahl", - "phone": "Telefon", - "text": "Textbox", - "url": "URL", - "varchar": "Text (max. 255)", - "file": "Datei", - "image": "Bild" - }, - "fields": { - "type": "Typ", - "name": "Name", - "label": "Bezeichnung", - "required": "Erforderlich", - "default": "Standard", - "maxLength": "Maximallänge", - "options": "Optionen (Datenbank Werte, nicht übersetzt)", - "after": "Nach (Feld)", - "before": "Vor (Feld)", - "link": "Link", - "field": "Feld", - "min": "Min", - "max": "Max", - "translation": "Übersetzung", - "previewSize": "Vorschau Größe" - }, - "messages": { - "upgradeVersion": "Ihr EspoCRM wird nun auf Version {version}<\/strong> aktualisiert. Dies kann eine Weile dauern.", - "upgradeDone": "Ihr EspoCRM wurde auf Version {version}<\/strong> aktualisiert. Bitte aktualisieren Sie Ihren Browser.", - "upgradeBackup": "Wir empfehlen, vor der Aktualisierung von EspoCRM Verzeichnis sowie Datenbank zu sichern.", - "thousandSeparatorEqualsDecimalMark": "Das Tausendertrennzeichen kann nicht gleich dem Dezimaltrennzeichen sein", - "userHasNoEmailAddress": "Der Benutzer hat keine E-Mail-Adresse.", - "selectEntityType": "Modul links auswählen", - "selectUpgradePackage": "Aktualisierungspaket auswählen", - "selectLayout": "Layout zum Editieren links auswählen" - }, - "descriptions": { - "settings": "Systemeinstellungen der Applikation.", - "scheduledJob": "Aufgaben die durch einen Cronjob ausgeführt werden.", - "upgrade": "EspoCRM aktualisieren.", - "clearCache": "Alle Cache Dateien leeren.", - "rebuild": "Wiederherstellung des Backends und Leeren des Cache.", - "users": "Benutzerverwaltung.", - "teams": "Teamverwaltung.", - "roles": "Rollenverwaltung.", - "outboundEmails": "SMTP Einstellungen für ausgehende E-Mails.", - "inboundEmails": "IMAP Gruppen E-Mail Konten. E-Mail Import und E-Mail für Fälle.", - "emailTemplates": "Vorlagen für ausgehende E-Mails.", - "import": "Datenimport aus CSV Datei.", - "layoutManager": "Layouts anpassen (Liste, Detailansicht, Bearbeitungsansicht, Suche, Massenaktualisierung).", - "fieldManager": "Neue Felder erstellen oder bestehende anpassen.", - "userInterface": "Benutzeroberfläche anpassen.", - "authTokens": "Aktive Auth Sessions. IP Adresse und letztes Zugriffsdatum", - "authentication": "Authentifizierungs Einstellungen.", - "currency": "Währungseinstellungen und Kurse" - }, - "options": { - "previewSize": { - "x-small": "X-Small", - "small": "Small", - "medium": "Medium", - "large": "Large" - } - } + "labels": { + "Enabled": "Aktiv", + "Disabled": "Inaktiv", + "System": "System", + "Users": "Benutzer", + "Email": "E-Mail", + "Data": "Daten", + "Customization": "Anpassung", + "Available Fields": "Verfügbare Felder", + "Layout": "Aktuelles Layout", + "Enabled": "Aktiv", + "Disabled": "Inaktiv", + "Add Panel": "Panel hinzufügen", + "Add Field": "Feld hinzufügen", + "Settings": "Einstellungen", + "Scheduled Jobs": "Geplante Jobs", + "Upgrade": "Upgrade", + "Clear Cache": "Cache leeren", + "Rebuild": "Neu aufbauen", + "Users": "Benutzer", + "Teams": "Teams", + "Roles": "Rollen", + "Outbound Emails": "Ausgehende E-Mails", + "Inbound Emails": "Eingehende E-Mails", + "Email Templates": "E-Mail Vorlagen", + "Import": "Import", + "Layout Manager": "Layouts anpassen", + "Field Manager": "Felder anpassen", + "User Interface": "Benutzeroberfläche", + "Auth Tokens": "Auth Tokens", + "Authentication": "Authentifizierung:", + "Currency": "Währung" + }, + "layouts": { + "list": "Liste", + "detail": "Detail", + "listSmall": "Liste (Klein)", + "detailSmall": "Detail (Klein)", + "filters": "Suchfilter", + "massUpdate": "Massenänderung", + "relationships": "Beziehungen" + }, + "fieldTypes": { + "address": "Adresse", + "array": "Array", + "foreign": "Fremd", + "duration": "Dauer", + "password": "Passwort", + "parsonName": "Person Name", + "autoincrement": "Automatisch hochzählen", + "bool": "Bool", + "currency": "Währung", + "date": "Datum", + "datetime": "Datum\/Zeit", + "email": "E-Mail", + "enum": "Einfachauswahl", + "enumInt": "Einfachauswahl Ganzzahlwerte", + "enumFloat": "Einfachauswahl Fließkommawerte", + "float": "Fließkomma", + "int": "Ganzzahl", + "link": "Link", + "linkMultiple": "Mehrfachlinks", + "linkParent": "Mutterlink", + "multienim": "Mehrfachauswahl", + "phone": "Telefon", + "text": "Textbox", + "url": "URL", + "varchar": "Text (max. 255)", + "file": "Datei", + "image": "Bild" + }, + "fields": { + "type": "Typ", + "name": "Name", + "label": "Bezeichnung", + "required": "Erforderlich", + "default": "Standard", + "maxLength": "Maximallänge", + "options": "Optionen (Datenbank Werte, nicht übersetzt)", + "after": "Nach (Feld)", + "before": "Vor (Feld)", + "link": "Link", + "field": "Feld", + "min": "Min", + "max": "Max", + "translation": "Übersetzung", + "previewSize": "Vorschau Größe" + }, + "messages": { + "upgradeVersion": "Ihr EspoCRM wird nun auf Version {version}<\/strong> aktualisiert. Dies kann eine Weile dauern.", + "upgradeDone": "Ihr EspoCRM wurde auf Version {version}<\/strong> aktualisiert. Bitte aktualisieren Sie Ihren Browser.", + "upgradeBackup": "Wir empfehlen, vor der Aktualisierung von EspoCRM Verzeichnis sowie Datenbank zu sichern.", + "thousandSeparatorEqualsDecimalMark": "Das Tausendertrennzeichen kann nicht gleich dem Dezimaltrennzeichen sein", + "userHasNoEmailAddress": "Der Benutzer hat keine E-Mail-Adresse.", + "selectEntityType": "Modul links auswählen", + "selectUpgradePackage": "Aktualisierungspaket auswählen", + "selectLayout": "Layout zum Editieren links auswählen" + }, + "descriptions": { + "settings": "Systemeinstellungen der Applikation.", + "scheduledJob": "Aufgaben die durch einen Cronjob ausgeführt werden.", + "upgrade": "EspoCRM aktualisieren.", + "clearCache": "Alle Cache Dateien leeren.", + "rebuild": "Wiederherstellung des Backends und Leeren des Cache.", + "users": "Benutzerverwaltung.", + "teams": "Teamverwaltung.", + "roles": "Rollenverwaltung.", + "outboundEmails": "SMTP Einstellungen für ausgehende E-Mails.", + "inboundEmails": "IMAP Gruppen E-Mail Konten. E-Mail Import und E-Mail für Fälle.", + "emailTemplates": "Vorlagen für ausgehende E-Mails.", + "import": "Datenimport aus CSV Datei.", + "layoutManager": "Layouts anpassen (Liste, Detailansicht, Bearbeitungsansicht, Suche, Massenaktualisierung).", + "fieldManager": "Neue Felder erstellen oder bestehende anpassen.", + "userInterface": "Benutzeroberfläche anpassen.", + "authTokens": "Aktive Auth Sessions. IP Adresse und letztes Zugriffsdatum", + "authentication": "Authentifizierungs Einstellungen.", + "currency": "Währungseinstellungen und Kurse" + }, + "options": { + "previewSize": { + "x-small": "X-Small", + "small": "Small", + "medium": "Medium", + "large": "Large" + } + } } diff --git a/application/Espo/Resources/i18n/de_DE/AuthToken.json b/application/Espo/Resources/i18n/de_DE/AuthToken.json index de64e57778..f654263f73 100644 --- a/application/Espo/Resources/i18n/de_DE/AuthToken.json +++ b/application/Espo/Resources/i18n/de_DE/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "Benutzer", - "ipAddress": "IP Adresse", - "lastAccess": "Letztes Zugriffsdatum", - "createdAt": "Login Datum" + "fields": { + "user": "Benutzer", + "ipAddress": "IP Adresse", + "lastAccess": "Letztes Zugriffsdatum", + "createdAt": "Login Datum" - } + } } diff --git a/application/Espo/Resources/i18n/de_DE/Email.json b/application/Espo/Resources/i18n/de_DE/Email.json index 26c19c5e34..97ee9170f4 100644 --- a/application/Espo/Resources/i18n/de_DE/Email.json +++ b/application/Espo/Resources/i18n/de_DE/Email.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Betreff", - "parent": "Bezieht sich auf", - "status": "Status", - "dateSent": "Sendedatum", - "from": "Von", - "to": "An", - "cc": "CC", - "bcc": "BCC", - "isHtml": "Ist HTML", - "body": "Inhalt", - "subject": "Betreff", - "attachments": "Anhänge", - "selectTemplate": "Vorlage wählen", - "fromEmailAddress": "Von Adresse", - "toEmailAddresses": "An Adresse", - "emailAddress": "E-Mail Adresse" - }, - "links": { - }, - "options": { - "Draft": "Entwurf", - "Sending": "wird gesendet", - "Sent": "Gesendet", - "Archived": "Archiviert" - }, - "labels": { - "Create Email": "E-Mail archivieren", - "Compose": "Erstellen" - }, - "presetFilters": { - "sent": "Gesendet", - "archived": "Archiviert" - } + "fields": { + "name": "Betreff", + "parent": "Bezieht sich auf", + "status": "Status", + "dateSent": "Sendedatum", + "from": "Von", + "to": "An", + "cc": "CC", + "bcc": "BCC", + "isHtml": "Ist HTML", + "body": "Inhalt", + "subject": "Betreff", + "attachments": "Anhänge", + "selectTemplate": "Vorlage wählen", + "fromEmailAddress": "Von Adresse", + "toEmailAddresses": "An Adresse", + "emailAddress": "E-Mail Adresse" + }, + "links": { + }, + "options": { + "Draft": "Entwurf", + "Sending": "wird gesendet", + "Sent": "Gesendet", + "Archived": "Archiviert" + }, + "labels": { + "Create Email": "E-Mail archivieren", + "Compose": "Erstellen" + }, + "presetFilters": { + "sent": "Gesendet", + "archived": "Archiviert" + } } diff --git a/application/Espo/Resources/i18n/de_DE/EmailAddress.json b/application/Espo/Resources/i18n/de_DE/EmailAddress.json index 610168541b..f4d7d2e21d 100644 --- a/application/Espo/Resources/i18n/de_DE/EmailAddress.json +++ b/application/Espo/Resources/i18n/de_DE/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Primär", - "Opted Out": "Keine E-Mails", - "Invalid": "Ungültig" - } + "labels": { + "Primary": "Primär", + "Opted Out": "Keine E-Mails", + "Invalid": "Ungültig" + } } diff --git a/application/Espo/Resources/i18n/de_DE/EmailTemplate.json b/application/Espo/Resources/i18n/de_DE/EmailTemplate.json index efd6c42953..3b155c8faf 100644 --- a/application/Espo/Resources/i18n/de_DE/EmailTemplate.json +++ b/application/Espo/Resources/i18n/de_DE/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Name", - "status": "Status", - "isHtml": "Ist HTML", - "body": "Inhalt", - "subject": "Betreff", - "attachments": "Anhänge", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Neue E-Mail Vorlage" - } + "fields": { + "name": "Name", + "status": "Status", + "isHtml": "Ist HTML", + "body": "Inhalt", + "subject": "Betreff", + "attachments": "Anhänge", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Neue E-Mail Vorlage" + } } diff --git a/application/Espo/Resources/i18n/de_DE/Global.json b/application/Espo/Resources/i18n/de_DE/Global.json index 73bfffb607..2fa41a027f 100644 --- a/application/Espo/Resources/i18n/de_DE/Global.json +++ b/application/Espo/Resources/i18n/de_DE/Global.json @@ -1,423 +1,423 @@ { - "scopeNames": { - "Email": "E-Mail", - "User": "Benutzer", - "Team": "Team", - "Role": "Rolle", - "EmailTemplate": "E-Mail Vorlage", - "OutboundEmail": "Ausgehende E-Mail", - "ScheduledJob": "Geplante Aufgabe" - }, - "scopeNamesPlural": { - "Email": "E-Mails", - "User": "Benutzer", - "Team": "Teams", - "Role": "Rollen", - "EmailTemplate": "E-Mail Vorlagen", - "OutboundEmail": "Ausgehende E-Mails", - "ScheduledJob": "Geplante Jobs" - }, - "labels": { - "Misc": "Verschiedenes", - "Merge": "Zusammenführen", - "None": "Kein(e)", - "by": "von", - "Saved": "Gespeichert.", - "Error": "Fehler", - "Select": "Auswählen", - "Not valid": "Ungültig", - "Please wait...": "Bitte warten...", - "Please wait": "Bitte warten", - "Loading...": "Lade...", - "Uploading...": "Lade hoch...", - "Sending...": "Wird gesendet...", - "Removed": "Entfernt", - "Posted": "Geposted", - "Linked": "Verlinkt", - "Unlinked": "Verknüpfung gelöscht", - "Access denied": "Zugriff verweigert", - "Access": "Zugang", - "Are you sure?": "Sind Sie sicher?", - "Record has been removed": "Datensatz wurde gelöscht", - "Wrong username/password": "Falscher Benutzername\/Passwort", - "Post cannot be empty": "Notiz dard nicht leer sein", - "Removing...": "Entferne...", - "Unlinking...": "Lösche Verknüpfung...", - "Posting...": "Poste...", - "Username can not be empty!": "Der Benutzername darf nicht leer sein!", - "Cache is not enabled": "Cache ist nicht aktiviert", - "Cache has been cleared": "Der Cache wurde geleert", - "Rebuild has been done": "Wiederherstellen wurde durchgeführt", - "Saving...": "Speichere...", - "Modified": "Verändert", - "Created": "Erstellt", - "Create": "Erstellen", - "create": "Erstellen", - "Overview": "Überblick", - "Details": "Details", - "Add Filter": "Filter hinzufügen", - "Add Dashlet": "Dashlet hinzufügen", - "Add": "Hinzufügen", - "Reset": "Zurücksetzen", - "Menu": "Menü", - "More": "Mehr", - "Search": "Suchen", - "Only My": "Nur Meine", - "Open": "Offen", - "Admin": "Admin", - "About": "Über", - "Refresh": "Aktualisieren", - "Remove": "Entfernen", - "Options": "Optionen", - "Username": "Benutzername", - "Password": "Passwort", - "Login": "Anmelden", - "Log Out": "Abmelden", - "Preferences": "Benutzereinstellungen", - "State": "Bundesland", - "Street": "Straße", - "Country": "Land", - "City": "Ort", - "PostalCode": "PLZ", - "Followed": "Beobachtet", - "Follow": "Beobachten", - "Clear Local Cache": "Lokalen Cache leeren", - "Actions": "Aktionen", - "Delete": "Löschen", - "Update": "Aktualisieren", - "Save": "Speichern", - "Edit": "Bearbeiten", - "Cancel": "Abbrechen", - "Unlink": "Link entfernen", - "Mass Update": "Massenänderung", - "Export": "Exportieren", - "No Data": "Keine Daten", - "All": "Alle", - "Active": "Aktiv", - "Inactive": "Inaktiv", - "Write your comment here": "Notiz hier einfügen", - "Post": "Senden", - "Stream": "Vorgänge", - "Show more": "Mehr anzeigen", - "Dashlet Options": "Dashlet Optionen", - "Full Form": "Komplettes Formular", - "Insert": "Einfügen", - "Person": "Person", - "First Name": "Vorname", - "Last Name": "Nachname", - "Original": "Original", - "You": "Sie", - "you": "Sie", - "change": "ändern", - "Primary": "Primär", - "Save Filters": "Filter speichern", - "Administration": "Administration", - "Run Import": "Import durchführen", - "Duplicate": "Duplizieren", - "Notifications": "Benachrichtigungen", - "Mark all read": "Alle als gelesen markieren", - "See more": "Mehr anzeigen", - "Today": "Heute", - "Tomorrow": "Morgen", - "Yesterday": "Gestern" - }, - "messages": { - "notModified": "Sie haben den Datensatz nicht geändert", - "duplicate": "Der Datensatz den Sie erstellen wollen, könnte eine Dublette sein", - "fieldIsRequired": "{field} wird benötigt", - "fieldShouldBeEmail": "{field} muss eine gültige E-Mail sein", - "fieldShouldBeFloat": "{field} muss eine gültige Fließkomma Zahl sein", - "fieldShouldBeInt": "{field} muss eine gültige Ganzzahl sein", - "fieldShouldBeDate": "{field} muss ein gültiges Datum sein", - "fieldShouldBeDatetime": "{field} muss ein gültiges Datum\/Zeit Feld sein", - "fieldShouldAfter": "{field} muss nach {otherField} sein", - "fieldShouldBefore": "{field} muss vor {otherField} sein", - "fieldShouldBeBetween": "{field} muss zwischen {min} und {max} sein", - "fieldShouldBeLess": "{field} muss kleiner als {value} sein", - "fieldShouldBeGreater": "{field} muss größer als {value} sein", - "fieldBadPasswordConfirm": "{field} falsch bestätigt", - "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", - "assignmentEmailNotificationBody": "{assignerUserName} hat {entityType} '{Entity.name}' an Sie zugewiesen {recordUrl}", - "confirmation": "Sind Sie sicher?", - "removeRecordConfirmation": "Sind Sie sicher, dass Sie den Eintrag entfernen wollen?", - "unlinkRecordConfirmation": "Sind Sie sicher dass Sie diese Beziehung lösen möchten?", - "removeSelectedRecordsConfirmation": "Sind Sie sicher dass Sie die ausgewählten Sätze entfernen möchten?" - }, - "boolFilters": { - "onlyMy": "Nur Meine", - "open": "Offen", - "active": "Aktiv" - }, - "fields": { - "name": "Name", - "firstName": "Vorname", - "lastName": "Nachname", - "salutationName": "Anrede", - "assignedUser": "Zugewiesener Benutzer", - "emailAddress": "E-Mail", - "assignedUserName": "Zugewiesener Benutzername", - "teams": "Teams", - "createdAt": "Erstellt am", - "modifiedAt": "Geändert am", - "createdBy": "Erstellt von", - "modifiedBy": "Geändert von", - "title": "Funktion", - "dateFrom": "Von Datum", - "dateTo": "Bis Datum", - "autorefreshInterval": "Aktualisierungsintervall", - "displayRecords": "Sätze anzeigen" - }, - "links": { - "teams": "Teams", - "users": "Benutzer" - }, - "dashlets": { - "Stream": "Vorgänge" - }, - "streamMessages": { - "create": "{user} hat {entityType} {entity} erstellt", - "createAssigned": "{user} hat {entityType} {entity} erstellt und an {assignee} zugewiesen", - "assign": "{user} hat {entityType} {entity} an {assignee} zugewiesen", - "post": "{user} hat zu {entityType} {entity} notiert", - "attach": "{user} hat zu {entityType} {entity} hinzugefügt", - "status": "{user} hat {field} von {entityType} {entity} aktualisiert", - "update": "{user} hat {entityType} {entity} aktualisiert", - "createRelated": "{user} hat {relatedEntityType} {relatedEntity} verbunden mit {entityType} {entity} erstellt", - "emailReceived": "{entity} wurde für {entityType} {entity} empfangen", - - "createThis": "{user} hat {entityType} erstellt", - "createAssignedThis": "{user} hat {entityType} erstellt und an {assignee} zugewiesen", - "assignThis": "{user} hat {entityType} an {assignee} zugewiesen", - "postThis": "{user} hat notiert", - "attachThis": "{user} hat hinzugefügt", - "statusThis": "{user} hat {field} aktualiisiert", - "updateThis": "{user} hat diese(s\/n) {entityType} aktualisiert", - "createRelatedThis": "{user} hat {relatedEntityType} {relatedEntity} verbunden mit diesem (r) {entityType} hinzugefügt", - "emailReceivedThis": "{entity} wurde empfangen" - }, - "lists": { - "monthNames": ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], - "monthNamesShort": ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], - "dayNames": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], - "dayNamesShort": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], - "dayNamesMin": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] - }, - "options": { - "salutationName": { - "Mr.": "Mr.", - "Mrs.": "Mrs.", - "Dr.": "Dr.", - "Drs.": "Drs." - }, - "language": { - "af_ZA":"Afrikaans", - "az_AZ":"Aserbaidschanisch", - "be_BY":"Weissrussisch", - "bg_BG":"Bulgarisch", - "bn_IN":"Benglaisch", - "bs_BA":"Bosnisch", - "ca_ES":"Katalanisch", - "cs_CZ":"Tschechisch", - "cy_GB":"Walisisch", - "da_DK":"Dänisch", - "de_DE":"Deutsch", - "el_GR":"Griechisch", - "en_GB":"Englisch (UK)", - "en_US":"Englisch (US)", - "es_ES":"Spanisch (ES)", - "et_EE":"Estnisch", - "eu_ES":"Baskisch", - "fa_IR":"Persisch", - "fi_FI":"Finnisch", - "fo_FO":"Färöisch", - "fr_CA":"Französisch (CN)", - "fr_FR":"Französisch (FR)", - "ga_IE":"Irisch", - "gl_ES":"Galizisch", - "gn_PY":"Guarani", - "he_IL":"Hebräisch", - "hi_IN":"Hindi", - "hr_HR":"Kroatisch", - "hu_HU":"Ungarisch", - "hy_AM":"Armenisch", - "id_ID":"Indonesisch", - "is_IS":"Isländisch", - "it_IT":"Italienisch", - "ja_JP":"Japanisch", - "ka_GE":"Georgisch", - "km_KH":"Khmer", - "ko_KR":"Koreanisch", - "ku_TR":"Kurdisch", - "lt_LT":"Litauisch", - "lv_LV":"Lettisch", - "mk_MK":"Mazedonisch", - "ml_IN":"Malayalam", - "ms_MY":"Malaiisch", - "nb_NO":"Norwegisch Bokmál", - "nn_NO":"Norwegisch Nynorsk", - "ne_NP":"Nepali", - "nl_NL":"Niederländisch", - "pa_IN":"Punjabi", - "pl_PL":"Polnisch", - "ps_AF":"Pashto", - "pt_BR":"Portugiesisch (BR)", - "pt_PT":"Portugiesisch (PT)", - "ro_RO":"Rumänisch", - "ru_RU":"Russisch", - "sk_SK":"Slowakisch", - "sl_SI":"Slowenisch", - "sq_AL":"Albanisch", - "sr_RS":"Serbisch", - "sv_SE":"Schwedisch", - "sw_KE":"Suaheli", - "ta_IN":"Tamil", - "te_IN":"Telugu", - "th_TH":"Thailändisch", - "tl_PH":"Tagalog", - "tr_TR":"Tükisch", - "uk_UA":"Ukrainisch", - "ur_PK":"Urdu", - "vi_VN":"Vietnamesisch", - "zh_CN":"Chinesisch vereinfacht (CN)", - "zh_HK":"Chinesisch traditionell (HK)", - "zh_TW":"Chinesisch traditionell (TW)" - }, - "dateSearchRanges": { - "on": "Am", - "notOn": "Nicht am", - "after": "Nach", - "before": "Vor", - "between": "Zwischen", - "today": "Heute", - "past": "Vergangenheit", - "future": "Zukunft" - }, - "intSearchRanges": { - "equals": "Gleich", - "notEquals": "Nicht gleich", - "greaterThan": "Größer als", - "lessThan": "Weniger als", - "greaterThanOrEquals": "Größer oder gleich als", - "lessThanOrEquals": "Weniger oder gleich als", - "between": "Zwischen" - }, - "autorefreshInterval": { - "0": "Kein(e)", - "0.5": "30 Sekunden", - "1": "1 Minute", - "2": "2 Minuten", - "5": "5 Minuten", - "10": "10 Minuten" - }, - "phoneNumber": { - "Mobile": "Telefon Mobil", - "Office": "Büro", - "Fax": "Fax", - "Home": "Startseite", - "Other": "Andere" - } - }, - "sets": { - "summernote": { - "NOTICE": "Sie finden die Übersetzung hier: https:\/\/github.com\/HackerWins\/summernote\/tree\/master\/lang", - "font":{ - "bold":"Fett", - "italic":"Kursiv", - "underline":"Unterstrichen", - "strike":"Durchgestrichen", - "clear":"Font Stil entfernen", - "height":"Zeilenhöhe", - "name":"Schriftfamilie", - "size":"Schriftgröße" - }, - "image":{ - "image":"Bild", - "insert":"Bild einfügen", - "resizeFull":"Originalgröße", - "resizeHalf":"Größe 1\/2", - "resizeQuarter":"Größe 1\/4", - "floatLeft":"Linksbündig", - "floatRight":"Rechtsbündig", - "floatNone":"Kein Textfluss", - "dragImageHere":"Ziehen Sie ein Bild mit der Maus hierher", - "selectFromFiles":"Wählen Sie eine Datei aus", - "url":"Grafik URL", - "remove":"Grafik entfernen" - }, - "link":{ - "link":"Link", - "insert":"Link einfügen", - "unlink":"Link entfernen", - "edit":"Bearbeiten", - "textToDisplay":"Anzeigetext", - "url":"Ziel des Links?", - "openInNewWindow":"In einem neuen Fenster öffnen" - }, - "video":{ - "video":"Video", - "videoLink":"Video Link", - "insert":"Video einfügen", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram oder DailyMotion)" - }, - "table":{ - "table":"Tabelle" - }, - "hr":{ - "insert":"Eine horizontale Linie einfügen" - }, - "style":{ - "style":"Stil", - "normal":"Normal", - "blockquote":"Zitat", - "pre":"Quellcode", - "h1":"Überschrift 1", - "h2":"Überschrift 2", - "h3":"Überschrift 3", - "h4":"Überschrift 4", - "h5":"Überschrift 5", - "h6":"Überschrift 6" - }, - "lists":{ - "unordered":"Unsortierte Liste", - "ordered":"Nummerierte Liste" - }, - "options":{ - "help":"Hilfe", - "fullscreen":"Vollbild", - "codeview":"HTML-Code anzeigen" - }, - "paragraph":{ - "paragraph":"Absatz", - "outdent":"Ausrückung", - "indent":"Einrückung", - "left":"Links ausrichten", - "center":"Zentriert ausrichten", - "right":"Rechts ausrichten", - "justify":"Blocksatz" - }, - "color":{ - "recent":"Letzte Farbe", - "more":"Mehr Farben", - "background":"Hintergrundfarbe", - "foreground":"Schriftfarbe", - "transparent":"Transparenz", - "setTransparent":"Transparenz setzen", - "reset":"Zurücksetzen", - "resetToDefault":"Zurücksetzen auf Standard" - }, - "shortcut":{ - "shortcuts":"Tastaturkürzel", - "close":"Schließen", - "textFormatting":"Textformatierung", - "action":"Aktion", - "paragraphFormatting":"Absatzformatierung", - "documentStyle":"Dokumentenstil" - }, - "history":{ - "undo":"Rückgängig", - "redo":"Wiederholen" - } - } - } + "scopeNames": { + "Email": "E-Mail", + "User": "Benutzer", + "Team": "Team", + "Role": "Rolle", + "EmailTemplate": "E-Mail Vorlage", + "OutboundEmail": "Ausgehende E-Mail", + "ScheduledJob": "Geplante Aufgabe" + }, + "scopeNamesPlural": { + "Email": "E-Mails", + "User": "Benutzer", + "Team": "Teams", + "Role": "Rollen", + "EmailTemplate": "E-Mail Vorlagen", + "OutboundEmail": "Ausgehende E-Mails", + "ScheduledJob": "Geplante Jobs" + }, + "labels": { + "Misc": "Verschiedenes", + "Merge": "Zusammenführen", + "None": "Kein(e)", + "by": "von", + "Saved": "Gespeichert.", + "Error": "Fehler", + "Select": "Auswählen", + "Not valid": "Ungültig", + "Please wait...": "Bitte warten...", + "Please wait": "Bitte warten", + "Loading...": "Lade...", + "Uploading...": "Lade hoch...", + "Sending...": "Wird gesendet...", + "Removed": "Entfernt", + "Posted": "Geposted", + "Linked": "Verlinkt", + "Unlinked": "Verknüpfung gelöscht", + "Access denied": "Zugriff verweigert", + "Access": "Zugang", + "Are you sure?": "Sind Sie sicher?", + "Record has been removed": "Datensatz wurde gelöscht", + "Wrong username/password": "Falscher Benutzername\/Passwort", + "Post cannot be empty": "Notiz dard nicht leer sein", + "Removing...": "Entferne...", + "Unlinking...": "Lösche Verknüpfung...", + "Posting...": "Poste...", + "Username can not be empty!": "Der Benutzername darf nicht leer sein!", + "Cache is not enabled": "Cache ist nicht aktiviert", + "Cache has been cleared": "Der Cache wurde geleert", + "Rebuild has been done": "Wiederherstellen wurde durchgeführt", + "Saving...": "Speichere...", + "Modified": "Verändert", + "Created": "Erstellt", + "Create": "Erstellen", + "create": "Erstellen", + "Overview": "Überblick", + "Details": "Details", + "Add Filter": "Filter hinzufügen", + "Add Dashlet": "Dashlet hinzufügen", + "Add": "Hinzufügen", + "Reset": "Zurücksetzen", + "Menu": "Menü", + "More": "Mehr", + "Search": "Suchen", + "Only My": "Nur Meine", + "Open": "Offen", + "Admin": "Admin", + "About": "Über", + "Refresh": "Aktualisieren", + "Remove": "Entfernen", + "Options": "Optionen", + "Username": "Benutzername", + "Password": "Passwort", + "Login": "Anmelden", + "Log Out": "Abmelden", + "Preferences": "Benutzereinstellungen", + "State": "Bundesland", + "Street": "Straße", + "Country": "Land", + "City": "Ort", + "PostalCode": "PLZ", + "Followed": "Beobachtet", + "Follow": "Beobachten", + "Clear Local Cache": "Lokalen Cache leeren", + "Actions": "Aktionen", + "Delete": "Löschen", + "Update": "Aktualisieren", + "Save": "Speichern", + "Edit": "Bearbeiten", + "Cancel": "Abbrechen", + "Unlink": "Link entfernen", + "Mass Update": "Massenänderung", + "Export": "Exportieren", + "No Data": "Keine Daten", + "All": "Alle", + "Active": "Aktiv", + "Inactive": "Inaktiv", + "Write your comment here": "Notiz hier einfügen", + "Post": "Senden", + "Stream": "Vorgänge", + "Show more": "Mehr anzeigen", + "Dashlet Options": "Dashlet Optionen", + "Full Form": "Komplettes Formular", + "Insert": "Einfügen", + "Person": "Person", + "First Name": "Vorname", + "Last Name": "Nachname", + "Original": "Original", + "You": "Sie", + "you": "Sie", + "change": "ändern", + "Primary": "Primär", + "Save Filters": "Filter speichern", + "Administration": "Administration", + "Run Import": "Import durchführen", + "Duplicate": "Duplizieren", + "Notifications": "Benachrichtigungen", + "Mark all read": "Alle als gelesen markieren", + "See more": "Mehr anzeigen", + "Today": "Heute", + "Tomorrow": "Morgen", + "Yesterday": "Gestern" + }, + "messages": { + "notModified": "Sie haben den Datensatz nicht geändert", + "duplicate": "Der Datensatz den Sie erstellen wollen, könnte eine Dublette sein", + "fieldIsRequired": "{field} wird benötigt", + "fieldShouldBeEmail": "{field} muss eine gültige E-Mail sein", + "fieldShouldBeFloat": "{field} muss eine gültige Fließkomma Zahl sein", + "fieldShouldBeInt": "{field} muss eine gültige Ganzzahl sein", + "fieldShouldBeDate": "{field} muss ein gültiges Datum sein", + "fieldShouldBeDatetime": "{field} muss ein gültiges Datum\/Zeit Feld sein", + "fieldShouldAfter": "{field} muss nach {otherField} sein", + "fieldShouldBefore": "{field} muss vor {otherField} sein", + "fieldShouldBeBetween": "{field} muss zwischen {min} und {max} sein", + "fieldShouldBeLess": "{field} muss kleiner als {value} sein", + "fieldShouldBeGreater": "{field} muss größer als {value} sein", + "fieldBadPasswordConfirm": "{field} falsch bestätigt", + "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", + "assignmentEmailNotificationBody": "{assignerUserName} hat {entityType} '{Entity.name}' an Sie zugewiesen {recordUrl}", + "confirmation": "Sind Sie sicher?", + "removeRecordConfirmation": "Sind Sie sicher, dass Sie den Eintrag entfernen wollen?", + "unlinkRecordConfirmation": "Sind Sie sicher dass Sie diese Beziehung lösen möchten?", + "removeSelectedRecordsConfirmation": "Sind Sie sicher dass Sie die ausgewählten Sätze entfernen möchten?" + }, + "boolFilters": { + "onlyMy": "Nur Meine", + "open": "Offen", + "active": "Aktiv" + }, + "fields": { + "name": "Name", + "firstName": "Vorname", + "lastName": "Nachname", + "salutationName": "Anrede", + "assignedUser": "Zugewiesener Benutzer", + "emailAddress": "E-Mail", + "assignedUserName": "Zugewiesener Benutzername", + "teams": "Teams", + "createdAt": "Erstellt am", + "modifiedAt": "Geändert am", + "createdBy": "Erstellt von", + "modifiedBy": "Geändert von", + "title": "Funktion", + "dateFrom": "Von Datum", + "dateTo": "Bis Datum", + "autorefreshInterval": "Aktualisierungsintervall", + "displayRecords": "Sätze anzeigen" + }, + "links": { + "teams": "Teams", + "users": "Benutzer" + }, + "dashlets": { + "Stream": "Vorgänge" + }, + "streamMessages": { + "create": "{user} hat {entityType} {entity} erstellt", + "createAssigned": "{user} hat {entityType} {entity} erstellt und an {assignee} zugewiesen", + "assign": "{user} hat {entityType} {entity} an {assignee} zugewiesen", + "post": "{user} hat zu {entityType} {entity} notiert", + "attach": "{user} hat zu {entityType} {entity} hinzugefügt", + "status": "{user} hat {field} von {entityType} {entity} aktualisiert", + "update": "{user} hat {entityType} {entity} aktualisiert", + "createRelated": "{user} hat {relatedEntityType} {relatedEntity} verbunden mit {entityType} {entity} erstellt", + "emailReceived": "{entity} wurde für {entityType} {entity} empfangen", + + "createThis": "{user} hat {entityType} erstellt", + "createAssignedThis": "{user} hat {entityType} erstellt und an {assignee} zugewiesen", + "assignThis": "{user} hat {entityType} an {assignee} zugewiesen", + "postThis": "{user} hat notiert", + "attachThis": "{user} hat hinzugefügt", + "statusThis": "{user} hat {field} aktualiisiert", + "updateThis": "{user} hat diese(s\/n) {entityType} aktualisiert", + "createRelatedThis": "{user} hat {relatedEntityType} {relatedEntity} verbunden mit diesem (r) {entityType} hinzugefügt", + "emailReceivedThis": "{entity} wurde empfangen" + }, + "lists": { + "monthNames": ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], + "monthNamesShort": ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], + "dayNames": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], + "dayNamesShort": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], + "dayNamesMin": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] + }, + "options": { + "salutationName": { + "Mr.": "Mr.", + "Mrs.": "Mrs.", + "Dr.": "Dr.", + "Drs.": "Drs." + }, + "language": { + "af_ZA":"Afrikaans", + "az_AZ":"Aserbaidschanisch", + "be_BY":"Weissrussisch", + "bg_BG":"Bulgarisch", + "bn_IN":"Benglaisch", + "bs_BA":"Bosnisch", + "ca_ES":"Katalanisch", + "cs_CZ":"Tschechisch", + "cy_GB":"Walisisch", + "da_DK":"Dänisch", + "de_DE":"Deutsch", + "el_GR":"Griechisch", + "en_GB":"Englisch (UK)", + "en_US":"Englisch (US)", + "es_ES":"Spanisch (ES)", + "et_EE":"Estnisch", + "eu_ES":"Baskisch", + "fa_IR":"Persisch", + "fi_FI":"Finnisch", + "fo_FO":"Färöisch", + "fr_CA":"Französisch (CN)", + "fr_FR":"Französisch (FR)", + "ga_IE":"Irisch", + "gl_ES":"Galizisch", + "gn_PY":"Guarani", + "he_IL":"Hebräisch", + "hi_IN":"Hindi", + "hr_HR":"Kroatisch", + "hu_HU":"Ungarisch", + "hy_AM":"Armenisch", + "id_ID":"Indonesisch", + "is_IS":"Isländisch", + "it_IT":"Italienisch", + "ja_JP":"Japanisch", + "ka_GE":"Georgisch", + "km_KH":"Khmer", + "ko_KR":"Koreanisch", + "ku_TR":"Kurdisch", + "lt_LT":"Litauisch", + "lv_LV":"Lettisch", + "mk_MK":"Mazedonisch", + "ml_IN":"Malayalam", + "ms_MY":"Malaiisch", + "nb_NO":"Norwegisch Bokmál", + "nn_NO":"Norwegisch Nynorsk", + "ne_NP":"Nepali", + "nl_NL":"Niederländisch", + "pa_IN":"Punjabi", + "pl_PL":"Polnisch", + "ps_AF":"Pashto", + "pt_BR":"Portugiesisch (BR)", + "pt_PT":"Portugiesisch (PT)", + "ro_RO":"Rumänisch", + "ru_RU":"Russisch", + "sk_SK":"Slowakisch", + "sl_SI":"Slowenisch", + "sq_AL":"Albanisch", + "sr_RS":"Serbisch", + "sv_SE":"Schwedisch", + "sw_KE":"Suaheli", + "ta_IN":"Tamil", + "te_IN":"Telugu", + "th_TH":"Thailändisch", + "tl_PH":"Tagalog", + "tr_TR":"Tükisch", + "uk_UA":"Ukrainisch", + "ur_PK":"Urdu", + "vi_VN":"Vietnamesisch", + "zh_CN":"Chinesisch vereinfacht (CN)", + "zh_HK":"Chinesisch traditionell (HK)", + "zh_TW":"Chinesisch traditionell (TW)" + }, + "dateSearchRanges": { + "on": "Am", + "notOn": "Nicht am", + "after": "Nach", + "before": "Vor", + "between": "Zwischen", + "today": "Heute", + "past": "Vergangenheit", + "future": "Zukunft" + }, + "intSearchRanges": { + "equals": "Gleich", + "notEquals": "Nicht gleich", + "greaterThan": "Größer als", + "lessThan": "Weniger als", + "greaterThanOrEquals": "Größer oder gleich als", + "lessThanOrEquals": "Weniger oder gleich als", + "between": "Zwischen" + }, + "autorefreshInterval": { + "0": "Kein(e)", + "0.5": "30 Sekunden", + "1": "1 Minute", + "2": "2 Minuten", + "5": "5 Minuten", + "10": "10 Minuten" + }, + "phoneNumber": { + "Mobile": "Telefon Mobil", + "Office": "Büro", + "Fax": "Fax", + "Home": "Startseite", + "Other": "Andere" + } + }, + "sets": { + "summernote": { + "NOTICE": "Sie finden die Übersetzung hier: https:\/\/github.com\/HackerWins\/summernote\/tree\/master\/lang", + "font":{ + "bold":"Fett", + "italic":"Kursiv", + "underline":"Unterstrichen", + "strike":"Durchgestrichen", + "clear":"Font Stil entfernen", + "height":"Zeilenhöhe", + "name":"Schriftfamilie", + "size":"Schriftgröße" + }, + "image":{ + "image":"Bild", + "insert":"Bild einfügen", + "resizeFull":"Originalgröße", + "resizeHalf":"Größe 1\/2", + "resizeQuarter":"Größe 1\/4", + "floatLeft":"Linksbündig", + "floatRight":"Rechtsbündig", + "floatNone":"Kein Textfluss", + "dragImageHere":"Ziehen Sie ein Bild mit der Maus hierher", + "selectFromFiles":"Wählen Sie eine Datei aus", + "url":"Grafik URL", + "remove":"Grafik entfernen" + }, + "link":{ + "link":"Link", + "insert":"Link einfügen", + "unlink":"Link entfernen", + "edit":"Bearbeiten", + "textToDisplay":"Anzeigetext", + "url":"Ziel des Links?", + "openInNewWindow":"In einem neuen Fenster öffnen" + }, + "video":{ + "video":"Video", + "videoLink":"Video Link", + "insert":"Video einfügen", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram oder DailyMotion)" + }, + "table":{ + "table":"Tabelle" + }, + "hr":{ + "insert":"Eine horizontale Linie einfügen" + }, + "style":{ + "style":"Stil", + "normal":"Normal", + "blockquote":"Zitat", + "pre":"Quellcode", + "h1":"Überschrift 1", + "h2":"Überschrift 2", + "h3":"Überschrift 3", + "h4":"Überschrift 4", + "h5":"Überschrift 5", + "h6":"Überschrift 6" + }, + "lists":{ + "unordered":"Unsortierte Liste", + "ordered":"Nummerierte Liste" + }, + "options":{ + "help":"Hilfe", + "fullscreen":"Vollbild", + "codeview":"HTML-Code anzeigen" + }, + "paragraph":{ + "paragraph":"Absatz", + "outdent":"Ausrückung", + "indent":"Einrückung", + "left":"Links ausrichten", + "center":"Zentriert ausrichten", + "right":"Rechts ausrichten", + "justify":"Blocksatz" + }, + "color":{ + "recent":"Letzte Farbe", + "more":"Mehr Farben", + "background":"Hintergrundfarbe", + "foreground":"Schriftfarbe", + "transparent":"Transparenz", + "setTransparent":"Transparenz setzen", + "reset":"Zurücksetzen", + "resetToDefault":"Zurücksetzen auf Standard" + }, + "shortcut":{ + "shortcuts":"Tastaturkürzel", + "close":"Schließen", + "textFormatting":"Textformatierung", + "action":"Aktion", + "paragraphFormatting":"Absatzformatierung", + "documentStyle":"Dokumentenstil" + }, + "history":{ + "undo":"Rückgängig", + "redo":"Wiederholen" + } + } + } } diff --git a/application/Espo/Resources/i18n/de_DE/Note.json b/application/Espo/Resources/i18n/de_DE/Note.json index 73456d53bd..bb12836623 100644 --- a/application/Espo/Resources/i18n/de_DE/Note.json +++ b/application/Espo/Resources/i18n/de_DE/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Senden", - "attachments": "Anhänge" - } + "fields": { + "post": "Senden", + "attachments": "Anhänge" + } } diff --git a/application/Espo/Resources/i18n/de_DE/Preferences.json b/application/Espo/Resources/i18n/de_DE/Preferences.json index e6d2a77f4c..058fd962fd 100644 --- a/application/Espo/Resources/i18n/de_DE/Preferences.json +++ b/application/Espo/Resources/i18n/de_DE/Preferences.json @@ -1,37 +1,37 @@ { - "fields": { - "dateFormat": "Datumsformat", - "timeFormat": "Zeitformat", - "timeZone": "Zeitzone", - "weekStart": "Erster Tag der Woche", - "thousandSeparator": "Tausender Trennzeichen", - "decimalMark": "Dezimaltrennzeichen", - "defaultCurrency": "Standardwährung", - "currencyList": "Währungsliste", - "language": "Sprache", - - "smtpServer": "Server", - "smtpPort": "Port", - "smtpAuth": "Autorisierung", - "smtpSecurity": "Sicherheit", - "smtpUsername": "Benutzername", - "emailAddress": "E-Mail", - "smtpPassword": "Passwort", - "smtpEmailAddress": "E-Mail Adresse", - - "exportDelimiter": "Export Trennzeichen", - - "receiveAssignmentEmailNotifications": "E-Mail Nachrichten bei Zuweisungen erhalten" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Sonntag", - "1": "Montag" - } - }, - "labels": { - "Notifications": "Benachrichtigungen" - } + "fields": { + "dateFormat": "Datumsformat", + "timeFormat": "Zeitformat", + "timeZone": "Zeitzone", + "weekStart": "Erster Tag der Woche", + "thousandSeparator": "Tausender Trennzeichen", + "decimalMark": "Dezimaltrennzeichen", + "defaultCurrency": "Standardwährung", + "currencyList": "Währungsliste", + "language": "Sprache", + + "smtpServer": "Server", + "smtpPort": "Port", + "smtpAuth": "Autorisierung", + "smtpSecurity": "Sicherheit", + "smtpUsername": "Benutzername", + "emailAddress": "E-Mail", + "smtpPassword": "Passwort", + "smtpEmailAddress": "E-Mail Adresse", + + "exportDelimiter": "Export Trennzeichen", + + "receiveAssignmentEmailNotifications": "E-Mail Nachrichten bei Zuweisungen erhalten" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Sonntag", + "1": "Montag" + } + }, + "labels": { + "Notifications": "Benachrichtigungen" + } } diff --git a/application/Espo/Resources/i18n/de_DE/Role.json b/application/Espo/Resources/i18n/de_DE/Role.json index 4f0a2765fe..9b9f858fd9 100644 --- a/application/Espo/Resources/i18n/de_DE/Role.json +++ b/application/Espo/Resources/i18n/de_DE/Role.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Name", - "roles": "Rollen" - }, - "links": { - "users": "Benutzer", - "teams": "Teams" - }, - "labels": { - "Access": "Zugang", - "Create Role": "Neue Rolle" - }, - "options": { - "accessList": { - "not-set": "nicht gesetzt", - "enabled": "Aktiv", - "disabled": "Inaktiv" - }, - "levelList": { - "all": "Alle", - "team": "Team", - "own": "Eigene", - "no": "Nein" - } - }, - "actions": { - "read": "Lesen", - "edit": "Bearbeiten", - "delete": "Löschen" - }, - "messages": { - "changesAfterClearCache": "Alle Änderungen werden erst nach Leeren des Caches wirksam." - } + "fields": { + "name": "Name", + "roles": "Rollen" + }, + "links": { + "users": "Benutzer", + "teams": "Teams" + }, + "labels": { + "Access": "Zugang", + "Create Role": "Neue Rolle" + }, + "options": { + "accessList": { + "not-set": "nicht gesetzt", + "enabled": "Aktiv", + "disabled": "Inaktiv" + }, + "levelList": { + "all": "Alle", + "team": "Team", + "own": "Eigene", + "no": "Nein" + } + }, + "actions": { + "read": "Lesen", + "edit": "Bearbeiten", + "delete": "Löschen" + }, + "messages": { + "changesAfterClearCache": "Alle Änderungen werden erst nach Leeren des Caches wirksam." + } } diff --git a/application/Espo/Resources/i18n/de_DE/ScheduledJob.json b/application/Espo/Resources/i18n/de_DE/ScheduledJob.json index 3c5a366d0b..4913207edd 100644 --- a/application/Espo/Resources/i18n/de_DE/ScheduledJob.json +++ b/application/Espo/Resources/i18n/de_DE/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Name", - "status": "Status", - "job": "Job", - "scheduling": "Planung (in Crontab Notation)" - }, - "links": { - "log": "Protokoll" - }, - "labels": { - "Create ScheduledJob": "Geplante Aufgabe erstellen" - }, - "options": { - "job": { - "CheckInboundEmails": "Eingehende E-Mail überprüfen", - "Cleanup": "Aufräumen" - }, - "cronSetup": { - "linux": "Hinweis: Fügen Sie diese Zeile zu Ihrer Crontab Datei hinzu, um geplante Aufgaben durchführen zu können:", - "mac": "Hinweis: Fügen Sie diese Zeile zu Ihrer Crontab Datei hinzu, um geplante Aufgaben durchführen zu können:", - "windows": "Hinweis: Erstellen Sie eine Stapeldatei mit den folgenden Kommandos um geplante Aufgaben mit dem Windows Aufgabenplaner durchzuführen:", - "default": "Hinweis: fügen Sie dieses Kommando zum CronJob hinzu (Geplante Aufgaben):" - }, - "status": { - "Active": "Aktiv", - "Inactive": "Inaktiv" - } - } + "fields": { + "name": "Name", + "status": "Status", + "job": "Job", + "scheduling": "Planung (in Crontab Notation)" + }, + "links": { + "log": "Protokoll" + }, + "labels": { + "Create ScheduledJob": "Geplante Aufgabe erstellen" + }, + "options": { + "job": { + "CheckInboundEmails": "Eingehende E-Mail überprüfen", + "Cleanup": "Aufräumen" + }, + "cronSetup": { + "linux": "Hinweis: Fügen Sie diese Zeile zu Ihrer Crontab Datei hinzu, um geplante Aufgaben durchführen zu können:", + "mac": "Hinweis: Fügen Sie diese Zeile zu Ihrer Crontab Datei hinzu, um geplante Aufgaben durchführen zu können:", + "windows": "Hinweis: Erstellen Sie eine Stapeldatei mit den folgenden Kommandos um geplante Aufgaben mit dem Windows Aufgabenplaner durchzuführen:", + "default": "Hinweis: fügen Sie dieses Kommando zum CronJob hinzu (Geplante Aufgaben):" + }, + "status": { + "Active": "Aktiv", + "Inactive": "Inaktiv" + } + } } diff --git a/application/Espo/Resources/i18n/de_DE/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/de_DE/ScheduledJobLogRecord.json index 5009a56e80..e4d2838497 100644 --- a/application/Espo/Resources/i18n/de_DE/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/de_DE/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Status", - "executionTime": "Ausführungszeit" - } + "fields": { + "status": "Status", + "executionTime": "Ausführungszeit" + } } diff --git a/application/Espo/Resources/i18n/de_DE/Settings.json b/application/Espo/Resources/i18n/de_DE/Settings.json index 82a185afb7..9374a8d041 100644 --- a/application/Espo/Resources/i18n/de_DE/Settings.json +++ b/application/Espo/Resources/i18n/de_DE/Settings.json @@ -1,76 +1,76 @@ { - "fields": { - "useCache": "Benutzer Cache", - "dateFormat": "Datumsformat", - "timeFormat": "Zeitformat", - "timeZone": "Zeitzone", - "weekStart": "Erster Tag der Woche", - "thousandSeparator": "Tausender Trennzeichen", - "decimalMark": "Dezimaltrennzeichen", - "defaultCurrency": "Standardwährung", - "baseCurrency": "Basiswährung", - "baseCurrency": "Basiswährung", - "currencyRates": "Wechselkurse", - - "currencyList": "Währungsliste", - "language": "Sprache", - - "companyLogo": "Firmenlogo", - - "smtpServer": "Server", - "smtpPort": "Port", - "smtpAuth": "Autorisierung", - "smtpSecurity": "Sicherheit", - "smtpUsername": "Benutzername", - "emailAddress": "E-Mail", - "smtpPassword": "Passwort", - "outboundEmailFromName": "Von Name", - "outboundEmailFromAddress": "Von Adresse", - "outboundEmailIsShared": "Kann von allen Benutzern verwendet werden", - - "recordsPerPage": "Datensätze pro Seite", - "recordsPerPageSmall": "Datensätze pro Seite (Klein)", - "tabList": "Reiter Liste", - "quickCreateList": "Liste Schnellerstellung", - - "exportDelimiter": "Export Trennzeichen", - - "authenticationMethod": "Authentifizierungs Methode", - "ldapHost": "Host", - "ldapPort": "Port", - "ldapAuth": "Autorisierung", - "ldapUsername": "Benutzername", - "ldapPassword": "Passwort", - "ldapBindRequiresDn": "Bind erfordert Dn", - "ldapBaseDn": "Basis Dn", - "ldapAccountCanonicalForm": "Kanonische Form Konto", - "ldapAccountDomainName": "Domain Name Konto", - "ldapTryUsernameSplit": "Benutzernamen Split versuchen", - "ldapCreateEspoUser": "Benutzer in EspoCRM erstellen", - "ldapSecurity": "Sicherheit", - "ldapUserLoginFilter": "Login Filter benutzen", - "ldapAccountDomainNameShort": "Domain Name Konto kurz", - "ldapOptReferrals": "Opt Referrals", - "disableExport": "Export deaktivieren (nur Admin ist berechtigt)", - "assignmentEmailNotifications": "E-Mail Nachrichten bei Zuweisungen senden", - "assignmentEmailNotificationsEntityList": "Module für Benachrichtigungen" - }, - "options": { - "weekStart": { - "0": "Sonntag", - "1": "Montag" - } - }, - "tooltips": { - "recordsPerPageSmall": "Anzahl Sätze in Beziehungssubpanels" - }, - "labels": { - "System": "System", - "Locale": "Lokale Einstellungen", - "SMTP": "SMTP", - "Configuration": "Konfiguration", - "Notifications": "Benachrichtigungen", - "Currency Settings": "Währunsgseinstellungen", - "Currency Rtes": "Währungskurse" - } + "fields": { + "useCache": "Benutzer Cache", + "dateFormat": "Datumsformat", + "timeFormat": "Zeitformat", + "timeZone": "Zeitzone", + "weekStart": "Erster Tag der Woche", + "thousandSeparator": "Tausender Trennzeichen", + "decimalMark": "Dezimaltrennzeichen", + "defaultCurrency": "Standardwährung", + "baseCurrency": "Basiswährung", + "baseCurrency": "Basiswährung", + "currencyRates": "Wechselkurse", + + "currencyList": "Währungsliste", + "language": "Sprache", + + "companyLogo": "Firmenlogo", + + "smtpServer": "Server", + "smtpPort": "Port", + "smtpAuth": "Autorisierung", + "smtpSecurity": "Sicherheit", + "smtpUsername": "Benutzername", + "emailAddress": "E-Mail", + "smtpPassword": "Passwort", + "outboundEmailFromName": "Von Name", + "outboundEmailFromAddress": "Von Adresse", + "outboundEmailIsShared": "Kann von allen Benutzern verwendet werden", + + "recordsPerPage": "Datensätze pro Seite", + "recordsPerPageSmall": "Datensätze pro Seite (Klein)", + "tabList": "Reiter Liste", + "quickCreateList": "Liste Schnellerstellung", + + "exportDelimiter": "Export Trennzeichen", + + "authenticationMethod": "Authentifizierungs Methode", + "ldapHost": "Host", + "ldapPort": "Port", + "ldapAuth": "Autorisierung", + "ldapUsername": "Benutzername", + "ldapPassword": "Passwort", + "ldapBindRequiresDn": "Bind erfordert Dn", + "ldapBaseDn": "Basis Dn", + "ldapAccountCanonicalForm": "Kanonische Form Konto", + "ldapAccountDomainName": "Domain Name Konto", + "ldapTryUsernameSplit": "Benutzernamen Split versuchen", + "ldapCreateEspoUser": "Benutzer in EspoCRM erstellen", + "ldapSecurity": "Sicherheit", + "ldapUserLoginFilter": "Login Filter benutzen", + "ldapAccountDomainNameShort": "Domain Name Konto kurz", + "ldapOptReferrals": "Opt Referrals", + "disableExport": "Export deaktivieren (nur Admin ist berechtigt)", + "assignmentEmailNotifications": "E-Mail Nachrichten bei Zuweisungen senden", + "assignmentEmailNotificationsEntityList": "Module für Benachrichtigungen" + }, + "options": { + "weekStart": { + "0": "Sonntag", + "1": "Montag" + } + }, + "tooltips": { + "recordsPerPageSmall": "Anzahl Sätze in Beziehungssubpanels" + }, + "labels": { + "System": "System", + "Locale": "Lokale Einstellungen", + "SMTP": "SMTP", + "Configuration": "Konfiguration", + "Notifications": "Benachrichtigungen", + "Currency Settings": "Währunsgseinstellungen", + "Currency Rtes": "Währungskurse" + } } diff --git a/application/Espo/Resources/i18n/de_DE/Team.json b/application/Espo/Resources/i18n/de_DE/Team.json index f03efea60b..82e8ce562c 100644 --- a/application/Espo/Resources/i18n/de_DE/Team.json +++ b/application/Espo/Resources/i18n/de_DE/Team.json @@ -1,15 +1,15 @@ { - "fields": { - "name": "Name", - "roles": "Rollen" - }, - "links": { - "users": "Benutzer" - }, - "tooltips": { - "roles": "Alle Benutzer dieses Teams erben die Zugriffsrechte von ausgewählten Rollen." - }, - "labels": { - "Create Team": "Neues Team" - } + "fields": { + "name": "Name", + "roles": "Rollen" + }, + "links": { + "users": "Benutzer" + }, + "tooltips": { + "roles": "Alle Benutzer dieses Teams erben die Zugriffsrechte von ausgewählten Rollen." + }, + "labels": { + "Create Team": "Neues Team" + } } diff --git a/application/Espo/Resources/i18n/de_DE/User.json b/application/Espo/Resources/i18n/de_DE/User.json index ed25e99a3d..bd40b2ac8e 100644 --- a/application/Espo/Resources/i18n/de_DE/User.json +++ b/application/Espo/Resources/i18n/de_DE/User.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Name", - "userName": "Benutzername", - "title": "Funktion", - "isAdmin": "Ist Admin", - "defaultTeam": "Standard Team:", - "emailAddress": "E-Mail", - "phoneNumber": "Telefon", - "roles": "Rollen", - "password": "Passwort", - "passwordConfirm": "Passwort bestätigen", - "newPassword": "Neues Passwort" - }, - "links": { - "teams": "Teams", - "roles": "Rollen" - }, - "labels": { - "Create User": "Neuer Benutzer", - "Generate": "Erzeugen", - "Access": "Zugang", - "Preferences": "Benutzereinstellungen", - "Change Password": "Passwort ändern" - }, - "tooltips": { - "defaultTeam": "Alle Datensätze dieses Benutzers werden standardmäßig seinem Team zugeordnet." - }, - "messages": { - "passwordWillBeSent": "Das Passwort wird an die E-Mail Adresse des Benutzers gesendet", - "accountInfoEmailSubject": "Kontoinformation", - "accountInfoEmailBody": "Ihre Kontoinformation: Benutzername: {userName} - Passwort: {password} {siteUrl}", - "passwordChanged": "Das Passwort wurde geändert" - } + "fields": { + "name": "Name", + "userName": "Benutzername", + "title": "Funktion", + "isAdmin": "Ist Admin", + "defaultTeam": "Standard Team:", + "emailAddress": "E-Mail", + "phoneNumber": "Telefon", + "roles": "Rollen", + "password": "Passwort", + "passwordConfirm": "Passwort bestätigen", + "newPassword": "Neues Passwort" + }, + "links": { + "teams": "Teams", + "roles": "Rollen" + }, + "labels": { + "Create User": "Neuer Benutzer", + "Generate": "Erzeugen", + "Access": "Zugang", + "Preferences": "Benutzereinstellungen", + "Change Password": "Passwort ändern" + }, + "tooltips": { + "defaultTeam": "Alle Datensätze dieses Benutzers werden standardmäßig seinem Team zugeordnet." + }, + "messages": { + "passwordWillBeSent": "Das Passwort wird an die E-Mail Adresse des Benutzers gesendet", + "accountInfoEmailSubject": "Kontoinformation", + "accountInfoEmailBody": "Ihre Kontoinformation: Benutzername: {userName} - Passwort: {password} {siteUrl}", + "passwordChanged": "Das Passwort wurde geändert" + } } diff --git a/application/Espo/Resources/i18n/en_US/Admin.json b/application/Espo/Resources/i18n/en_US/Admin.json index 30eea5e1b4..8604de3a25 100644 --- a/application/Espo/Resources/i18n/en_US/Admin.json +++ b/application/Espo/Resources/i18n/en_US/Admin.json @@ -1,148 +1,148 @@ { - "labels": { - "Enabled": "Enabled", - "Disabled": "Disabled", - "System": "System", - "Users": "Users", - "Email": "Email", - "Data": "Data", - "Customization": "Customization", - "Available Fields": "Available Fields", - "Layout": "Layout", - "Enabled": "Enabled", - "Disabled": "Disabled", - "Add Panel": "Add Panel", - "Add Field": "Add Field", - "Settings": "Settings", - "Scheduled Jobs": "Scheduled Jobs", - "Upgrade": "Upgrade", - "Clear Cache": "Clear Cache", - "Rebuild": "Rebuild", - "Users": "Users", - "Teams": "Teams", - "Roles": "Roles", - "Outbound Emails": "Outbound Emails", - "Inbound Emails": "Inbound Emails", - "Email Templates": "Email Templates", - "Import": "Import", - "Layout Manager": "Layout Manager", - "Field Manager": "Field Manager", - "User Interface": "User Interface", - "Auth Tokens": "Auth Tokens", - "Authentication": "Authentication", - "Currency": "Currency", - "Integrations": "Integrations", - "Extensions": "Extensions", - "Upload": "Upload", - "Installing...": "Installing...", - "Upgrading...": "Upgrading...", - "Upgraded successfully": "Upgraded successfully", - "Installed successfully": "Installed successfully", - "Ready for upgrade": "Ready for upgrade", - "Run Upgrade": "Run Upgrade", - "Install": "Install", - "Ready for installation": "Ready for installation", - "Uninstalling...": "Uninstalling...", - "Uninstalled": "Uninstalled" - }, - "layouts": { - "list": "List", - "detail": "Detail", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Search Filters", - "massUpdate": "Mass Update", - "relationships": "Relationships" - }, - "fieldTypes": { - "address": "Address", - "array": "Array", - "foreign": "Foreign", - "duration": "Duration", - "password": "Password", - "parsonName": "Person Name", - "autoincrement": "Auto-increment", - "bool": "Boolean", - "currency": "Currency", - "date": "Date", - "datetime": "DateTime", - "email": "Email", - "enum": "Enum", - "enumInt": "Enum Integer", - "enumFloat": "Enum Float", - "float": "Float", - "int": "Int", - "link": "Link", - "linkMultiple": "Link Multiple", - "linkParent": "Link Parent", - "multienim": "Multienum", - "phone": "Phone", - "text": "Text", - "url": "Url", - "varchar": "Varchar", - "file": "File", - "image": "Image", - "multiEnum": "Multi-Enum" - }, - "fields": { - "type": "Type", - "name": "Name", - "label": "Label", - "required": "Required", - "default": "Default", - "maxLength": "Max Length", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Link", - "field": "Field", - "min": "Min", - "max": "Max", - "translation": "Translation", - "previewSize": "Preview Size" - }, - "messages": { - "upgradeVersion": "Your EspoCRM will be upgraded to version {version}. This can take some time.", - "upgradeDone": "Your EspoCRM has been upgraded to version {version}. Refresh your browser window.", - "upgradeBackup": "We recommend you to make backup of your EspoCRM files and data before upgrade.", - "thousandSeparatorEqualsDecimalMark": "Thousand separator can not be same as decimal mark", - "userHasNoEmailAddress": "User has not email address.", - "selectEntityType": "Select entity type in the left menu.", - "selectUpgradePackage": "Select upgrade package", - "downloadUpgradePackage": "Download needed upgrade package(s) here.", - "selectLayout": "Select needed layout in the left menu and edit it.", - "selectExtensionPackage": "Select extension package", - "extensionInstalled": "Extension {name} {version} has been installed.", - "installExtension": "Extension {name} {version} is ready for an istallation.", - "uninstallConfirmation": "Are you really want to uninstall the extension?" - }, - "descriptions": { - "settings": "System settings of application.", - "scheduledJob": "Jobs which are executed by cron.", - "upgrade": "Upgrade EspoCRM.", - "clearCache": "Clear all backend cache.", - "rebuild": "Rebuild backend and clear cache.", - "users": "Users management.", - "teams": "Teams management.", - "roles": "Roles management.", - "outboundEmails": "SMTP settings for outgoing emails.", - "inboundEmails": "Group IMAP email accouts. Email import and Email-to-Case.", - "emailTemplates": "Templates for outbound emails.", - "import": "Import data from CSV file.", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Create new fields or customize existing ones.", - "userInterface": "Configure UI.", - "authTokens": "Active auth sessions. IP address and last access date.", - "authentication": "Authentication settings.", - "currency": "Currency settings and rates.", - "extensions": "Install or uninstall extensions." - }, - "options": { - "previewSize": { - "x-small": "X-Small", - "small": "Small", - "medium": "Medium", - "large": "Large" - } - } + "labels": { + "Enabled": "Enabled", + "Disabled": "Disabled", + "System": "System", + "Users": "Users", + "Email": "Email", + "Data": "Data", + "Customization": "Customization", + "Available Fields": "Available Fields", + "Layout": "Layout", + "Enabled": "Enabled", + "Disabled": "Disabled", + "Add Panel": "Add Panel", + "Add Field": "Add Field", + "Settings": "Settings", + "Scheduled Jobs": "Scheduled Jobs", + "Upgrade": "Upgrade", + "Clear Cache": "Clear Cache", + "Rebuild": "Rebuild", + "Users": "Users", + "Teams": "Teams", + "Roles": "Roles", + "Outbound Emails": "Outbound Emails", + "Inbound Emails": "Inbound Emails", + "Email Templates": "Email Templates", + "Import": "Import", + "Layout Manager": "Layout Manager", + "Field Manager": "Field Manager", + "User Interface": "User Interface", + "Auth Tokens": "Auth Tokens", + "Authentication": "Authentication", + "Currency": "Currency", + "Integrations": "Integrations", + "Extensions": "Extensions", + "Upload": "Upload", + "Installing...": "Installing...", + "Upgrading...": "Upgrading...", + "Upgraded successfully": "Upgraded successfully", + "Installed successfully": "Installed successfully", + "Ready for upgrade": "Ready for upgrade", + "Run Upgrade": "Run Upgrade", + "Install": "Install", + "Ready for installation": "Ready for installation", + "Uninstalling...": "Uninstalling...", + "Uninstalled": "Uninstalled" + }, + "layouts": { + "list": "List", + "detail": "Detail", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Search Filters", + "massUpdate": "Mass Update", + "relationships": "Relationships" + }, + "fieldTypes": { + "address": "Address", + "array": "Array", + "foreign": "Foreign", + "duration": "Duration", + "password": "Password", + "parsonName": "Person Name", + "autoincrement": "Auto-increment", + "bool": "Boolean", + "currency": "Currency", + "date": "Date", + "datetime": "DateTime", + "email": "Email", + "enum": "Enum", + "enumInt": "Enum Integer", + "enumFloat": "Enum Float", + "float": "Float", + "int": "Int", + "link": "Link", + "linkMultiple": "Link Multiple", + "linkParent": "Link Parent", + "multienim": "Multienum", + "phone": "Phone", + "text": "Text", + "url": "Url", + "varchar": "Varchar", + "file": "File", + "image": "Image", + "multiEnum": "Multi-Enum" + }, + "fields": { + "type": "Type", + "name": "Name", + "label": "Label", + "required": "Required", + "default": "Default", + "maxLength": "Max Length", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Link", + "field": "Field", + "min": "Min", + "max": "Max", + "translation": "Translation", + "previewSize": "Preview Size" + }, + "messages": { + "upgradeVersion": "Your EspoCRM will be upgraded to version {version}. This can take some time.", + "upgradeDone": "Your EspoCRM has been upgraded to version {version}. Refresh your browser window.", + "upgradeBackup": "We recommend you to make backup of your EspoCRM files and data before upgrade.", + "thousandSeparatorEqualsDecimalMark": "Thousand separator can not be same as decimal mark", + "userHasNoEmailAddress": "User has not email address.", + "selectEntityType": "Select entity type in the left menu.", + "selectUpgradePackage": "Select upgrade package", + "downloadUpgradePackage": "Download needed upgrade package(s) here.", + "selectLayout": "Select needed layout in the left menu and edit it.", + "selectExtensionPackage": "Select extension package", + "extensionInstalled": "Extension {name} {version} has been installed.", + "installExtension": "Extension {name} {version} is ready for an istallation.", + "uninstallConfirmation": "Are you really want to uninstall the extension?" + }, + "descriptions": { + "settings": "System settings of application.", + "scheduledJob": "Jobs which are executed by cron.", + "upgrade": "Upgrade EspoCRM.", + "clearCache": "Clear all backend cache.", + "rebuild": "Rebuild backend and clear cache.", + "users": "Users management.", + "teams": "Teams management.", + "roles": "Roles management.", + "outboundEmails": "SMTP settings for outgoing emails.", + "inboundEmails": "Group IMAP email accouts. Email import and Email-to-Case.", + "emailTemplates": "Templates for outbound emails.", + "import": "Import data from CSV file.", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Create new fields or customize existing ones.", + "userInterface": "Configure UI.", + "authTokens": "Active auth sessions. IP address and last access date.", + "authentication": "Authentication settings.", + "currency": "Currency settings and rates.", + "extensions": "Install or uninstall extensions." + }, + "options": { + "previewSize": { + "x-small": "X-Small", + "small": "Small", + "medium": "Medium", + "large": "Large" + } + } } diff --git a/application/Espo/Resources/i18n/en_US/AuthToken.json b/application/Espo/Resources/i18n/en_US/AuthToken.json index 16f85074ba..28d25d7f9d 100644 --- a/application/Espo/Resources/i18n/en_US/AuthToken.json +++ b/application/Espo/Resources/i18n/en_US/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "User", - "ipAddress": "IP Address", - "lastAccess": "Last Access Date", - "createdAt": "Login Date" + "fields": { + "user": "User", + "ipAddress": "IP Address", + "lastAccess": "Last Access Date", + "createdAt": "Login Date" - } + } } diff --git a/application/Espo/Resources/i18n/en_US/DashletOptions.json b/application/Espo/Resources/i18n/en_US/DashletOptions.json index 1bb364da83..a25417fd22 100644 --- a/application/Espo/Resources/i18n/en_US/DashletOptions.json +++ b/application/Espo/Resources/i18n/en_US/DashletOptions.json @@ -1,10 +1,10 @@ { - "fields": { - "title": "Title", - "dateFrom": "Date From", - "dateTo": "Date To", - "autorefreshInterval": "Auto-refresh Interval", - "displayRecords": "Display Records", - "isDoubleHeight": "Height 2x" - } + "fields": { + "title": "Title", + "dateFrom": "Date From", + "dateTo": "Date To", + "autorefreshInterval": "Auto-refresh Interval", + "displayRecords": "Display Records", + "isDoubleHeight": "Height 2x" + } } diff --git a/application/Espo/Resources/i18n/en_US/Email.json b/application/Espo/Resources/i18n/en_US/Email.json index 6a278f5dc3..d88f525e27 100644 --- a/application/Espo/Resources/i18n/en_US/Email.json +++ b/application/Espo/Resources/i18n/en_US/Email.json @@ -1,44 +1,44 @@ { - "fields": { - "name": "Subject", - "parent": "Parent", - "status": "Status", - "dateSent": "Date Sent", - "from": "From", - "to": "To", - "cc": "CC", - "bcc": "BCC", - "isHtml": "Is Html", - "body": "Body", - "subject": "Subject", - "attachments": "Attachments", - "selectTemplate": "Select Template", - "fromEmailAddress": "From Address", - "toEmailAddresses": "To Address", - "emailAddress": "Email Address", - "deliveryDate": "Delivery Date" - }, - "links": { - }, - "options": { - "Draft": "Draft", - "Sending": "Sending", - "Sent": "Sent", - "Archived": "Archived" - }, - "labels": { - "Create Email": "Archive Email", - "Archive Email": "Archive Email", - "Compose": "Compose", - "Reply": "Reply", - "Reply to All": "Reply to All", - "Forward": "Forward", - "Original message": "Original message", - "Forwarded message": "Forwarded message", - "Email Accounts": "Email Accounts" - }, - "presetFilters": { - "sent": "Sent", - "archived": "Archived" - } + "fields": { + "name": "Subject", + "parent": "Parent", + "status": "Status", + "dateSent": "Date Sent", + "from": "From", + "to": "To", + "cc": "CC", + "bcc": "BCC", + "isHtml": "Is Html", + "body": "Body", + "subject": "Subject", + "attachments": "Attachments", + "selectTemplate": "Select Template", + "fromEmailAddress": "From Address", + "toEmailAddresses": "To Address", + "emailAddress": "Email Address", + "deliveryDate": "Delivery Date" + }, + "links": { + }, + "options": { + "Draft": "Draft", + "Sending": "Sending", + "Sent": "Sent", + "Archived": "Archived" + }, + "labels": { + "Create Email": "Archive Email", + "Archive Email": "Archive Email", + "Compose": "Compose", + "Reply": "Reply", + "Reply to All": "Reply to All", + "Forward": "Forward", + "Original message": "Original message", + "Forwarded message": "Forwarded message", + "Email Accounts": "Email Accounts" + }, + "presetFilters": { + "sent": "Sent", + "archived": "Archived" + } } diff --git a/application/Espo/Resources/i18n/en_US/EmailAccount.json b/application/Espo/Resources/i18n/en_US/EmailAccount.json index b0775ba57a..10845a516e 100644 --- a/application/Espo/Resources/i18n/en_US/EmailAccount.json +++ b/application/Espo/Resources/i18n/en_US/EmailAccount.json @@ -1,29 +1,29 @@ { - "fields": { - "name": "Name", - "status": "Status", - "host": "Host", - "username": "Username", - "password": "Password", - "port": "Port", - "monitoredFolders": "Monitored Folders", - "ssl": "SSL", - "fetchSince": "Fetch Since" - }, - "links": { - }, - "options": { - "status": { - "Active": "Active", - "Inactive": "Inactive" - } - }, - "labels": { - "Create EmailAccount": "Create Email Account", - "IMAP": "IMAP", - "Main": "Main" - }, - "messages": { - "couldNotConnectToImap": "Could not connect to IMAP server" - } + "fields": { + "name": "Name", + "status": "Status", + "host": "Host", + "username": "Username", + "password": "Password", + "port": "Port", + "monitoredFolders": "Monitored Folders", + "ssl": "SSL", + "fetchSince": "Fetch Since" + }, + "links": { + }, + "options": { + "status": { + "Active": "Active", + "Inactive": "Inactive" + } + }, + "labels": { + "Create EmailAccount": "Create Email Account", + "IMAP": "IMAP", + "Main": "Main" + }, + "messages": { + "couldNotConnectToImap": "Could not connect to IMAP server" + } } diff --git a/application/Espo/Resources/i18n/en_US/EmailAddress.json b/application/Espo/Resources/i18n/en_US/EmailAddress.json index 2f9d2aa22c..b85616ab14 100644 --- a/application/Espo/Resources/i18n/en_US/EmailAddress.json +++ b/application/Espo/Resources/i18n/en_US/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Primary", - "Opted Out": "Opted Out", - "Invalid": "Invalid" - } + "labels": { + "Primary": "Primary", + "Opted Out": "Opted Out", + "Invalid": "Invalid" + } } diff --git a/application/Espo/Resources/i18n/en_US/EmailTemplate.json b/application/Espo/Resources/i18n/en_US/EmailTemplate.json index 4e37bc0c6c..a56d7f31e9 100644 --- a/application/Espo/Resources/i18n/en_US/EmailTemplate.json +++ b/application/Espo/Resources/i18n/en_US/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Name", - "status": "Status", - "isHtml": "Is Html", - "body": "Body", - "subject": "Subject", - "attachments": "Attachments", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Create Email Template" - } + "fields": { + "name": "Name", + "status": "Status", + "isHtml": "Is Html", + "body": "Body", + "subject": "Subject", + "attachments": "Attachments", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Create Email Template" + } } diff --git a/application/Espo/Resources/i18n/en_US/Extension.json b/application/Espo/Resources/i18n/en_US/Extension.json index dd3af846a0..3482a65475 100644 --- a/application/Espo/Resources/i18n/en_US/Extension.json +++ b/application/Espo/Resources/i18n/en_US/Extension.json @@ -1,15 +1,15 @@ { - "fields": { - "name": "Name", - "version": "Version", - "description": "Description", - "isInstalled": "Installed" - }, - "labels": { - "Uninstall": "Uninstall", - "Install": "Install" - }, - "messages": { - "uninstalled": "Extension {name} has been uninstalled" - } + "fields": { + "name": "Name", + "version": "Version", + "description": "Description", + "isInstalled": "Installed" + }, + "labels": { + "Uninstall": "Uninstall", + "Install": "Install" + }, + "messages": { + "uninstalled": "Extension {name} has been uninstalled" + } } diff --git a/application/Espo/Resources/i18n/en_US/ExternalAccount.json b/application/Espo/Resources/i18n/en_US/ExternalAccount.json index 841a36bcd5..edb8e19f1d 100644 --- a/application/Espo/Resources/i18n/en_US/ExternalAccount.json +++ b/application/Espo/Resources/i18n/en_US/ExternalAccount.json @@ -1,8 +1,8 @@ { - "labels": { - "Connect": "Connect", - "Connected": "Connected" - }, - "help": { - } + "labels": { + "Connect": "Connect", + "Connected": "Connected" + }, + "help": { + } } diff --git a/application/Espo/Resources/i18n/en_US/Global.json b/application/Espo/Resources/i18n/en_US/Global.json index 1bd60423a7..25bd96f647 100644 --- a/application/Espo/Resources/i18n/en_US/Global.json +++ b/application/Espo/Resources/i18n/en_US/Global.json @@ -1,434 +1,434 @@ { - "scopeNames": { - "Email": "Email", - "User": "User", - "Team": "Team", - "Role": "Role", - "EmailTemplate": "Email Template", - "EmailAccount": "Email Account", - "OutboundEmail": "Outbound Email", - "ScheduledJob": "Scheduled Job", - "ExternalAccount": "External Account", - "Extension": "Extension" - }, - "scopeNamesPlural": { - "Email": "Emails", - "User": "Users", - "Team": "Teams", - "Role": "Roles", - "EmailTemplate": "Email Templates", - "EmailAccount": "Email Accounts", - "OutboundEmail": "Outbound Emails", - "ScheduledJob": "Scheduled Jobs", - "ExternalAccount": "External Accounts", - "Extension": "Extensions" - }, - "labels": { - "Misc": "Misc", - "Merge": "Merge", - "None": "None", - "by": "by", - "Saved": "Saved", - "Error": "Error", - "Select": "Select", - "Not valid": "Not valid", - "Please wait...": "Please wait...", - "Please wait": "Please wait", - "Loading...": "Loading...", - "Uploading...": "Uploading...", - "Sending...": "Sending...", - "Removed": "Removed", - "Posted": "Posted", - "Linked": "Linked", - "Unlinked": "Unlinked", - "Access denied": "Access denied", - "Access": "Access", - "Are you sure?": "Are you sure?", - "Record has been removed": "Record has been removed", - "Wrong username/password": "Wrong username/password", - "Post cannot be empty": "Post cannot be empty", - "Removing...": "Removing...", - "Unlinking...": "Unlinking...", - "Posting...": "Posting...", - "Username can not be empty!": "Username can not be empty!", - "Cache is not enabled": "Cache is not enabled", - "Cache has been cleared": "Cache has been cleared", - "Rebuild has been done": "Rebuild has been done", - "Saving...": "Saving...", - "Modified": "Modified", - "Created": "Created", - "Create": "Create", - "create": "create", - "Overview": "Overview", - "Details": "Details", - "Add Filter": "Add Filter", - "Add Dashlet": "Add Dashlet", - "Add": "Add", - "Reset": "Reset", - "Menu": "Menu", - "More": "More", - "Search": "Search", - "Only My": "Only My", - "Open": "Open", - "Admin": "Admin", - "About": "About", - "Refresh": "Refresh", - "Remove": "Remove", - "Options": "Options", - "Username": "Username", - "Password": "Password", - "Login": "Login", - "Log Out": "Log Out", - "Preferences": "Preferences", - "State": "State", - "Street": "Street", - "Country": "Country", - "City": "City", - "PostalCode": "Postal Code", - "Followed": "Followed", - "Follow": "Follow", - "Clear Local Cache": "Clear Local Cache", - "Actions": "Actions", - "Delete": "Delete", - "Update": "Update", - "Save": "Save", - "Edit": "Edit", - "Cancel": "Cancel", - "Unlink": "Unlink", - "Mass Update": "Mass Update", - "Export": "Export", - "No Data": "No Data", - "No Access": "No Access", - "All": "All", - "Active": "Active", - "Inactive": "Inactive", - "Write your comment here": "Write your comment here", - "Post": "Post", - "Stream": "Stream", - "Show more": "Show more", - "Dashlet Options": "Dashlet Options", - "Full Form": "Full Form", - "Insert": "Insert", - "Person": "Person", - "First Name": "First Name", - "Last Name": "Last Name", - "Original": "Original", - "You": "You", - "you": "you", - "change": "change", - "Primary": "Primary", - "Save Filters": "Save Filters", - "Administration": "Administration", - "Run Import": "Run Import", - "Duplicate": "Duplicate", - "Notifications": "Notifications", - "Mark all read": "Mark all read", - "See more": "See more", - "Today": "Today", - "Tomorrow": "Tomorrow", - "Yesterday": "Yesterday" - }, - "messages": { - "notModified": "You have not modified the record", - "duplicate": "The record you are creating seems to be a duplicate", - "fieldIsRequired": "{field} is required", - "fieldShouldBeEmail": "{field} should be valid email", - "fieldShouldBeFloat": "{field} should be valid float", - "fieldShouldBeInt": "{field} should be valid integer", - "fieldShouldBeDate": "{field} should be valid date", - "fieldShouldBeDatetime": "{field} should be valid date/time", - "fieldShouldAfter": "{field} should be after {otherField}", - "fieldShouldBefore": "{field} should be before {otherField}", - "fieldShouldBeBetween": "{field} should be between {min} and {max}", - "fieldShouldBeLess": "{field} should be less then {value}", - "fieldShouldBeGreater": "{field} should be greater then {value}", - "fieldBadPasswordConfirm": "{field} confirmed improperly", - "resetPreferencesDone": "Preferences has been reset to defaults", - "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", - "assignmentEmailNotificationBody": "{assignerUserName} has assigned {entityType} '{Entity.name}' to you\n\n{recordUrl}", - "confirmation": "Are you sure?", - "resetPreferencesConfirmation": "Are you sure you want to reset preferences to defaults?", - "removeRecordConfirmation": "Are you sure you want to remove the record?", - "unlinkRecordConfirmation": "Are you sure you want to unlink relationship?", - "removeSelectedRecordsConfirmation": "Are you sure you want to remove selected records?" - }, - "boolFilters": { - "onlyMy": "Only My", - "open": "Open", - "active": "Active" - }, - "fields": { - "name": "Name", - "firstName": "First Name", - "lastName": "Last Name", - "salutationName": "Salutation", - "assignedUser": "Assigned User", - "emailAddress": "Email", - "assignedUserName": "Assigned User Name", - "teams": "Teams", - "createdAt": "Created At", - "modifiedAt": "Modified At", - "createdBy": "Created By", - "modifiedBy": "Modified By" - }, - "links": { - "teams": "Teams", - "users": "Users" - }, - "dashlets": { - "Stream": "Stream" - }, - "streamMessages": { - "create": "{user} created {entityType} {entity}", - "createAssigned": "{user} created {entityType} {entity} assigned to {assignee}", - "assign": "{user} assigned {entityType} {entity} to {assignee}", - "post": "{user} posted on {entityType} {entity}", - "attach": "{user} attached on {entityType} {entity}", - "status": "{user} updated {field} on {entityType} {entity}", - "update": "{user} updated {entityType} {entity}", - "createRelated": "{user} created {relatedEntityType} {relatedEntity} linked to {entityType} {entity}", - "emailReceived": "{entity} has been received for {entityType} {entity}", - "mentionInPost": "{user} mentioned {mentioned} on {entityType} {entity}", - - "createThis": "{user} created this {entityType}", - "createAssignedThis": "{user} created this {entityType} assigned to {assignee}", - "assignThis": "{user} assigned this {entityType} to {assignee}", - "postThis": "{user} posted", - "attachThis": "{user} attached", - "statusThis": "{user} updated {field}", - "updateThis": "{user} updated this {entityType}", - "createRelatedThis": "{user} created {relatedEntityType} {relatedEntity} linked to this {entityType}", - "emailReceivedThis": "{entity} has been received" - }, - "lists": { - "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] - }, - "options": { - "salutationName": { - "Mr.": "Mr.", - "Mrs.": "Mrs.", - "Dr.": "Dr.", - "Drs.": "Drs." - }, - "language": { - "af_ZA":"Afrikaans", - "az_AZ":"Azerbaijani", - "be_BY":"Belarusian", - "bg_BG":"Bulgarian", - "bn_IN":"Bengali", - "bs_BA":"Bosnian", - "ca_ES":"Catalan", - "cs_CZ":"Czech", - "cy_GB":"Welsh", - "da_DK":"Danish", - "de_DE":"German", - "el_GR":"Greek", - "en_GB":"English (UK)", - "en_US":"English (US)", - "es_ES":"Spanish (Spain)", - "et_EE":"Estonian", - "eu_ES":"Basque", - "fa_IR":"Persian", - "fi_FI":"Finnish", - "fo_FO":"Faroese", - "fr_CA":"French (Canada)", - "fr_FR":"French (France)", - "ga_IE":"Irish", - "gl_ES":"Galician", - "gn_PY":"Guarani", - "he_IL":"Hebrew", - "hi_IN":"Hindi", - "hr_HR":"Croatian", - "hu_HU":"Hungarian", - "hy_AM":"Armenian", - "id_ID":"Indonesian", - "is_IS":"Icelandic", - "it_IT":"Italian", - "ja_JP":"Japanese", - "ka_GE":"Georgian", - "km_KH":"Khmer", - "ko_KR":"Korean", - "ku_TR":"Kurdish", - "lt_LT":"Lithuanian", - "lv_LV":"Latvian", - "mk_MK":"Macedonian", - "ml_IN":"Malayalam", - "ms_MY":"Malay", - "nb_NO":"Norwegian Bokmål", - "nn_NO":"Norwegian Nynorsk", - "ne_NP":"Nepali", - "nl_NL":"Dutch", - "pa_IN":"Punjabi", - "pl_PL":"Polish", - "ps_AF":"Pashto", - "pt_BR":"Portuguese (Brazil)", - "pt_PT":"Portuguese (Portugal)", - "ro_RO":"Romanian", - "ru_RU":"Russian", - "sk_SK":"Slovak", - "sl_SI":"Slovene", - "sq_AL":"Albanian", - "sr_RS":"Serbian", - "sv_SE":"Swedish", - "sw_KE":"Swahili", - "ta_IN":"Tamil", - "te_IN":"Telugu", - "th_TH":"Thai", - "tl_PH":"Tagalog", - "tr_TR":"Turkish", - "uk_UA":"Ukrainian", - "ur_PK":"Urdu", - "vi_VN":"Vietnamese", - "zh_CN":"Simplified Chinese (China)", - "zh_HK":"Traditional Chinese (Hong Kong)", - "zh_TW":"Traditional Chinese (Taiwan)" - }, - "dateSearchRanges": { - "on": "On", - "notOn": "Not On", - "after": "After", - "before": "Before", - "between": "Between", - "today": "Today", - "past": "Past", - "future": "Future", - "currentMonth": "Current Month", - "lastMonth": "Last Month", - "currentQuarter": "Current Quarter", - "lastQuarter": "Last Quarter", - "currentYear": "Current Year", - "lastYear": "Last Year" - }, - "intSearchRanges": { - "equals": "Equals", - "notEquals": "Not Equals", - "greaterThan": "Greater Than", - "lessThan": "Less Than", - "greaterThanOrEquals": "Greater Than or Equals", - "lessThanOrEquals": "Less Than or Equals", - "between": "Between" - }, - "autorefreshInterval": { - "0": "None", - "0.5": "30 seconds", - "1": "1 minute", - "2": "2 minutes", - "5": "5 minutes", - "10": "10 minutes" - }, - "phoneNumber": { - "Mobile": "Mobile", - "Office": "Office", - "Fax": "Fax", - "Home": "Home", - "Other": "Other" - } - }, - "sets": { - "summernote": { - "NOTICE": "You can find translation here: https://github.com/HackerWins/summernote/tree/master/lang", - "font":{ - "bold":"Bold", - "italic":"Italic", - "underline":"Underline", - "strike":"Strike", - "clear":"Remove Font Style", - "height":"Line Height", - "name":"Font Family", - "size":"Font Size" - }, - "image":{ - "image":"Picture", - "insert":"Insert Image", - "resizeFull":"Resize Full", - "resizeHalf":"Resize Half", - "resizeQuarter":"Resize Quarter", - "floatLeft":"Float Left", - "floatRight":"Float Right", - "floatNone":"Float None", - "dragImageHere":"Drag an image here", - "selectFromFiles":"Select from files", - "url":"Image URL", - "remove":"Remove Image" - }, - "link":{ - "link":"Link", - "insert":"Insert Link", - "unlink":"Unlink", - "edit":"Edit", - "textToDisplay":"Text to display", - "url":"To what URL should this link go?", - "openInNewWindow":"Open in new window" - }, - "video":{ - "video":"Video", - "videoLink":"Video Link", - "insert":"Insert Video", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" - }, - "table":{ - "table":"Table" - }, - "hr":{ - "insert":"Insert Horizontal Rule" - }, - "style":{ - "style":"Style", - "normal":"Normal", - "blockquote":"Quote", - "pre":"Code", - "h1":"Header 1", - "h2":"Header 2", - "h3":"Header 3", - "h4":"Header 4", - "h5":"Header 5", - "h6":"Header 6" - }, - "lists":{ - "unordered":"Unordered list", - "ordered":"Ordered list" - }, - "options":{ - "help":"Help", - "fullscreen":"Full Screen", - "codeview":"Code View" - }, - "paragraph":{ - "paragraph":"Paragraph", - "outdent":"Outdent", - "indent":"Indent", - "left":"Align left", - "center":"Align center", - "right":"Align right", - "justify":"Justify full" - }, - "color":{ - "recent":"Recent Color", - "more":"More Color", - "background":"BackColor", - "foreground":"FontColor", - "transparent":"Transparent", - "setTransparent":"Set transparent", - "reset":"Reset", - "resetToDefault":"Reset to default" - }, - "shortcut":{ - "shortcuts":"Keyboard shortcuts", - "close":"Close", - "textFormatting":"Text formatting", - "action":"Action", - "paragraphFormatting":"Paragraph formatting", - "documentStyle":"Document Style" - }, - "history":{ - "undo":"Undo", - "redo":"Redo" - } - } - } + "scopeNames": { + "Email": "Email", + "User": "User", + "Team": "Team", + "Role": "Role", + "EmailTemplate": "Email Template", + "EmailAccount": "Email Account", + "OutboundEmail": "Outbound Email", + "ScheduledJob": "Scheduled Job", + "ExternalAccount": "External Account", + "Extension": "Extension" + }, + "scopeNamesPlural": { + "Email": "Emails", + "User": "Users", + "Team": "Teams", + "Role": "Roles", + "EmailTemplate": "Email Templates", + "EmailAccount": "Email Accounts", + "OutboundEmail": "Outbound Emails", + "ScheduledJob": "Scheduled Jobs", + "ExternalAccount": "External Accounts", + "Extension": "Extensions" + }, + "labels": { + "Misc": "Misc", + "Merge": "Merge", + "None": "None", + "by": "by", + "Saved": "Saved", + "Error": "Error", + "Select": "Select", + "Not valid": "Not valid", + "Please wait...": "Please wait...", + "Please wait": "Please wait", + "Loading...": "Loading...", + "Uploading...": "Uploading...", + "Sending...": "Sending...", + "Removed": "Removed", + "Posted": "Posted", + "Linked": "Linked", + "Unlinked": "Unlinked", + "Access denied": "Access denied", + "Access": "Access", + "Are you sure?": "Are you sure?", + "Record has been removed": "Record has been removed", + "Wrong username/password": "Wrong username/password", + "Post cannot be empty": "Post cannot be empty", + "Removing...": "Removing...", + "Unlinking...": "Unlinking...", + "Posting...": "Posting...", + "Username can not be empty!": "Username can not be empty!", + "Cache is not enabled": "Cache is not enabled", + "Cache has been cleared": "Cache has been cleared", + "Rebuild has been done": "Rebuild has been done", + "Saving...": "Saving...", + "Modified": "Modified", + "Created": "Created", + "Create": "Create", + "create": "create", + "Overview": "Overview", + "Details": "Details", + "Add Filter": "Add Filter", + "Add Dashlet": "Add Dashlet", + "Add": "Add", + "Reset": "Reset", + "Menu": "Menu", + "More": "More", + "Search": "Search", + "Only My": "Only My", + "Open": "Open", + "Admin": "Admin", + "About": "About", + "Refresh": "Refresh", + "Remove": "Remove", + "Options": "Options", + "Username": "Username", + "Password": "Password", + "Login": "Login", + "Log Out": "Log Out", + "Preferences": "Preferences", + "State": "State", + "Street": "Street", + "Country": "Country", + "City": "City", + "PostalCode": "Postal Code", + "Followed": "Followed", + "Follow": "Follow", + "Clear Local Cache": "Clear Local Cache", + "Actions": "Actions", + "Delete": "Delete", + "Update": "Update", + "Save": "Save", + "Edit": "Edit", + "Cancel": "Cancel", + "Unlink": "Unlink", + "Mass Update": "Mass Update", + "Export": "Export", + "No Data": "No Data", + "No Access": "No Access", + "All": "All", + "Active": "Active", + "Inactive": "Inactive", + "Write your comment here": "Write your comment here", + "Post": "Post", + "Stream": "Stream", + "Show more": "Show more", + "Dashlet Options": "Dashlet Options", + "Full Form": "Full Form", + "Insert": "Insert", + "Person": "Person", + "First Name": "First Name", + "Last Name": "Last Name", + "Original": "Original", + "You": "You", + "you": "you", + "change": "change", + "Primary": "Primary", + "Save Filters": "Save Filters", + "Administration": "Administration", + "Run Import": "Run Import", + "Duplicate": "Duplicate", + "Notifications": "Notifications", + "Mark all read": "Mark all read", + "See more": "See more", + "Today": "Today", + "Tomorrow": "Tomorrow", + "Yesterday": "Yesterday" + }, + "messages": { + "notModified": "You have not modified the record", + "duplicate": "The record you are creating seems to be a duplicate", + "fieldIsRequired": "{field} is required", + "fieldShouldBeEmail": "{field} should be valid email", + "fieldShouldBeFloat": "{field} should be valid float", + "fieldShouldBeInt": "{field} should be valid integer", + "fieldShouldBeDate": "{field} should be valid date", + "fieldShouldBeDatetime": "{field} should be valid date/time", + "fieldShouldAfter": "{field} should be after {otherField}", + "fieldShouldBefore": "{field} should be before {otherField}", + "fieldShouldBeBetween": "{field} should be between {min} and {max}", + "fieldShouldBeLess": "{field} should be less then {value}", + "fieldShouldBeGreater": "{field} should be greater then {value}", + "fieldBadPasswordConfirm": "{field} confirmed improperly", + "resetPreferencesDone": "Preferences has been reset to defaults", + "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", + "assignmentEmailNotificationBody": "{assignerUserName} has assigned {entityType} '{Entity.name}' to you\n\n{recordUrl}", + "confirmation": "Are you sure?", + "resetPreferencesConfirmation": "Are you sure you want to reset preferences to defaults?", + "removeRecordConfirmation": "Are you sure you want to remove the record?", + "unlinkRecordConfirmation": "Are you sure you want to unlink relationship?", + "removeSelectedRecordsConfirmation": "Are you sure you want to remove selected records?" + }, + "boolFilters": { + "onlyMy": "Only My", + "open": "Open", + "active": "Active" + }, + "fields": { + "name": "Name", + "firstName": "First Name", + "lastName": "Last Name", + "salutationName": "Salutation", + "assignedUser": "Assigned User", + "emailAddress": "Email", + "assignedUserName": "Assigned User Name", + "teams": "Teams", + "createdAt": "Created At", + "modifiedAt": "Modified At", + "createdBy": "Created By", + "modifiedBy": "Modified By" + }, + "links": { + "teams": "Teams", + "users": "Users" + }, + "dashlets": { + "Stream": "Stream" + }, + "streamMessages": { + "create": "{user} created {entityType} {entity}", + "createAssigned": "{user} created {entityType} {entity} assigned to {assignee}", + "assign": "{user} assigned {entityType} {entity} to {assignee}", + "post": "{user} posted on {entityType} {entity}", + "attach": "{user} attached on {entityType} {entity}", + "status": "{user} updated {field} on {entityType} {entity}", + "update": "{user} updated {entityType} {entity}", + "createRelated": "{user} created {relatedEntityType} {relatedEntity} linked to {entityType} {entity}", + "emailReceived": "{entity} has been received for {entityType} {entity}", + "mentionInPost": "{user} mentioned {mentioned} on {entityType} {entity}", + + "createThis": "{user} created this {entityType}", + "createAssignedThis": "{user} created this {entityType} assigned to {assignee}", + "assignThis": "{user} assigned this {entityType} to {assignee}", + "postThis": "{user} posted", + "attachThis": "{user} attached", + "statusThis": "{user} updated {field}", + "updateThis": "{user} updated this {entityType}", + "createRelatedThis": "{user} created {relatedEntityType} {relatedEntity} linked to this {entityType}", + "emailReceivedThis": "{entity} has been received" + }, + "lists": { + "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] + }, + "options": { + "salutationName": { + "Mr.": "Mr.", + "Mrs.": "Mrs.", + "Dr.": "Dr.", + "Drs.": "Drs." + }, + "language": { + "af_ZA":"Afrikaans", + "az_AZ":"Azerbaijani", + "be_BY":"Belarusian", + "bg_BG":"Bulgarian", + "bn_IN":"Bengali", + "bs_BA":"Bosnian", + "ca_ES":"Catalan", + "cs_CZ":"Czech", + "cy_GB":"Welsh", + "da_DK":"Danish", + "de_DE":"German", + "el_GR":"Greek", + "en_GB":"English (UK)", + "en_US":"English (US)", + "es_ES":"Spanish (Spain)", + "et_EE":"Estonian", + "eu_ES":"Basque", + "fa_IR":"Persian", + "fi_FI":"Finnish", + "fo_FO":"Faroese", + "fr_CA":"French (Canada)", + "fr_FR":"French (France)", + "ga_IE":"Irish", + "gl_ES":"Galician", + "gn_PY":"Guarani", + "he_IL":"Hebrew", + "hi_IN":"Hindi", + "hr_HR":"Croatian", + "hu_HU":"Hungarian", + "hy_AM":"Armenian", + "id_ID":"Indonesian", + "is_IS":"Icelandic", + "it_IT":"Italian", + "ja_JP":"Japanese", + "ka_GE":"Georgian", + "km_KH":"Khmer", + "ko_KR":"Korean", + "ku_TR":"Kurdish", + "lt_LT":"Lithuanian", + "lv_LV":"Latvian", + "mk_MK":"Macedonian", + "ml_IN":"Malayalam", + "ms_MY":"Malay", + "nb_NO":"Norwegian Bokmål", + "nn_NO":"Norwegian Nynorsk", + "ne_NP":"Nepali", + "nl_NL":"Dutch", + "pa_IN":"Punjabi", + "pl_PL":"Polish", + "ps_AF":"Pashto", + "pt_BR":"Portuguese (Brazil)", + "pt_PT":"Portuguese (Portugal)", + "ro_RO":"Romanian", + "ru_RU":"Russian", + "sk_SK":"Slovak", + "sl_SI":"Slovene", + "sq_AL":"Albanian", + "sr_RS":"Serbian", + "sv_SE":"Swedish", + "sw_KE":"Swahili", + "ta_IN":"Tamil", + "te_IN":"Telugu", + "th_TH":"Thai", + "tl_PH":"Tagalog", + "tr_TR":"Turkish", + "uk_UA":"Ukrainian", + "ur_PK":"Urdu", + "vi_VN":"Vietnamese", + "zh_CN":"Simplified Chinese (China)", + "zh_HK":"Traditional Chinese (Hong Kong)", + "zh_TW":"Traditional Chinese (Taiwan)" + }, + "dateSearchRanges": { + "on": "On", + "notOn": "Not On", + "after": "After", + "before": "Before", + "between": "Between", + "today": "Today", + "past": "Past", + "future": "Future", + "currentMonth": "Current Month", + "lastMonth": "Last Month", + "currentQuarter": "Current Quarter", + "lastQuarter": "Last Quarter", + "currentYear": "Current Year", + "lastYear": "Last Year" + }, + "intSearchRanges": { + "equals": "Equals", + "notEquals": "Not Equals", + "greaterThan": "Greater Than", + "lessThan": "Less Than", + "greaterThanOrEquals": "Greater Than or Equals", + "lessThanOrEquals": "Less Than or Equals", + "between": "Between" + }, + "autorefreshInterval": { + "0": "None", + "0.5": "30 seconds", + "1": "1 minute", + "2": "2 minutes", + "5": "5 minutes", + "10": "10 minutes" + }, + "phoneNumber": { + "Mobile": "Mobile", + "Office": "Office", + "Fax": "Fax", + "Home": "Home", + "Other": "Other" + } + }, + "sets": { + "summernote": { + "NOTICE": "You can find translation here: https://github.com/HackerWins/summernote/tree/master/lang", + "font":{ + "bold":"Bold", + "italic":"Italic", + "underline":"Underline", + "strike":"Strike", + "clear":"Remove Font Style", + "height":"Line Height", + "name":"Font Family", + "size":"Font Size" + }, + "image":{ + "image":"Picture", + "insert":"Insert Image", + "resizeFull":"Resize Full", + "resizeHalf":"Resize Half", + "resizeQuarter":"Resize Quarter", + "floatLeft":"Float Left", + "floatRight":"Float Right", + "floatNone":"Float None", + "dragImageHere":"Drag an image here", + "selectFromFiles":"Select from files", + "url":"Image URL", + "remove":"Remove Image" + }, + "link":{ + "link":"Link", + "insert":"Insert Link", + "unlink":"Unlink", + "edit":"Edit", + "textToDisplay":"Text to display", + "url":"To what URL should this link go?", + "openInNewWindow":"Open in new window" + }, + "video":{ + "video":"Video", + "videoLink":"Video Link", + "insert":"Insert Video", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" + }, + "table":{ + "table":"Table" + }, + "hr":{ + "insert":"Insert Horizontal Rule" + }, + "style":{ + "style":"Style", + "normal":"Normal", + "blockquote":"Quote", + "pre":"Code", + "h1":"Header 1", + "h2":"Header 2", + "h3":"Header 3", + "h4":"Header 4", + "h5":"Header 5", + "h6":"Header 6" + }, + "lists":{ + "unordered":"Unordered list", + "ordered":"Ordered list" + }, + "options":{ + "help":"Help", + "fullscreen":"Full Screen", + "codeview":"Code View" + }, + "paragraph":{ + "paragraph":"Paragraph", + "outdent":"Outdent", + "indent":"Indent", + "left":"Align left", + "center":"Align center", + "right":"Align right", + "justify":"Justify full" + }, + "color":{ + "recent":"Recent Color", + "more":"More Color", + "background":"BackColor", + "foreground":"FontColor", + "transparent":"Transparent", + "setTransparent":"Set transparent", + "reset":"Reset", + "resetToDefault":"Reset to default" + }, + "shortcut":{ + "shortcuts":"Keyboard shortcuts", + "close":"Close", + "textFormatting":"Text formatting", + "action":"Action", + "paragraphFormatting":"Paragraph formatting", + "documentStyle":"Document Style" + }, + "history":{ + "undo":"Undo", + "redo":"Redo" + } + } + } } diff --git a/application/Espo/Resources/i18n/en_US/Import.json b/application/Espo/Resources/i18n/en_US/Import.json index 0eb8be2a83..c9cefbb76e 100644 --- a/application/Espo/Resources/i18n/en_US/Import.json +++ b/application/Espo/Resources/i18n/en_US/Import.json @@ -1,15 +1,15 @@ { - "labels": { - "Revert": "Revert", - "Return to Import": "Return to Import", - "Run Import": "Run Import", - "Back": "Back", - "Field Mapping": "Field Mapping", - "Default Values": "Default Values", - "Add Field": "Add Field", - "Created": "Created", - "Updated": "Updated", - "Result": "Result", - "Show records": "Show records" - } + "labels": { + "Revert": "Revert", + "Return to Import": "Return to Import", + "Run Import": "Run Import", + "Back": "Back", + "Field Mapping": "Field Mapping", + "Default Values": "Default Values", + "Add Field": "Add Field", + "Created": "Created", + "Updated": "Updated", + "Result": "Result", + "Show records": "Show records" + } } diff --git a/application/Espo/Resources/i18n/en_US/Integration.json b/application/Espo/Resources/i18n/en_US/Integration.json index 37aed3d2e5..1001dc1dda 100644 --- a/application/Espo/Resources/i18n/en_US/Integration.json +++ b/application/Espo/Resources/i18n/en_US/Integration.json @@ -1,14 +1,14 @@ { - "fields": { - "enabled": "Enabled", - "clientId": "Client ID", - "clientSecret": "Client Secret", - "redirectUri": "Redirect URI" - }, - "messages": { - "selectIntegration": "Select an integration in menu." - }, - "help": { - "Google": "

Obtain OAuth 2.0 credentials from the Google Developers Console.

Visit Google Developers Console to obtain OAuth 2.0 credentials such as a Client ID and Client Secret that are known to both Google and EspoCRM application.

" - } + "fields": { + "enabled": "Enabled", + "clientId": "Client ID", + "clientSecret": "Client Secret", + "redirectUri": "Redirect URI" + }, + "messages": { + "selectIntegration": "Select an integration in menu." + }, + "help": { + "Google": "

Obtain OAuth 2.0 credentials from the Google Developers Console.

Visit Google Developers Console to obtain OAuth 2.0 credentials such as a Client ID and Client Secret that are known to both Google and EspoCRM application.

" + } } diff --git a/application/Espo/Resources/i18n/en_US/Note.json b/application/Espo/Resources/i18n/en_US/Note.json index e3819a324f..cdf96c0e43 100644 --- a/application/Espo/Resources/i18n/en_US/Note.json +++ b/application/Espo/Resources/i18n/en_US/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Post", - "attachments": "Attachments" - } + "fields": { + "post": "Post", + "attachments": "Attachments" + } } diff --git a/application/Espo/Resources/i18n/en_US/Preferences.json b/application/Espo/Resources/i18n/en_US/Preferences.json index 93fdd7cd55..3be28e87ec 100644 --- a/application/Espo/Resources/i18n/en_US/Preferences.json +++ b/application/Espo/Resources/i18n/en_US/Preferences.json @@ -1,37 +1,37 @@ { - "fields": { - "dateFormat": "Date Format", - "timeFormat": "Time Format", - "timeZone": "Time Zone", - "weekStart": "First Day of Week", - "thousandSeparator": "Thousand Separator", - "decimalMark": "Decimal Mark", - "defaultCurrency": "Default Currency", - "currencyList": "Currency List", - "language": "Language", - - "smtpServer": "Server", - "smtpPort": "Port", - "smtpAuth": "Auth", - "smtpSecurity": "Security", - "smtpUsername": "Username", - "emailAddress": "Email", - "smtpPassword": "Password", - "smtpEmailAddress": "Email Address", - - "exportDelimiter": "Export Delimiter", - - "receiveAssignmentEmailNotifications": "Receive Email Notifications upon Assignment" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Sunday", - "1": "Monday" - } - }, - "labels": { - "Notifications": "Notifications" - } + "fields": { + "dateFormat": "Date Format", + "timeFormat": "Time Format", + "timeZone": "Time Zone", + "weekStart": "First Day of Week", + "thousandSeparator": "Thousand Separator", + "decimalMark": "Decimal Mark", + "defaultCurrency": "Default Currency", + "currencyList": "Currency List", + "language": "Language", + + "smtpServer": "Server", + "smtpPort": "Port", + "smtpAuth": "Auth", + "smtpSecurity": "Security", + "smtpUsername": "Username", + "emailAddress": "Email", + "smtpPassword": "Password", + "smtpEmailAddress": "Email Address", + + "exportDelimiter": "Export Delimiter", + + "receiveAssignmentEmailNotifications": "Receive Email Notifications upon Assignment" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Sunday", + "1": "Monday" + } + }, + "labels": { + "Notifications": "Notifications" + } } diff --git a/application/Espo/Resources/i18n/en_US/Role.json b/application/Espo/Resources/i18n/en_US/Role.json index fce516a200..4ae0f2c97d 100644 --- a/application/Espo/Resources/i18n/en_US/Role.json +++ b/application/Espo/Resources/i18n/en_US/Role.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Name", - "roles": "Roles" - }, - "links": { - "users": "Users", - "teams": "Teams" - }, - "labels": { - "Access": "Access", - "Create Role": "Create Role" - }, - "options": { - "accessList": { - "not-set": "not-set", - "enabled": "enabled", - "disabled": "disabled" - }, - "levelList": { - "all": "all", - "team": "team", - "own": "own", - "no": "no" - } - }, - "actions": { - "read": "Read", - "edit": "Edit", - "delete": "Delete" - }, - "messages": { - "changesAfterClearCache": "All changes in an access control will be applied after cache will be cleared." - } + "fields": { + "name": "Name", + "roles": "Roles" + }, + "links": { + "users": "Users", + "teams": "Teams" + }, + "labels": { + "Access": "Access", + "Create Role": "Create Role" + }, + "options": { + "accessList": { + "not-set": "not-set", + "enabled": "enabled", + "disabled": "disabled" + }, + "levelList": { + "all": "all", + "team": "team", + "own": "own", + "no": "no" + } + }, + "actions": { + "read": "Read", + "edit": "Edit", + "delete": "Delete" + }, + "messages": { + "changesAfterClearCache": "All changes in an access control will be applied after cache will be cleared." + } } diff --git a/application/Espo/Resources/i18n/en_US/ScheduledJob.json b/application/Espo/Resources/i18n/en_US/ScheduledJob.json index e204a2981d..60ad08fa87 100644 --- a/application/Espo/Resources/i18n/en_US/ScheduledJob.json +++ b/application/Espo/Resources/i18n/en_US/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Name", - "status": "Status", - "job": "Job", - "scheduling": "Scheduling (crontab notation)" - }, - "links": { - "log": "Log" - }, - "labels": { - "Create ScheduledJob": "Create Scheduled Job" - }, - "options": { - "job": { - "CheckInboundEmails": "Check Inbound Emails", - "Cleanup": "Clean-up" - }, - "cronSetup": { - "linux": "Note: Add this line to the crontab file to run Espo Scheduled Jobs:", - "mac": "Note: Add this line to the crontab file to run Espo Scheduled Jobs:", - "windows": "Note: Create a batch file with the following commands to run Espo Scheduled Jobs using Windows Scheduled Tasks:", - "default": "Note: Add this command to Cron Job (Scheduled Task):" - }, - "status": { - "Active": "Active", - "Inactive": "Inactive" - } - } + "fields": { + "name": "Name", + "status": "Status", + "job": "Job", + "scheduling": "Scheduling (crontab notation)" + }, + "links": { + "log": "Log" + }, + "labels": { + "Create ScheduledJob": "Create Scheduled Job" + }, + "options": { + "job": { + "CheckInboundEmails": "Check Inbound Emails", + "Cleanup": "Clean-up" + }, + "cronSetup": { + "linux": "Note: Add this line to the crontab file to run Espo Scheduled Jobs:", + "mac": "Note: Add this line to the crontab file to run Espo Scheduled Jobs:", + "windows": "Note: Create a batch file with the following commands to run Espo Scheduled Jobs using Windows Scheduled Tasks:", + "default": "Note: Add this command to Cron Job (Scheduled Task):" + }, + "status": { + "Active": "Active", + "Inactive": "Inactive" + } + } } diff --git a/application/Espo/Resources/i18n/en_US/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/en_US/ScheduledJobLogRecord.json index 46cf66bee6..381f648f53 100644 --- a/application/Espo/Resources/i18n/en_US/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/en_US/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Status", - "executionTime": "Execution Time" - } + "fields": { + "status": "Status", + "executionTime": "Execution Time" + } } diff --git a/application/Espo/Resources/i18n/en_US/Settings.json b/application/Espo/Resources/i18n/en_US/Settings.json index cc325ac200..189decc1b9 100644 --- a/application/Espo/Resources/i18n/en_US/Settings.json +++ b/application/Espo/Resources/i18n/en_US/Settings.json @@ -1,76 +1,76 @@ { - "fields": { - "useCache": "Use Cache", - "dateFormat": "Date Format", - "timeFormat": "Time Format", - "timeZone": "Time Zone", - "weekStart": "First Day of Week", - "thousandSeparator": "Thousand Separator", - "decimalMark": "Decimal Mark", - "defaultCurrency": "Default Currency", - "baseCurrency": "Base Currency", - "baseCurrency": "Base Currency", - "currencyRates": "Rate Values", - - "currencyList": "Currency List", - "language": "Language", - - "companyLogo": "Company Logo", - - "smtpServer": "Server", - "smtpPort": "Port", - "smtpAuth": "Auth", - "smtpSecurity": "Security", - "smtpUsername": "Username", - "emailAddress": "Email", - "smtpPassword": "Password", - "outboundEmailFromName": "From Name", - "outboundEmailFromAddress": "From Address", - "outboundEmailIsShared": "Is Shared", - - "recordsPerPage": "Records Per Page", - "recordsPerPageSmall": "Records Per Page (Small)", - "tabList": "Tab List", - "quickCreateList": "Quick Create List", - - "exportDelimiter": "Export Delimiter", - - "authenticationMethod": "Authentication Method", - "ldapHost": "Host", - "ldapPort": "Port", - "ldapAuth": "Auth", - "ldapUsername": "Username", - "ldapPassword": "Password", - "ldapBindRequiresDn": "Bind Requires Dn", - "ldapBaseDn": "Base Dn", - "ldapAccountCanonicalForm": "Account Canonical Form", - "ldapAccountDomainName": "Account Domain Name", - "ldapTryUsernameSplit": "Try Username Split", - "ldapCreateEspoUser": "Create User in EspoCRM", - "ldapSecurity": "Security", - "ldapUserLoginFilter": "User Login Filter", - "ldapAccountDomainNameShort": "Account Domain Name Short", - "ldapOptReferrals": "Opt Referrals", - "disableExport": "Disable Export (only admin is allowed)", - "assignmentEmailNotifications": "Send Email Notifications upon Assignment", - "assignmentEmailNotificationsEntityList": "Entities to Notify About" - }, - "options": { - "weekStart": { - "0": "Sunday", - "1": "Monday" - } - }, - "tooltips": { - "recordsPerPageSmall": "Count of records in relatinship panels." - }, - "labels": { - "System": "System", - "Locale": "Locale", - "SMTP": "SMTP", - "Configuration": "Configuration", - "Notifications": "Notifications", - "Currency Settings": "Currency Settings", - "Currency Rtes": "Currency Rates" - } + "fields": { + "useCache": "Use Cache", + "dateFormat": "Date Format", + "timeFormat": "Time Format", + "timeZone": "Time Zone", + "weekStart": "First Day of Week", + "thousandSeparator": "Thousand Separator", + "decimalMark": "Decimal Mark", + "defaultCurrency": "Default Currency", + "baseCurrency": "Base Currency", + "baseCurrency": "Base Currency", + "currencyRates": "Rate Values", + + "currencyList": "Currency List", + "language": "Language", + + "companyLogo": "Company Logo", + + "smtpServer": "Server", + "smtpPort": "Port", + "smtpAuth": "Auth", + "smtpSecurity": "Security", + "smtpUsername": "Username", + "emailAddress": "Email", + "smtpPassword": "Password", + "outboundEmailFromName": "From Name", + "outboundEmailFromAddress": "From Address", + "outboundEmailIsShared": "Is Shared", + + "recordsPerPage": "Records Per Page", + "recordsPerPageSmall": "Records Per Page (Small)", + "tabList": "Tab List", + "quickCreateList": "Quick Create List", + + "exportDelimiter": "Export Delimiter", + + "authenticationMethod": "Authentication Method", + "ldapHost": "Host", + "ldapPort": "Port", + "ldapAuth": "Auth", + "ldapUsername": "Username", + "ldapPassword": "Password", + "ldapBindRequiresDn": "Bind Requires Dn", + "ldapBaseDn": "Base Dn", + "ldapAccountCanonicalForm": "Account Canonical Form", + "ldapAccountDomainName": "Account Domain Name", + "ldapTryUsernameSplit": "Try Username Split", + "ldapCreateEspoUser": "Create User in EspoCRM", + "ldapSecurity": "Security", + "ldapUserLoginFilter": "User Login Filter", + "ldapAccountDomainNameShort": "Account Domain Name Short", + "ldapOptReferrals": "Opt Referrals", + "disableExport": "Disable Export (only admin is allowed)", + "assignmentEmailNotifications": "Send Email Notifications upon Assignment", + "assignmentEmailNotificationsEntityList": "Entities to Notify About" + }, + "options": { + "weekStart": { + "0": "Sunday", + "1": "Monday" + } + }, + "tooltips": { + "recordsPerPageSmall": "Count of records in relatinship panels." + }, + "labels": { + "System": "System", + "Locale": "Locale", + "SMTP": "SMTP", + "Configuration": "Configuration", + "Notifications": "Notifications", + "Currency Settings": "Currency Settings", + "Currency Rtes": "Currency Rates" + } } diff --git a/application/Espo/Resources/i18n/en_US/Team.json b/application/Espo/Resources/i18n/en_US/Team.json index ded74f5a25..b8b71e1645 100644 --- a/application/Espo/Resources/i18n/en_US/Team.json +++ b/application/Espo/Resources/i18n/en_US/Team.json @@ -1,15 +1,15 @@ { - "fields": { - "name": "Name", - "roles": "Roles" - }, - "links": { - "users": "Users" - }, - "tooltips": { - "roles": "All users from this team will get access settings from selected roles." - }, - "labels": { - "Create Team": "Create Team" - } + "fields": { + "name": "Name", + "roles": "Roles" + }, + "links": { + "users": "Users" + }, + "tooltips": { + "roles": "All users from this team will get access settings from selected roles." + }, + "labels": { + "Create Team": "Create Team" + } } diff --git a/application/Espo/Resources/i18n/en_US/User.json b/application/Espo/Resources/i18n/en_US/User.json index 0f47fb9def..82e7a3bf2f 100644 --- a/application/Espo/Resources/i18n/en_US/User.json +++ b/application/Espo/Resources/i18n/en_US/User.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Name", - "userName": "User Name", - "title": "Title", - "isAdmin": "Is Admin", - "defaultTeam": "Default Team", - "emailAddress": "Email", - "phoneNumber": "Phone", - "roles": "Roles", - "password": "Password", - "passwordConfirm": "Confirm Password", - "newPassword": "New Password" - }, - "links": { - "teams": "Teams", - "roles": "Roles" - }, - "labels": { - "Create User": "Create User", - "Generate": "Generate", - "Access": "Access", - "Preferences": "Preferences", - "Change Password": "Change Password" - }, - "tooltips": { - "defaultTeam": "All records created by this user will be related to this team by default.", - "userName": "Letters a-z, numbers 0-9 and underscores are allowed." - }, - "messages": { - "passwordWillBeSent": "Password will be sent to user's email address.", - "accountInfoEmailSubject": "Account info", - "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", - "passwordChanged": "Password has been changed" - } + "fields": { + "name": "Name", + "userName": "User Name", + "title": "Title", + "isAdmin": "Is Admin", + "defaultTeam": "Default Team", + "emailAddress": "Email", + "phoneNumber": "Phone", + "roles": "Roles", + "password": "Password", + "passwordConfirm": "Confirm Password", + "newPassword": "New Password" + }, + "links": { + "teams": "Teams", + "roles": "Roles" + }, + "labels": { + "Create User": "Create User", + "Generate": "Generate", + "Access": "Access", + "Preferences": "Preferences", + "Change Password": "Change Password" + }, + "tooltips": { + "defaultTeam": "All records created by this user will be related to this team by default.", + "userName": "Letters a-z, numbers 0-9 and underscores are allowed." + }, + "messages": { + "passwordWillBeSent": "Password will be sent to user's email address.", + "accountInfoEmailSubject": "Account info", + "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", + "passwordChanged": "Password has been changed" + } } diff --git a/application/Espo/Resources/i18n/es_ES/Admin.json b/application/Espo/Resources/i18n/es_ES/Admin.json index 8cecd418bb..8ebc03964c 100644 --- a/application/Espo/Resources/i18n/es_ES/Admin.json +++ b/application/Espo/Resources/i18n/es_ES/Admin.json @@ -1,122 +1,122 @@ { - "labels": { - "Enabled": "Activado", - "Disabled": "Desactivado", - "System": "Sistema", - "Users": "Usuarios", - "Email": "Correo electrónico", - "Data": "Datos", - "Customization": "Personalizar", - "Available Fields": "Campos Disponibles", - "Layout": "Diseño", - "Enabled": "Activado", - "Disabled": "Desactivado", - "Add Panel": "Añadir Panel", - "Add Field": "Añadir Campo", - "Settings": "Opciones", - "Scheduled Jobs": "Tareas Programadas", - "Upgrade": "Actualizar", - "Clear Cache": "Limpiar Cache", - "Rebuild": "Reconstruir", - "Users": "Usuarios", - "Teams": "Equipos", - "Roles": "Roles", - "Outbound Emails": "Correos Salientes", - "Inbound Emails": "Correos Entrantes", - "Email Templates": "Platillas de Correo", - "Import": "Importar", - "Layout Manager": "Administrador de Diseño", - "Field Manager": "Administrador de Campos", - "User Interface": "Interfaz de Usuario" - }, - "layouts": { - "list": "Lista", - "detail": "Detalle", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Filtros de Búsqueda", - "massUpdate": "Actualización Masiva", - "relationships": "Relaciones" - }, - "fieldTypes": { - "address": "Dirección", - "array": "Array", - "foreign": "Foreign", - "duration": "Duración", - "password": "Contraseña", - "parsonName": "Nombre", - "autoincrement": "Auto incrementar", - "bool": "Booleano", - "currency": "Moneda", - "date": "Fecha", - "datetime": "Fecha/Hora", - "email": "Correo electrónico", - "enum": "Enum", - "enumInt": "Enum Integer", - "enumFloat": "Enum Float", - "float": "Float", - "int": "Int", - "link": "Enlace", - "linkMultiple": "Enlace Múltiple", - "linkParent": "Enlace Padre", - "multienim": "Multienum", - "phone": "Teléfono", - "text": "Texto", - "url": "Url", - "varchar": "Varchar", - "file": "Archivo", - "image": "Imagen" - }, - "fields": { - "type": "Tipo", - "name": "Nombre", - "label": "Etiqueta", - "required": "Requerido", - "default": "Por Defecto", - "maxLength": "Longitud máxima", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Enlace", - "field": "Campo", - "min": "Mínimo", - "max": "Máximo", - "translation": "Traducción", - "previewSize": "Tamaño de vista previa" - }, - "messages": { - "upgradeVersion": "Su EspoCRM será actualizado a la versión {version}. Tomará algún tiempo.", - "upgradeDone": "Su EspoCRM ha sido actualizado a la versión {version}. Refresque su ventana del navegador.", - "upgradeBackup": "Le recomendamos que haga copias de seguridad de sus archivos y datos EspoCRM antes de la actualización.", - "thousandSeparatorEqualsDecimalMark": "El separador de miles no puede ser la misma que marca decimal", - "userHasNoEmailAddress": "El usuario no tiene la dirección de correo electrónico.", - "selectEntityType": "Seleccione el tipo de entidad en el menú de la izquierda.", - "selectUpgradePackage": "Seleccione Actualizar Paquete", - "selectLayout": "Seleccione el diseño necesario en el menú de la izquierda y editarlo." - }, - "descriptions": { - "settings": "Configuración del sistema de aplicación.", - "scheduledJob": "Trabajos que se ejecutan por cron.(cron Jobs)", - "upgrade": "Actualiza EspoCRM.", - "clearCache": "Limpiar cache de Administración.", - "rebuild": "Reconstruir y limpiar el cache de Administración.", - "users": "Gestión de usuarios.", - "teams": "Gestión de Equipos", - "roles": "Gestión de Roles", - "outboundEmails": "Opciones SMTP para correo saliente.", - "inboundEmails": "Cuentas de correo IMAP Grupo. Importación-correo y dirección de correo electrónico a la sentencia.", - "emailTemplates": "Plantillas para mensajes de correo electrónico salientes.", - "import": "Importar datos desde CSV.", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Crear nuevos campos o personalizar los ya existentes.", - "userInterface": "Configurar UI." - }, - "options": { - "previewSize": { - "x-small": "X-Small", - "small": "Pequeño", - "medium": "Mediano", - "large": "Grande" - } - } + "labels": { + "Enabled": "Activado", + "Disabled": "Desactivado", + "System": "Sistema", + "Users": "Usuarios", + "Email": "Correo electrónico", + "Data": "Datos", + "Customization": "Personalizar", + "Available Fields": "Campos Disponibles", + "Layout": "Diseño", + "Enabled": "Activado", + "Disabled": "Desactivado", + "Add Panel": "Añadir Panel", + "Add Field": "Añadir Campo", + "Settings": "Opciones", + "Scheduled Jobs": "Tareas Programadas", + "Upgrade": "Actualizar", + "Clear Cache": "Limpiar Cache", + "Rebuild": "Reconstruir", + "Users": "Usuarios", + "Teams": "Equipos", + "Roles": "Roles", + "Outbound Emails": "Correos Salientes", + "Inbound Emails": "Correos Entrantes", + "Email Templates": "Platillas de Correo", + "Import": "Importar", + "Layout Manager": "Administrador de Diseño", + "Field Manager": "Administrador de Campos", + "User Interface": "Interfaz de Usuario" + }, + "layouts": { + "list": "Lista", + "detail": "Detalle", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Filtros de Búsqueda", + "massUpdate": "Actualización Masiva", + "relationships": "Relaciones" + }, + "fieldTypes": { + "address": "Dirección", + "array": "Array", + "foreign": "Foreign", + "duration": "Duración", + "password": "Contraseña", + "parsonName": "Nombre", + "autoincrement": "Auto incrementar", + "bool": "Booleano", + "currency": "Moneda", + "date": "Fecha", + "datetime": "Fecha/Hora", + "email": "Correo electrónico", + "enum": "Enum", + "enumInt": "Enum Integer", + "enumFloat": "Enum Float", + "float": "Float", + "int": "Int", + "link": "Enlace", + "linkMultiple": "Enlace Múltiple", + "linkParent": "Enlace Padre", + "multienim": "Multienum", + "phone": "Teléfono", + "text": "Texto", + "url": "Url", + "varchar": "Varchar", + "file": "Archivo", + "image": "Imagen" + }, + "fields": { + "type": "Tipo", + "name": "Nombre", + "label": "Etiqueta", + "required": "Requerido", + "default": "Por Defecto", + "maxLength": "Longitud máxima", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Enlace", + "field": "Campo", + "min": "Mínimo", + "max": "Máximo", + "translation": "Traducción", + "previewSize": "Tamaño de vista previa" + }, + "messages": { + "upgradeVersion": "Su EspoCRM será actualizado a la versión {version}. Tomará algún tiempo.", + "upgradeDone": "Su EspoCRM ha sido actualizado a la versión {version}. Refresque su ventana del navegador.", + "upgradeBackup": "Le recomendamos que haga copias de seguridad de sus archivos y datos EspoCRM antes de la actualización.", + "thousandSeparatorEqualsDecimalMark": "El separador de miles no puede ser la misma que marca decimal", + "userHasNoEmailAddress": "El usuario no tiene la dirección de correo electrónico.", + "selectEntityType": "Seleccione el tipo de entidad en el menú de la izquierda.", + "selectUpgradePackage": "Seleccione Actualizar Paquete", + "selectLayout": "Seleccione el diseño necesario en el menú de la izquierda y editarlo." + }, + "descriptions": { + "settings": "Configuración del sistema de aplicación.", + "scheduledJob": "Trabajos que se ejecutan por cron.(cron Jobs)", + "upgrade": "Actualiza EspoCRM.", + "clearCache": "Limpiar cache de Administración.", + "rebuild": "Reconstruir y limpiar el cache de Administración.", + "users": "Gestión de usuarios.", + "teams": "Gestión de Equipos", + "roles": "Gestión de Roles", + "outboundEmails": "Opciones SMTP para correo saliente.", + "inboundEmails": "Cuentas de correo IMAP Grupo. Importación-correo y dirección de correo electrónico a la sentencia.", + "emailTemplates": "Plantillas para mensajes de correo electrónico salientes.", + "import": "Importar datos desde CSV.", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Crear nuevos campos o personalizar los ya existentes.", + "userInterface": "Configurar UI." + }, + "options": { + "previewSize": { + "x-small": "X-Small", + "small": "Pequeño", + "medium": "Mediano", + "large": "Grande" + } + } } diff --git a/application/Espo/Resources/i18n/es_ES/Email.json b/application/Espo/Resources/i18n/es_ES/Email.json index 9c03c3f914..4c7659bdf7 100644 --- a/application/Espo/Resources/i18n/es_ES/Email.json +++ b/application/Espo/Resources/i18n/es_ES/Email.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Asunto", - "parent": "Padre", - "status": "Estado", - "dateSent": "Enviado", - "from": "De", - "to": "a", - "cc": "CC", - "bcc": "BCC", - "isHtml": "Es Html", - "body": "Cuerpo", - "subject": "Asunto", - "attachments": "Adjuntos", - "selectTemplate": "Seleccione una Plantilla", - "fromEmailAddress": "De la dirección", - "toEmailAddresses": "a la Dirección", - "emailAddress": "Correo Electrónico" - }, - "links": { - }, - "options": { - "Draft": "Borrador", - "Sending": "Enviando", - "Sent": "Enviado", - "Archived": "Archivado" - }, - "labels": { - "Create Email": "Archivar Correo", - "Compose": "Componer" - } + "fields": { + "name": "Asunto", + "parent": "Padre", + "status": "Estado", + "dateSent": "Enviado", + "from": "De", + "to": "a", + "cc": "CC", + "bcc": "BCC", + "isHtml": "Es Html", + "body": "Cuerpo", + "subject": "Asunto", + "attachments": "Adjuntos", + "selectTemplate": "Seleccione una Plantilla", + "fromEmailAddress": "De la dirección", + "toEmailAddresses": "a la Dirección", + "emailAddress": "Correo Electrónico" + }, + "links": { + }, + "options": { + "Draft": "Borrador", + "Sending": "Enviando", + "Sent": "Enviado", + "Archived": "Archivado" + }, + "labels": { + "Create Email": "Archivar Correo", + "Compose": "Componer" + } } diff --git a/application/Espo/Resources/i18n/es_ES/EmailAddress.json b/application/Espo/Resources/i18n/es_ES/EmailAddress.json index 5590c03242..24322ce27c 100644 --- a/application/Espo/Resources/i18n/es_ES/EmailAddress.json +++ b/application/Espo/Resources/i18n/es_ES/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Primario", - "Opted Out": "optado por no", - "Invalid": "Inválido" - } + "labels": { + "Primary": "Primario", + "Opted Out": "optado por no", + "Invalid": "Inválido" + } } diff --git a/application/Espo/Resources/i18n/es_ES/EmailTemplate.json b/application/Espo/Resources/i18n/es_ES/EmailTemplate.json index e6445b7745..a2ad4ba2b5 100644 --- a/application/Espo/Resources/i18n/es_ES/EmailTemplate.json +++ b/application/Espo/Resources/i18n/es_ES/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Nombre", - "status": "Estado", - "isHtml": "Es Html", - "body": "Cuerpo", - "subject": "Asunto", - "attachments": "Adjuntos", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Crear Plantilla de Correo" - } + "fields": { + "name": "Nombre", + "status": "Estado", + "isHtml": "Es Html", + "body": "Cuerpo", + "subject": "Asunto", + "attachments": "Adjuntos", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Crear Plantilla de Correo" + } } diff --git a/application/Espo/Resources/i18n/es_ES/Global.json b/application/Espo/Resources/i18n/es_ES/Global.json index cac2b2b4dd..9ecdb4306a 100644 --- a/application/Espo/Resources/i18n/es_ES/Global.json +++ b/application/Espo/Resources/i18n/es_ES/Global.json @@ -1,395 +1,395 @@ { - "scopeNames": { - "Email": "Correo electrónico", - "User": "Usuario", - "Team": "Equipo", - "Role": "Rol", - "EmailTemplate": "Plantilla de Correo", - "OutboundEmail": "Correo Saliente", - "ScheduledJob": "Tarea Programada" - }, - "scopeNamesPlural": { - "Email": "Correos", - "User": "Usuarios", - "Team": "Equipos", - "Role": "Roles", - "EmailTemplate": "Platillas de Correo", - "OutboundEmail": "Correos Salientes", - "ScheduledJob": "Tareas Programadas" - }, - "labels": { - "Misc": "Misc", - "Merge": "Fundir", - "None": "Ninguno", - "by": "por", - "Saved": "Guardado", - "Error": "Error", - "Select": "Seleccionar", - "Not valid": "Inválido", - "Please wait...": "Por favor espere...", - "Please wait": "Por favor espere", - "Loading...": "Cargando...", - "Uploading...": "Subiendo...", - "Sending...": "Enviando...", - "Posted": "Publicado", - "Linked": "Enlazado", - "Unlinked": "Desenlazado", - "Access denied": "Acceso denegado", - "Access": "Acceso", - "Are you sure?": "Are you sure?", - "Record has been removed": "Registro Eliminado", - "Wrong username/password": "Nombre de usuario/contraseña incorrectos", - "Post cannot be empty": "La entrada no puede estar vacia", - "Removing...": "Removiendo...", - "Unlinking...": "Desenlazando...", - "Posting...": "Publicando...", - "Username can not be empty!": "Nombre de usuario no puede estar vacío!", - "Cache is not enabled": "Cache no está habilitado", - "Cache has been cleared": "Cache Limpiado Correctamente", - "Rebuild has been done": "Se ha reconstruido", - "Saving...": "Guardando...", - "Modified": "Modificado", - "Created": "Creado", - "Create": "Crear", - "create": "crear", - "Overview": "Vista", - "Details": "Detalles", - "Add Filter": "Añadir Filtro", - "Add Dashlet": "Añadir Dashlet", - "Add": "Añadir", - "Reset": "Resetear", - "Menu": "Menú", - "More": "Más", - "Search": "Buscar", - "Only My": "Solo Yo", - "Open": "Abrir", - "Admin": "Administrador", - "About": "Acerca", - "Refresh": "Refrescar", - "Remove": "Remover", - "Options": "Optiones", - "Username": "Nombre de Usuario", - "Password": "Contraseña", - "Login": "Entrar", - "Log Out": "Salir", - "Preferences": "Preferencias", - "State": "Estado/Distrito", - "Street": "Calle", - "Country": "país", - "City": "Ciudad", - "PostalCode": "Código Postal", - "Followed": "Seguido", - "Follow": "Seguir", - "Clear Local Cache": "Borrar Cache Local", - "Actions": "Acciones", - "Delete": "Borrar", - "Update": "Actualizar", - "Save": "Guardar", - "Edit": "Editar", - "Cancel": "Cancelar", - "Unlink": "Desenlazar", - "Mass Update": "Actualización Masiva", - "Export": "Exportar", - "No Data": "Sin Datos", - "All": "Todos", - "Active": "Activo", - "Inactive": "Inactivo", - "Write your comment here": "Escriba su comentario aquí", - "Post": "Entrada", - "Stream": "Stream", - "Show more": "Mostrar mas", - "Dashlet Options": "Opciones Dashlet", - "Full Form": "Formulario Completo", - "Insert": "Insertar", - "Person": "Persona", - "First Name": "Primer Nombre", - "Last Name": "Apellidos", - "Original": "Original", - "You": "Tu", - "you": "tu", - "change": "cambiar" - }, - "messages": { - "notModified": "Usted no ha modificado el registro", - "duplicate": "El registro que está creando parece ser un duplicado", - "fieldIsRequired": "{field} es requerido", - "fieldShouldBeEmail": "{field} debe se un correo electrónico válido", - "fieldShouldBeFloat": "{field} debe se un decimal válido", - "fieldShouldBeInt": "{field} debe se un entero válido", - "fieldShouldBeDate": "{field} debe se una fecha válida", - "fieldShouldBeDatetime": "{field} debe se una fecha válida fecha/hora", - "fieldShouldAfter": "{field} debe estar después {otherField}", - "fieldShouldBefore": "{field} debe estar antes {otherField}", - "fieldShouldBeBetween": "{field} debe estar entre {min} and {max}", - "fieldShouldBeLess": "{field} debe ser menor que {value}", - "fieldShouldBeGreater": "{field} debe ser mayor que {value}", - "fieldBadPasswordConfirm": "{field} confirmado de forma incorrecta" - }, - "boolFilters": { - "onlyMy": "Solo Yo", - "open": "Abrir", - "active": "Activo" - }, - "fields": { - "name": "Nombre", - "firstName": "Primer Nombre", - "lastName": "Apellidos", - "salutationName": "Saludo", - "assignedUser": "Usuario Asignado", - "emailAddress": "Correo electrónico", - "assignedUserName": "Nombre de Usuario Asignado", - "teams": "Equipos", - "createdAt": "Creado el", - "modifiedAt": "Modificado el", - "createdBy": "Creado Por", - "modifiedBy": "Modificado Por", - "title": "Título", - "dateFrom": "Fecha de", - "dateTo": "Fecha Para", - "autorefreshInterval": "Intervalo de Auto-Refrescar", - "displayRecords": "Mostrar Registros" - }, - "links": { - "teams": "Equipos", - "users": "Usuarios" - }, - "dashlets": { - "Stream": "Stream" - }, - "streamMessages": { - "create": "{user} creado {entityType} {entity}", - "createAssigned": "{user} creado {entityType} {entity} asignado a {assignee}", - "assign": "{user} asignado {entityType} {entity} a {assignee}", - "post": "{user} publicado en {entityType} {entity}", - "attach": "{user} adjunto en {entityType} {entity}", - "status": "{user} actualizado {field} on {entityType} {entity}", - "update": "{user} actualizado {entityType} {entity}", - "createRelated": "{user} creado {relatedEntityType} {relatedEntity} enlazado a {entityType} {entity}", - "emailReceived": "{entity} ha sido recibido por {entityType} {entity}", - - "createThis": "{user} crear este {entityType}", - "createAssignedThis": "{user} crear este {entityType} asignado a {assignee}", - "assignThis": "{user} asignar este {entityType} a {assignee}", - "postThis": "{user} publicado", - "attachThis": "{user} adjunto", - "statusThis": "{user} actualizado {field}", - "updateThis": "{user} actualizado a este {entityType}", - "createRelatedThis": "{user} creado {relatedEntityType} {relatedEntity} enlazado a este {entityType}", - "emailReceivedThis": "{entity} se ha recibido" - }, - "lists": { - "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] - }, - "options": { - "salutationName": { - "Mr.": "Sr.", - "Mrs.": "Sra.", - "Dr.": "Dr.", - "Drs.": "Drs." - }, - "language": { - "af_ZA": "Afrikaans", - "az_AZ": "Azerbaijani", - "be_BY": "Belarusian", - "bg_BG": "Bulgarian", - "bn_IN": "Bengali", - "bs_BA": "Bosnian", - "ca_ES": "Catalan", - "cs_CZ": "Czech", - "cy_GB": "Welsh", - "da_DK": "Danish", - "de_DE": "German", - "el_GR": "Greek", - "en_GB":"English (UK)", - "en_US":"English (US)", - "es_ES":"Spanish (Spain)", - "et_EE": "Estonian", - "eu_ES": "Basque", - "fa_IR": "Persian", - "fi_FI": "Finnish", - "fo_FO": "Faroese", - "fr_CA":"French (Canada)", - "fr_FR":"French (France)", - "ga_IE": "Irish", - "gl_ES": "Galician", - "gn_PY": "Guarani", - "he_IL": "Hebrew", - "hi_IN": "Hindi", - "hr_HR": "Croatian", - "hu_HU": "Hungarian", - "hy_AM": "Armenian", - "id_ID": "Indonesian", - "is_IS": "Icelandic", - "it_IT": "Italian", - "ja_JP": "Japanese", - "ka_GE": "Georgian", - "km_KH": "Khmer", - "ko_KR": "Korean", - "ku_TR": "Kurdish", - "lt_LT": "Lithuanian", - "lv_LV": "Latvian", - "mk_MK": "Macedonian", - "ml_IN": "Malayalam", - "ms_MY": "Malay", - "nb_NO":"Norwegian Bokmål", - "nn_NO": "Norwegian Nynorsk", - "ne_NP": "Nepali", - "nl_NL": "Dutch", - "pa_IN": "Punjabi", - "pl_PL": "Polish", - "ps_AF": "Pashto", - "pt_BR":"Portuguese (Brazil)", - "pt_PT":"Portuguese (Portugal)", - "ro_RO": "Romanian", - "ru_RU": "Russian", - "sk_SK": "Slovak", - "sl_SI": "Slovene", - "sq_AL": "Albanian", - "sr_RS": "Serbian", - "sv_SE": "Swedish", - "sw_KE": "Swahili", - "ta_IN": "Tamil", - "te_IN": "Telugu", - "th_TH": "Thai", - "tl_PH": "Tagalog", - "tr_TR": "Turkish", - "uk_UA": "Ukrainian", - "ur_PK": "Urdu", - "vi_VN": "Vietnamese", - "zh_CN":"Simplified Chinese (China)", - "zh_HK":"Traditional Chinese (Hong Kong)", - "zh_TW":"Traditional Chinese (Taiwan)" - }, - "dateSearchRanges": { - "on": "Está en", - "notOn": "No está en", - "after": "Después", - "before": "Antes", - "between": "Entre" - }, - "intSearchRanges": { - "equals": "Iguales", - "notEquals": "Diferentes", - "greaterThan": "Mayor que", - "lessThan": "Menor que", - "greaterThanOrEquals": "Mayor o igual que", - "lessThanOrEquals": "Menor o igual que", - "between": "Entre" - }, - "autorefreshInterval": { - "0": "Ninguno", - "0.5": "30 segundos", - "1": "1 minuto", - "2": "2 minutos", - "5": "5 minutos", - "10": "10 minutos" - } - }, - "sets": { - "summernote": { - "NOTICE": "Usted puede encontrar aquí la traducción: https://github.com/HackerWins/summernote/tree/master/lang", - "font":{ - "bold": "Negrita", - "italic": "Itálico", - "underline": "Subrayado", - "strike": "Tachado", - "clear": "Quitar Estilo de Fuente", - "height": "Alto de línea", - "name": "Familia de Fuente", - "size": "Tamaño de Fuente" - }, - "image":{ - "image": "Imagen", - "insert": "Insertar Imagen", - "resizeFull": "Cambiar el tamaño a completo", - "resizeHalf": "Cambiar el tamaño a la mitad", - "resizeQuarter": "Cambiar el tamaño a un cuarto", - "floatLeft": "Flotar Izquierda", - "floatRight": "Flotar Derecha", - "floatNone": "Sin Flotar", - "dragImageHere": "Arrastrar una imagen aquí", - "selectFromFiles": "Seleccionar desde Archivo", - "url": "Url de Imagen", - "remove": "Remover Imagen" - }, - "link":{ - "link": "Enlace", - "insert": "Insertar Enlace", - "unlink": "Desenlazar", - "edit": "Editar", - "textToDisplay": "TExto a mostrar", - "url":"To what URL should this link go?", - "openInNewWindow": "Abrir en nueva ventana" - }, - "video":{ - "video": "Vídeo", - "videoLink": "Enlace al Vídeo", - "insert": "Insertar Vídeo", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" - }, - "table":{ - "table": "Tabla" - }, - "hr":{ - "insert": "Insertar regla horizontal" - }, - "style":{ - "style": "Estilo", - "normal": "Normal", - "blockquote": "Cita", - "pre": "Código", - "h1": "Header 1", - "h2": "Header 2", - "h3": "Header 3", - "h4": "Header 4", - "h5": "Header 5", - "h6": "Header 6" - }, - "lists":{ - "unordered": "Lista sin Ordenar", - "ordered": "Lista Ordenada" - }, - "options":{ - "help": "Ayuda", - "fullscreen": "Pantalla Completa", - "codeview": "Ver Código" - }, - "paragraph":{ - "paragraph": "Párrafo", - "outdent": "Anular sangría", - "indent": "Sangría", - "left": "Alinear Izquierda", - "center": "Alinear Centro", - "right": "Alinear Derecha", - "justify": "Justificado" - }, - "color":{ - "recent": "Color Reciente", - "more": "Mas Colores", - "background": "Color de Fondo", - "foreground": "Color de Fuente", - "transparent": "Transparente", - "setTransparent": "Establecer transparente", - "reset": "Resetear", - "resetToDefault": "Restablecer a (por defecto)" - }, - "shortcut":{ - "shortcuts": "Atajos de teclado", - "close": "Cerrar", - "textFormatting": "Formato de texto", - "action": "Acción", - "paragraphFormatting": "Formato de párrafo", - "documentStyle": "Estilo de Documento" - }, - "history":{ - "undo": "Deshacer", - "redo": "Rehacer" - } - } - } + "scopeNames": { + "Email": "Correo electrónico", + "User": "Usuario", + "Team": "Equipo", + "Role": "Rol", + "EmailTemplate": "Plantilla de Correo", + "OutboundEmail": "Correo Saliente", + "ScheduledJob": "Tarea Programada" + }, + "scopeNamesPlural": { + "Email": "Correos", + "User": "Usuarios", + "Team": "Equipos", + "Role": "Roles", + "EmailTemplate": "Platillas de Correo", + "OutboundEmail": "Correos Salientes", + "ScheduledJob": "Tareas Programadas" + }, + "labels": { + "Misc": "Misc", + "Merge": "Fundir", + "None": "Ninguno", + "by": "por", + "Saved": "Guardado", + "Error": "Error", + "Select": "Seleccionar", + "Not valid": "Inválido", + "Please wait...": "Por favor espere...", + "Please wait": "Por favor espere", + "Loading...": "Cargando...", + "Uploading...": "Subiendo...", + "Sending...": "Enviando...", + "Posted": "Publicado", + "Linked": "Enlazado", + "Unlinked": "Desenlazado", + "Access denied": "Acceso denegado", + "Access": "Acceso", + "Are you sure?": "Are you sure?", + "Record has been removed": "Registro Eliminado", + "Wrong username/password": "Nombre de usuario/contraseña incorrectos", + "Post cannot be empty": "La entrada no puede estar vacia", + "Removing...": "Removiendo...", + "Unlinking...": "Desenlazando...", + "Posting...": "Publicando...", + "Username can not be empty!": "Nombre de usuario no puede estar vacío!", + "Cache is not enabled": "Cache no está habilitado", + "Cache has been cleared": "Cache Limpiado Correctamente", + "Rebuild has been done": "Se ha reconstruido", + "Saving...": "Guardando...", + "Modified": "Modificado", + "Created": "Creado", + "Create": "Crear", + "create": "crear", + "Overview": "Vista", + "Details": "Detalles", + "Add Filter": "Añadir Filtro", + "Add Dashlet": "Añadir Dashlet", + "Add": "Añadir", + "Reset": "Resetear", + "Menu": "Menú", + "More": "Más", + "Search": "Buscar", + "Only My": "Solo Yo", + "Open": "Abrir", + "Admin": "Administrador", + "About": "Acerca", + "Refresh": "Refrescar", + "Remove": "Remover", + "Options": "Optiones", + "Username": "Nombre de Usuario", + "Password": "Contraseña", + "Login": "Entrar", + "Log Out": "Salir", + "Preferences": "Preferencias", + "State": "Estado/Distrito", + "Street": "Calle", + "Country": "país", + "City": "Ciudad", + "PostalCode": "Código Postal", + "Followed": "Seguido", + "Follow": "Seguir", + "Clear Local Cache": "Borrar Cache Local", + "Actions": "Acciones", + "Delete": "Borrar", + "Update": "Actualizar", + "Save": "Guardar", + "Edit": "Editar", + "Cancel": "Cancelar", + "Unlink": "Desenlazar", + "Mass Update": "Actualización Masiva", + "Export": "Exportar", + "No Data": "Sin Datos", + "All": "Todos", + "Active": "Activo", + "Inactive": "Inactivo", + "Write your comment here": "Escriba su comentario aquí", + "Post": "Entrada", + "Stream": "Stream", + "Show more": "Mostrar mas", + "Dashlet Options": "Opciones Dashlet", + "Full Form": "Formulario Completo", + "Insert": "Insertar", + "Person": "Persona", + "First Name": "Primer Nombre", + "Last Name": "Apellidos", + "Original": "Original", + "You": "Tu", + "you": "tu", + "change": "cambiar" + }, + "messages": { + "notModified": "Usted no ha modificado el registro", + "duplicate": "El registro que está creando parece ser un duplicado", + "fieldIsRequired": "{field} es requerido", + "fieldShouldBeEmail": "{field} debe se un correo electrónico válido", + "fieldShouldBeFloat": "{field} debe se un decimal válido", + "fieldShouldBeInt": "{field} debe se un entero válido", + "fieldShouldBeDate": "{field} debe se una fecha válida", + "fieldShouldBeDatetime": "{field} debe se una fecha válida fecha/hora", + "fieldShouldAfter": "{field} debe estar después {otherField}", + "fieldShouldBefore": "{field} debe estar antes {otherField}", + "fieldShouldBeBetween": "{field} debe estar entre {min} and {max}", + "fieldShouldBeLess": "{field} debe ser menor que {value}", + "fieldShouldBeGreater": "{field} debe ser mayor que {value}", + "fieldBadPasswordConfirm": "{field} confirmado de forma incorrecta" + }, + "boolFilters": { + "onlyMy": "Solo Yo", + "open": "Abrir", + "active": "Activo" + }, + "fields": { + "name": "Nombre", + "firstName": "Primer Nombre", + "lastName": "Apellidos", + "salutationName": "Saludo", + "assignedUser": "Usuario Asignado", + "emailAddress": "Correo electrónico", + "assignedUserName": "Nombre de Usuario Asignado", + "teams": "Equipos", + "createdAt": "Creado el", + "modifiedAt": "Modificado el", + "createdBy": "Creado Por", + "modifiedBy": "Modificado Por", + "title": "Título", + "dateFrom": "Fecha de", + "dateTo": "Fecha Para", + "autorefreshInterval": "Intervalo de Auto-Refrescar", + "displayRecords": "Mostrar Registros" + }, + "links": { + "teams": "Equipos", + "users": "Usuarios" + }, + "dashlets": { + "Stream": "Stream" + }, + "streamMessages": { + "create": "{user} creado {entityType} {entity}", + "createAssigned": "{user} creado {entityType} {entity} asignado a {assignee}", + "assign": "{user} asignado {entityType} {entity} a {assignee}", + "post": "{user} publicado en {entityType} {entity}", + "attach": "{user} adjunto en {entityType} {entity}", + "status": "{user} actualizado {field} on {entityType} {entity}", + "update": "{user} actualizado {entityType} {entity}", + "createRelated": "{user} creado {relatedEntityType} {relatedEntity} enlazado a {entityType} {entity}", + "emailReceived": "{entity} ha sido recibido por {entityType} {entity}", + + "createThis": "{user} crear este {entityType}", + "createAssignedThis": "{user} crear este {entityType} asignado a {assignee}", + "assignThis": "{user} asignar este {entityType} a {assignee}", + "postThis": "{user} publicado", + "attachThis": "{user} adjunto", + "statusThis": "{user} actualizado {field}", + "updateThis": "{user} actualizado a este {entityType}", + "createRelatedThis": "{user} creado {relatedEntityType} {relatedEntity} enlazado a este {entityType}", + "emailReceivedThis": "{entity} se ha recibido" + }, + "lists": { + "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] + }, + "options": { + "salutationName": { + "Mr.": "Sr.", + "Mrs.": "Sra.", + "Dr.": "Dr.", + "Drs.": "Drs." + }, + "language": { + "af_ZA": "Afrikaans", + "az_AZ": "Azerbaijani", + "be_BY": "Belarusian", + "bg_BG": "Bulgarian", + "bn_IN": "Bengali", + "bs_BA": "Bosnian", + "ca_ES": "Catalan", + "cs_CZ": "Czech", + "cy_GB": "Welsh", + "da_DK": "Danish", + "de_DE": "German", + "el_GR": "Greek", + "en_GB":"English (UK)", + "en_US":"English (US)", + "es_ES":"Spanish (Spain)", + "et_EE": "Estonian", + "eu_ES": "Basque", + "fa_IR": "Persian", + "fi_FI": "Finnish", + "fo_FO": "Faroese", + "fr_CA":"French (Canada)", + "fr_FR":"French (France)", + "ga_IE": "Irish", + "gl_ES": "Galician", + "gn_PY": "Guarani", + "he_IL": "Hebrew", + "hi_IN": "Hindi", + "hr_HR": "Croatian", + "hu_HU": "Hungarian", + "hy_AM": "Armenian", + "id_ID": "Indonesian", + "is_IS": "Icelandic", + "it_IT": "Italian", + "ja_JP": "Japanese", + "ka_GE": "Georgian", + "km_KH": "Khmer", + "ko_KR": "Korean", + "ku_TR": "Kurdish", + "lt_LT": "Lithuanian", + "lv_LV": "Latvian", + "mk_MK": "Macedonian", + "ml_IN": "Malayalam", + "ms_MY": "Malay", + "nb_NO":"Norwegian Bokmål", + "nn_NO": "Norwegian Nynorsk", + "ne_NP": "Nepali", + "nl_NL": "Dutch", + "pa_IN": "Punjabi", + "pl_PL": "Polish", + "ps_AF": "Pashto", + "pt_BR":"Portuguese (Brazil)", + "pt_PT":"Portuguese (Portugal)", + "ro_RO": "Romanian", + "ru_RU": "Russian", + "sk_SK": "Slovak", + "sl_SI": "Slovene", + "sq_AL": "Albanian", + "sr_RS": "Serbian", + "sv_SE": "Swedish", + "sw_KE": "Swahili", + "ta_IN": "Tamil", + "te_IN": "Telugu", + "th_TH": "Thai", + "tl_PH": "Tagalog", + "tr_TR": "Turkish", + "uk_UA": "Ukrainian", + "ur_PK": "Urdu", + "vi_VN": "Vietnamese", + "zh_CN":"Simplified Chinese (China)", + "zh_HK":"Traditional Chinese (Hong Kong)", + "zh_TW":"Traditional Chinese (Taiwan)" + }, + "dateSearchRanges": { + "on": "Está en", + "notOn": "No está en", + "after": "Después", + "before": "Antes", + "between": "Entre" + }, + "intSearchRanges": { + "equals": "Iguales", + "notEquals": "Diferentes", + "greaterThan": "Mayor que", + "lessThan": "Menor que", + "greaterThanOrEquals": "Mayor o igual que", + "lessThanOrEquals": "Menor o igual que", + "between": "Entre" + }, + "autorefreshInterval": { + "0": "Ninguno", + "0.5": "30 segundos", + "1": "1 minuto", + "2": "2 minutos", + "5": "5 minutos", + "10": "10 minutos" + } + }, + "sets": { + "summernote": { + "NOTICE": "Usted puede encontrar aquí la traducción: https://github.com/HackerWins/summernote/tree/master/lang", + "font":{ + "bold": "Negrita", + "italic": "Itálico", + "underline": "Subrayado", + "strike": "Tachado", + "clear": "Quitar Estilo de Fuente", + "height": "Alto de línea", + "name": "Familia de Fuente", + "size": "Tamaño de Fuente" + }, + "image":{ + "image": "Imagen", + "insert": "Insertar Imagen", + "resizeFull": "Cambiar el tamaño a completo", + "resizeHalf": "Cambiar el tamaño a la mitad", + "resizeQuarter": "Cambiar el tamaño a un cuarto", + "floatLeft": "Flotar Izquierda", + "floatRight": "Flotar Derecha", + "floatNone": "Sin Flotar", + "dragImageHere": "Arrastrar una imagen aquí", + "selectFromFiles": "Seleccionar desde Archivo", + "url": "Url de Imagen", + "remove": "Remover Imagen" + }, + "link":{ + "link": "Enlace", + "insert": "Insertar Enlace", + "unlink": "Desenlazar", + "edit": "Editar", + "textToDisplay": "TExto a mostrar", + "url":"To what URL should this link go?", + "openInNewWindow": "Abrir en nueva ventana" + }, + "video":{ + "video": "Vídeo", + "videoLink": "Enlace al Vídeo", + "insert": "Insertar Vídeo", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" + }, + "table":{ + "table": "Tabla" + }, + "hr":{ + "insert": "Insertar regla horizontal" + }, + "style":{ + "style": "Estilo", + "normal": "Normal", + "blockquote": "Cita", + "pre": "Código", + "h1": "Header 1", + "h2": "Header 2", + "h3": "Header 3", + "h4": "Header 4", + "h5": "Header 5", + "h6": "Header 6" + }, + "lists":{ + "unordered": "Lista sin Ordenar", + "ordered": "Lista Ordenada" + }, + "options":{ + "help": "Ayuda", + "fullscreen": "Pantalla Completa", + "codeview": "Ver Código" + }, + "paragraph":{ + "paragraph": "Párrafo", + "outdent": "Anular sangría", + "indent": "Sangría", + "left": "Alinear Izquierda", + "center": "Alinear Centro", + "right": "Alinear Derecha", + "justify": "Justificado" + }, + "color":{ + "recent": "Color Reciente", + "more": "Mas Colores", + "background": "Color de Fondo", + "foreground": "Color de Fuente", + "transparent": "Transparente", + "setTransparent": "Establecer transparente", + "reset": "Resetear", + "resetToDefault": "Restablecer a (por defecto)" + }, + "shortcut":{ + "shortcuts": "Atajos de teclado", + "close": "Cerrar", + "textFormatting": "Formato de texto", + "action": "Acción", + "paragraphFormatting": "Formato de párrafo", + "documentStyle": "Estilo de Documento" + }, + "history":{ + "undo": "Deshacer", + "redo": "Rehacer" + } + } + } } diff --git a/application/Espo/Resources/i18n/es_ES/Note.json b/application/Espo/Resources/i18n/es_ES/Note.json index 6a78744a91..0249a3013e 100644 --- a/application/Espo/Resources/i18n/es_ES/Note.json +++ b/application/Espo/Resources/i18n/es_ES/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Entrada", - "attachments": "Adjuntos" - } + "fields": { + "post": "Entrada", + "attachments": "Adjuntos" + } } diff --git a/application/Espo/Resources/i18n/es_ES/Preferences.json b/application/Espo/Resources/i18n/es_ES/Preferences.json index 5d61786267..d21c6e2c6b 100644 --- a/application/Espo/Resources/i18n/es_ES/Preferences.json +++ b/application/Espo/Resources/i18n/es_ES/Preferences.json @@ -1,32 +1,32 @@ { - "fields": { - "dateFormat": "Formato de fecha", - "timeFormat": "Formato de tiempo", - "timeZone": "Zona Horaria", - "weekStart": "Primer día de la semana", - "thousandSeparator": "Separador de miles", - "decimalMark": "Separador decimal", - "defaultCurrency": "Moneda por Defecto", - "currencyList": "Lista de Moneda", - "language": "Lenguaje", - - "smtpServer": "Servidor", - "smtpPort": "Puerto", - "smtpAuth": "Autenticación", - "smtpSecurity": "Securidad", - "smtpUsername": "Nombre de Usuario", - "emailAddress": "Correo electrónico", - "smtpPassword": "Contraseña", - "smtpEmailAddress": "Correo Electrónico", - - "exportDelimiter": "Export Delimiter" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Domingo", - "1": "Lunes" - } - } + "fields": { + "dateFormat": "Formato de fecha", + "timeFormat": "Formato de tiempo", + "timeZone": "Zona Horaria", + "weekStart": "Primer día de la semana", + "thousandSeparator": "Separador de miles", + "decimalMark": "Separador decimal", + "defaultCurrency": "Moneda por Defecto", + "currencyList": "Lista de Moneda", + "language": "Lenguaje", + + "smtpServer": "Servidor", + "smtpPort": "Puerto", + "smtpAuth": "Autenticación", + "smtpSecurity": "Securidad", + "smtpUsername": "Nombre de Usuario", + "emailAddress": "Correo electrónico", + "smtpPassword": "Contraseña", + "smtpEmailAddress": "Correo Electrónico", + + "exportDelimiter": "Export Delimiter" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Domingo", + "1": "Lunes" + } + } } diff --git a/application/Espo/Resources/i18n/es_ES/Role.json b/application/Espo/Resources/i18n/es_ES/Role.json index fab61cf0f2..709fec591b 100644 --- a/application/Espo/Resources/i18n/es_ES/Role.json +++ b/application/Espo/Resources/i18n/es_ES/Role.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Nombre", - "roles": "Roles" - }, - "links": { - "users": "Usuarios", - "teams": "Equipos" - }, - "labels": { - "Access": "Acceso", - "Create Role": "Crear Rol" - }, - "options": { - "accessList": { - "not-set": "sin establecer", - "enabled": "activado", - "disabled": "desactivado" - }, - "levelList": { - "all": "todos", - "team": "equipo", - "own": "propio", - "no": "no" - } - }, - "actions": { - "read": "Leer", - "edit": "Editar", - "delete": "Borrar" - } + "fields": { + "name": "Nombre", + "roles": "Roles" + }, + "links": { + "users": "Usuarios", + "teams": "Equipos" + }, + "labels": { + "Access": "Acceso", + "Create Role": "Crear Rol" + }, + "options": { + "accessList": { + "not-set": "sin establecer", + "enabled": "activado", + "disabled": "desactivado" + }, + "levelList": { + "all": "todos", + "team": "equipo", + "own": "propio", + "no": "no" + } + }, + "actions": { + "read": "Leer", + "edit": "Editar", + "delete": "Borrar" + } } diff --git a/application/Espo/Resources/i18n/es_ES/ScheduledJob.json b/application/Espo/Resources/i18n/es_ES/ScheduledJob.json index f04fa7fcd1..76f16a2a2c 100644 --- a/application/Espo/Resources/i18n/es_ES/ScheduledJob.json +++ b/application/Espo/Resources/i18n/es_ES/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Nombre", - "status": "Estado", - "job": "Trabajo", - "scheduling": "Scheduling (crontab notation)" - }, - "links": { - "log": "Registro de Log" - }, - "labels": { - "Create ScheduledJob": "Crear Tarea programado" - }, - "options": { - "job": { - "CheckInboundEmails": "Comprobar Correos Entrantes", - "Cleanup": "Limpiar" - }, - "cronSetup": { - "linux": "Nota: Añada esta línea al archivo crontab para ejecutar trabajos Espo programadas:", - "mac": "Nota: Añada esta línea al archivo crontab para ejecutar trabajos Espo programadas:", - "windows": "Nota: Crear un archivo por lotes con los siguientes comandos para ejecutar tareas programadas usando Espo tareas programadas de Windows:", - "default": "Note: Add this command to Cron Job (Scheduled Task):" - }, - "status": { - "Active": "Activo", - "Inactive": "Inactivo" - } - } + "fields": { + "name": "Nombre", + "status": "Estado", + "job": "Trabajo", + "scheduling": "Scheduling (crontab notation)" + }, + "links": { + "log": "Registro de Log" + }, + "labels": { + "Create ScheduledJob": "Crear Tarea programado" + }, + "options": { + "job": { + "CheckInboundEmails": "Comprobar Correos Entrantes", + "Cleanup": "Limpiar" + }, + "cronSetup": { + "linux": "Nota: Añada esta línea al archivo crontab para ejecutar trabajos Espo programadas:", + "mac": "Nota: Añada esta línea al archivo crontab para ejecutar trabajos Espo programadas:", + "windows": "Nota: Crear un archivo por lotes con los siguientes comandos para ejecutar tareas programadas usando Espo tareas programadas de Windows:", + "default": "Note: Add this command to Cron Job (Scheduled Task):" + }, + "status": { + "Active": "Activo", + "Inactive": "Inactivo" + } + } } diff --git a/application/Espo/Resources/i18n/es_ES/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/es_ES/ScheduledJobLogRecord.json index d37b200c3a..ad2cf50af4 100644 --- a/application/Espo/Resources/i18n/es_ES/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/es_ES/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Estado", - "executionTime": "Tiempo de Ejecución" - } + "fields": { + "status": "Estado", + "executionTime": "Tiempo de Ejecución" + } } diff --git a/application/Espo/Resources/i18n/es_ES/Settings.json b/application/Espo/Resources/i18n/es_ES/Settings.json index 8ff43d4180..b51a6157fd 100644 --- a/application/Espo/Resources/i18n/es_ES/Settings.json +++ b/application/Espo/Resources/i18n/es_ES/Settings.json @@ -1,44 +1,44 @@ { - "fields": { - "useCache": "Usar Cache", - "dateFormat": "Formato de fecha", - "timeFormat": "Formato de tiempo", - "timeZone": "Zona Horaria", - "weekStart": "Primer día de la semana", - "thousandSeparator": "Separador de miles", - "decimalMark": "Separador decimal", - "defaultCurrency": "Moneda por Defecto", - "currencyList": "Lista de Moneda", - "language": "Lenguaje", - - "smtpServer": "Servidor", - "smtpPort": "Puerto", - "smtpAuth": "Autenticación", - "smtpSecurity": "Securidad", - "smtpUsername": "Nombre de Usuario", - "emailAddress": "Correo electrónico", - "smtpPassword": "Contraseña", - "outboundEmailFromName": "De Nombre", - "outboundEmailFromAddress": "De la dirección", - "outboundEmailIsShared": "Es Compartido", - - "recordsPerPage": "Registros por Página", - "recordsPerPageSmall": "Records Per Page (Small)", - "tabList": "Lista Pestaña", - "quickCreateList": "Crear Lista Rápido", - - "exportDelimiter": "Export Delimiter" - }, - "options": { - "weekStart": { - "0": "Domingo", - "1": "Lunes" - } - }, - "labels": { - "System": "Sistema", - "Locale": "Localización", - "SMTP": "SMTP", - "Configuration": "Configuración" - } + "fields": { + "useCache": "Usar Cache", + "dateFormat": "Formato de fecha", + "timeFormat": "Formato de tiempo", + "timeZone": "Zona Horaria", + "weekStart": "Primer día de la semana", + "thousandSeparator": "Separador de miles", + "decimalMark": "Separador decimal", + "defaultCurrency": "Moneda por Defecto", + "currencyList": "Lista de Moneda", + "language": "Lenguaje", + + "smtpServer": "Servidor", + "smtpPort": "Puerto", + "smtpAuth": "Autenticación", + "smtpSecurity": "Securidad", + "smtpUsername": "Nombre de Usuario", + "emailAddress": "Correo electrónico", + "smtpPassword": "Contraseña", + "outboundEmailFromName": "De Nombre", + "outboundEmailFromAddress": "De la dirección", + "outboundEmailIsShared": "Es Compartido", + + "recordsPerPage": "Registros por Página", + "recordsPerPageSmall": "Records Per Page (Small)", + "tabList": "Lista Pestaña", + "quickCreateList": "Crear Lista Rápido", + + "exportDelimiter": "Export Delimiter" + }, + "options": { + "weekStart": { + "0": "Domingo", + "1": "Lunes" + } + }, + "labels": { + "System": "Sistema", + "Locale": "Localización", + "SMTP": "SMTP", + "Configuration": "Configuración" + } } diff --git a/application/Espo/Resources/i18n/es_ES/Team.json b/application/Espo/Resources/i18n/es_ES/Team.json index 41f8be42af..9b2c7c7d15 100644 --- a/application/Espo/Resources/i18n/es_ES/Team.json +++ b/application/Espo/Resources/i18n/es_ES/Team.json @@ -1,12 +1,12 @@ { - "fields": { - "name": "Nombre", - "roles": "Roles" - }, - "links": { - "users": "Usuarios" - }, - "labels": { - "Create Team": "Crear Equipo" - } + "fields": { + "name": "Nombre", + "roles": "Roles" + }, + "links": { + "users": "Usuarios" + }, + "labels": { + "Create Team": "Crear Equipo" + } } diff --git a/application/Espo/Resources/i18n/es_ES/User.json b/application/Espo/Resources/i18n/es_ES/User.json index 2c8e77f5a3..cd1b5097a8 100644 --- a/application/Espo/Resources/i18n/es_ES/User.json +++ b/application/Espo/Resources/i18n/es_ES/User.json @@ -1,21 +1,21 @@ { - "fields": { - "name": "Nombre", - "userName": "Nombre de Usuario", - "title": "Título", - "isAdmin": "Es Administrador", - "defaultTeam": "Equipo por Defecto", - "emailAddress": "Correo electrónico", - "phone": "Teléfono", - "roles": "Roles", - "password": "Contraseña", - "passwordConfirm": "Confirmar Contraseña" - }, - "links": { - "teams": "Equipos", - "roles": "Roles" - }, - "labels": { - "Create User": "Crear Usuario" - } + "fields": { + "name": "Nombre", + "userName": "Nombre de Usuario", + "title": "Título", + "isAdmin": "Es Administrador", + "defaultTeam": "Equipo por Defecto", + "emailAddress": "Correo electrónico", + "phone": "Teléfono", + "roles": "Roles", + "password": "Contraseña", + "passwordConfirm": "Confirmar Contraseña" + }, + "links": { + "teams": "Equipos", + "roles": "Roles" + }, + "labels": { + "Create User": "Crear Usuario" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/Admin.json b/application/Espo/Resources/i18n/fr_FR/Admin.json index 428cd73c68..c7e677cf69 100644 --- a/application/Espo/Resources/i18n/fr_FR/Admin.json +++ b/application/Espo/Resources/i18n/fr_FR/Admin.json @@ -1,126 +1,126 @@ { - "labels": { - "Enabled": "Activé", - "Disabled": "Désactivé", - "System": "Système", - "Users": "Utilisateurs", - "Email": "Email", - "Data": "Données", - "Customization": "Personalisation", - "Available Fields": "Champs Disponibles", - "Layout": "Disposition", - "Enabled": "Activé", - "Disabled": "Désactivé", - "Add Panel": "Ajouter un Panneau", - "Add Field": "Ajouter un Champs", - "Settings": "Paramètres", - "Scheduled Jobs": "Tâches Planifiées", - "Upgrade": "Mettre à Jour", - "Clear Cache": "Vider le Cache", - "Rebuild": "Reconstruire", - "Users": "Utilisateurs", - "Teams": "Equipes", - "Roles": "Rôles", - "Outbound Emails": "Emails Sortants", - "Inbound Emails": "Emails Entrants", - "Email Templates": "Modèles d'email", - "Import": "Importer", - "Layout Manager": "Gestionnaire de Dispositions", - "Field Manager": "Gestionnaire de Colonnes", - "User Interface": "Interface Utilisateur", - "Auth Tokens": "Jetons d'Identification", - "Authentication": "Authentification" - }, - "layouts": { - "list": "Liste", - "detail": "Détail", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Filtres de Recherche", - "massUpdate": "Mise à Jour en Masse", - "relationships": "Rapports" - }, - "fieldTypes": { - "address": "Adresse", - "array": "Tableau", - "foreign": "Etranger", - "duration": "Durée", - "password": "Mot de Passe", - "parsonName": "Nom Personnel", - "autoincrement": "Auto incrémenté", - "bool": "Boléen", - "currency": "Monnaie", - "date": "Date", - "datetime": "Heure et Date", - "email": "Email", - "enum": "Enumérateur", - "enumInt": "Enumérateur Entier", - "enumFloat": "Enumérateur Flottant", - "float": "Flottant", - "int": "Entier", - "link": "Lien", - "linkMultiple": "Lien Multiple", - "linkParent": "Lien Parent", - "multienim": "Enumérateur Multiple", - "phone": "Téléphone", - "text": "Texte", - "url": "Url", - "varchar": "Varchar", - "file": "Fichier", - "image": "Image" - }, - "fields": { - "type": "Type", - "name": "Nom", - "label": "Label", - "required": "Requis", - "default": "Standard", - "maxLength": "Taille Maximum", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Lien", - "field": "Champs", - "min": "Min", - "max": "Max", - "translation": "Traduction", - "previewSize": "Taille de l'Aperçu" - }, - "messages": { - "upgradeVersion": "Your EspoCRM will be upgraded to version {version}. This can take some time.", - "upgradeDone": "Your EspoCRM has been upgraded to version {version}. Refresh your browser window.", - "upgradeBackup": "We recommend you to make backup of your EspoCRM files and data before upgrade.", - "thousandSeparatorEqualsDecimalMark": "Le séparateur de milliers ne peut être égal au marqueur décimal", - "userHasNoEmailAddress": "L'utilisateur n'a pas d'adresse email.", - "selectEntityType": "Selectionner le type d'entité dans le menu gauche", - "selectUpgradePackage": "Sélectionnez le package de mise à niveau", - "selectLayout": "" - }, - "descriptions": { - "settings": "Paramètres système de l'application", - "scheduledJob": "Tâches ", - "upgrade": "Mettre à niveau EspoCRM.", - "clearCache": "Vider le Cache d'arrière-plan.", - "rebuild": "Reconstruire l'arrière plan et vider le cache.", - "users": "Gestion des utilisateurs.", - "teams": "Gestion des équipes.", - "roles": "Gestion des rôles.", - "outboundEmails": "Paramètres SMTP des emails sortants.", - "inboundEmails": "Group IMAP email accouts. Email import and Email-to-Case.", - "emailTemplates": "Modèles pour les emails sortants.", - "import": "Importer des données depuis un fichier CSV.", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Créer de nouveaux champs ou personnaliser ceux existants.", - "userInterface": "Configurer l'interface utilisateur.", - "authTokens": "Sessions authorisées Activées. Adresse IP et dernière date d'accès.", - "authentication": "Paramètres d'authentification." - }, - "options": { - "previewSize": { - "x-small": "Très petit", - "small": "Petit", - "medium": "Moyen", - "large": "Grand" - } - } + "labels": { + "Enabled": "Activé", + "Disabled": "Désactivé", + "System": "Système", + "Users": "Utilisateurs", + "Email": "Email", + "Data": "Données", + "Customization": "Personalisation", + "Available Fields": "Champs Disponibles", + "Layout": "Disposition", + "Enabled": "Activé", + "Disabled": "Désactivé", + "Add Panel": "Ajouter un Panneau", + "Add Field": "Ajouter un Champs", + "Settings": "Paramètres", + "Scheduled Jobs": "Tâches Planifiées", + "Upgrade": "Mettre à Jour", + "Clear Cache": "Vider le Cache", + "Rebuild": "Reconstruire", + "Users": "Utilisateurs", + "Teams": "Equipes", + "Roles": "Rôles", + "Outbound Emails": "Emails Sortants", + "Inbound Emails": "Emails Entrants", + "Email Templates": "Modèles d'email", + "Import": "Importer", + "Layout Manager": "Gestionnaire de Dispositions", + "Field Manager": "Gestionnaire de Colonnes", + "User Interface": "Interface Utilisateur", + "Auth Tokens": "Jetons d'Identification", + "Authentication": "Authentification" + }, + "layouts": { + "list": "Liste", + "detail": "Détail", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Filtres de Recherche", + "massUpdate": "Mise à Jour en Masse", + "relationships": "Rapports" + }, + "fieldTypes": { + "address": "Adresse", + "array": "Tableau", + "foreign": "Etranger", + "duration": "Durée", + "password": "Mot de Passe", + "parsonName": "Nom Personnel", + "autoincrement": "Auto incrémenté", + "bool": "Boléen", + "currency": "Monnaie", + "date": "Date", + "datetime": "Heure et Date", + "email": "Email", + "enum": "Enumérateur", + "enumInt": "Enumérateur Entier", + "enumFloat": "Enumérateur Flottant", + "float": "Flottant", + "int": "Entier", + "link": "Lien", + "linkMultiple": "Lien Multiple", + "linkParent": "Lien Parent", + "multienim": "Enumérateur Multiple", + "phone": "Téléphone", + "text": "Texte", + "url": "Url", + "varchar": "Varchar", + "file": "Fichier", + "image": "Image" + }, + "fields": { + "type": "Type", + "name": "Nom", + "label": "Label", + "required": "Requis", + "default": "Standard", + "maxLength": "Taille Maximum", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Lien", + "field": "Champs", + "min": "Min", + "max": "Max", + "translation": "Traduction", + "previewSize": "Taille de l'Aperçu" + }, + "messages": { + "upgradeVersion": "Your EspoCRM will be upgraded to version {version}. This can take some time.", + "upgradeDone": "Your EspoCRM has been upgraded to version {version}. Refresh your browser window.", + "upgradeBackup": "We recommend you to make backup of your EspoCRM files and data before upgrade.", + "thousandSeparatorEqualsDecimalMark": "Le séparateur de milliers ne peut être égal au marqueur décimal", + "userHasNoEmailAddress": "L'utilisateur n'a pas d'adresse email.", + "selectEntityType": "Selectionner le type d'entité dans le menu gauche", + "selectUpgradePackage": "Sélectionnez le package de mise à niveau", + "selectLayout": "" + }, + "descriptions": { + "settings": "Paramètres système de l'application", + "scheduledJob": "Tâches ", + "upgrade": "Mettre à niveau EspoCRM.", + "clearCache": "Vider le Cache d'arrière-plan.", + "rebuild": "Reconstruire l'arrière plan et vider le cache.", + "users": "Gestion des utilisateurs.", + "teams": "Gestion des équipes.", + "roles": "Gestion des rôles.", + "outboundEmails": "Paramètres SMTP des emails sortants.", + "inboundEmails": "Group IMAP email accouts. Email import and Email-to-Case.", + "emailTemplates": "Modèles pour les emails sortants.", + "import": "Importer des données depuis un fichier CSV.", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Créer de nouveaux champs ou personnaliser ceux existants.", + "userInterface": "Configurer l'interface utilisateur.", + "authTokens": "Sessions authorisées Activées. Adresse IP et dernière date d'accès.", + "authentication": "Paramètres d'authentification." + }, + "options": { + "previewSize": { + "x-small": "Très petit", + "small": "Petit", + "medium": "Moyen", + "large": "Grand" + } + } } diff --git a/application/Espo/Resources/i18n/fr_FR/AuthToken.json b/application/Espo/Resources/i18n/fr_FR/AuthToken.json index 1c9140adcb..f7833d8bf8 100644 --- a/application/Espo/Resources/i18n/fr_FR/AuthToken.json +++ b/application/Espo/Resources/i18n/fr_FR/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "Utilisateur", - "ipAddress": "Adresse IP", - "lastAccess": "Date du dernier accès", - "createdAt": "Date de connexion" + "fields": { + "user": "Utilisateur", + "ipAddress": "Adresse IP", + "lastAccess": "Date du dernier accès", + "createdAt": "Date de connexion" - } + } } diff --git a/application/Espo/Resources/i18n/fr_FR/Email.json b/application/Espo/Resources/i18n/fr_FR/Email.json index f7c7379236..f407e10985 100644 --- a/application/Espo/Resources/i18n/fr_FR/Email.json +++ b/application/Espo/Resources/i18n/fr_FR/Email.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Sujet", - "parent": "Parent", - "status": "Statut", - "dateSent": "Date d'envoi", - "from": "De", - "to": "Vers", - "cc": "CC", - "bcc": "BCC", - "isHtml": "En HTML", - "body": "Corps", - "subject": "Sujet", - "attachments": "Fichiers Joints", - "selectTemplate": "Selectionner le Modèle", - "fromEmailAddress": "Adresse de l'Emetteur", - "toEmailAddresses": "Adresse du Destinataire", - "emailAddress": "Adresse Email" - }, - "links": { - }, - "options": { - "Draft": "Brouillon", - "Sending": "En Envoi", - "Sent": "Envoyé", - "Archived": "Archivé" - }, - "labels": { - "Create Email": "Archiver les Emails", - "Compose": "Nouveau Message" - } + "fields": { + "name": "Sujet", + "parent": "Parent", + "status": "Statut", + "dateSent": "Date d'envoi", + "from": "De", + "to": "Vers", + "cc": "CC", + "bcc": "BCC", + "isHtml": "En HTML", + "body": "Corps", + "subject": "Sujet", + "attachments": "Fichiers Joints", + "selectTemplate": "Selectionner le Modèle", + "fromEmailAddress": "Adresse de l'Emetteur", + "toEmailAddresses": "Adresse du Destinataire", + "emailAddress": "Adresse Email" + }, + "links": { + }, + "options": { + "Draft": "Brouillon", + "Sending": "En Envoi", + "Sent": "Envoyé", + "Archived": "Archivé" + }, + "labels": { + "Create Email": "Archiver les Emails", + "Compose": "Nouveau Message" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/EmailAddress.json b/application/Espo/Resources/i18n/fr_FR/EmailAddress.json index f9a58d2100..4399d99a34 100644 --- a/application/Espo/Resources/i18n/fr_FR/EmailAddress.json +++ b/application/Espo/Resources/i18n/fr_FR/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Premier", - "Opted Out": "Opted Out", - "Invalid": "Invalide" - } + "labels": { + "Primary": "Premier", + "Opted Out": "Opted Out", + "Invalid": "Invalide" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/EmailTemplate.json b/application/Espo/Resources/i18n/fr_FR/EmailTemplate.json index 4dd183fa79..a9a8a7f90c 100644 --- a/application/Espo/Resources/i18n/fr_FR/EmailTemplate.json +++ b/application/Espo/Resources/i18n/fr_FR/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Nom", - "status": "Statut", - "isHtml": "En HTML", - "body": "Corps", - "subject": "Sujet", - "attachments": "Fichiers Joints", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Créer un modèle d'email" - } + "fields": { + "name": "Nom", + "status": "Statut", + "isHtml": "En HTML", + "body": "Corps", + "subject": "Sujet", + "attachments": "Fichiers Joints", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Créer un modèle d'email" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/Global.json b/application/Espo/Resources/i18n/fr_FR/Global.json index 58b639d2cb..141b73557b 100644 --- a/application/Espo/Resources/i18n/fr_FR/Global.json +++ b/application/Espo/Resources/i18n/fr_FR/Global.json @@ -1,397 +1,397 @@ { - "scopeNames": { - "Email": "Email", - "User": "Utilisateur", - "Team": "Equipe", - "Role": "Rôle", - "EmailTemplate": "Modèle d'Email", - "OutboundEmail": "Email Sortant", - "ScheduledJob": "Tâche Planifiée" - }, - "scopeNamesPlural": { - "Email": "Courriers", - "User": "Utilisateurs", - "Team": "Equipes", - "Role": "Rôles", - "EmailTemplate": "Modèles d'email", - "OutboundEmail": "Emails Sortants", - "ScheduledJob": "Tâches Planifiées" - }, - "labels": { - "Misc": "Divers", - "Merge": "Fusionner", - "None": "Aucun", - "by": "par", - "Saved": "Sauvegardé", - "Error": "Erreur", - "Select": "Selectionner", - "Not valid": "Invalide", - "Please wait...": "Veuillez patienter...", - "Please wait": "Veuillez patienter", - "Loading...": "Chargement...", - "Uploading...": "Téléchargement ...", - "Sending...": "Envoi en cours ...", - "Removed": "Supprimé", - "Posted": "Posté", - "Linked": "Associé", - "Unlinked": "Dissocié", - "Access denied": "Accès refusé", - "Access": "Accès", - "Are you sure?": "Are you sure?", - "Record has been removed": "Enregistrement éffacé", - "Wrong username/password": "Nom d'utilisateur/mot de passe erroné", - "Post cannot be empty": "Le poste ne peut être vide", - "Removing...": "Effacement...", - "Unlinking...": "Dissociation...", - "Posting...": "Envoi...", - "Username can not be empty!": "Le nom d'utilisateur doit être renseigné !", - "Cache is not enabled": "Le cache n'est pas activé", - "Cache has been cleared": "Le Cache a été vidé", - "Rebuild has been done": "Refonte terminée", - "Saving...": "Enregistrement...", - "Modified": "Modifié", - "Created": "Créé", - "Create": "Créer", - "create": "créer", - "Overview": "vue d'ensemble", - "Details": "Informations", - "Add Filter": "Ajouter un Filtre", - "Add Dashlet": "Ajouter un Dashlet", - "Add": "Ajouter", - "Reset": "Remise à zéro", - "Menu": "Menu", - "More": "Plus", - "Search": "Rechercher", - "Only My": "Seulement Moi", - "Open": "Ouvrir", - "Admin": "Admin", - "About": "A propos", - "Refresh": "Actualiser", - "Remove": "Supprimer", - "Options": "Options", - "Username": "Nom d'utilisateur", - "Password": "Mot de Passe", - "Login": "Connexion", - "Log Out": "Déconnexion", - "Preferences": "Préférences", - "State": "Département", - "Street": "Rue", - "Country": "Pays", - "City": "Ville", - "PostalCode": "Code Postal", - "Followed": "Suivi", - "Follow": "Suivre", - "Clear Local Cache": "Vider le Cache Local", - "Actions": "Actions", - "Delete": "Effacer", - "Update": "Mettre à jour", - "Save": "Enregistrer", - "Edit": "Edition", - "Cancel": "Annuler", - "Unlink": "Dissocier", - "Mass Update": "Mise à Jour en Masse", - "Export": "Exporter", - "No Data": "Données vides", - "All": "Tout", - "Active": "Activer", - "Inactive": "Désactiver", - "Write your comment here": "Ecrire ici votre commentaire", - "Post": "Poster", - "Stream": "Flux", - "Show more": "En savoir plus", - "Dashlet Options": "Options du Dashlet", - "Full Form": "Formulaire Complet", - "Insert": "Insertion", - "Person": "Personne", - "First Name": "Prénom", - "Last Name": "Nom de Famille", - "Original": "Original", - "You": "Vous", - "you": "vous", - "change": "Modifier", - "Primary": "Premier" - }, - "messages": { - "notModified": "Vous n'avez pas modifié l'enregistrement", - "duplicate": "La création de l'enregistrement ressemble à un doublon", - "fieldIsRequired": "{field} est requise", - "fieldShouldBeEmail": "{field} doit être une adresse email valide", - "fieldShouldBeFloat": "{field} doit être un flottant valide", - "fieldShouldBeInt": "{field} doit être un entier valide", - "fieldShouldBeDate": "{field} doit être une date valide", - "fieldShouldBeDatetime": "{field} doit être une date/heure valide", - "fieldShouldAfter": "{field} doit se situer après {otherField}", - "fieldShouldBefore": "{field} doit se situer avant {otherField}", - "fieldShouldBeBetween": "{field} doit se situer entre {min} et {max}", - "fieldShouldBeLess": "{field} doit être inférieur à {value}", - "fieldShouldBeGreater": "{field} doit être supérieur à {value}", - "fieldBadPasswordConfirm": "{field} confirmation inappropriée" - }, - "boolFilters": { - "onlyMy": "Seulement Moi", - "open": "Ouvrir", - "active": "Activer" - }, - "fields": { - "name": "Nom", - "firstName": "Prénom", - "lastName": "Nom de Famille", - "salutationName": "Salutation", - "assignedUser": "Utilisateur Assigné", - "emailAddress": "Email", - "assignedUserName": "Nom d'Utilisateur Assigné", - "teams": "Equipes", - "createdAt": "Créé le", - "modifiedAt": "Modifié le", - "createdBy": "Créé par", - "modifiedBy": "Modifié par", - "title": "Titre", - "dateFrom": "Date de Reception", - "dateTo": "Date d'Envoi", - "autorefreshInterval": "Intervalle d'Auto-actualisation", - "displayRecords": "Afficher les Enregistrements" - }, - "links": { - "teams": "Equipes", - "users": "Utilisateurs" - }, - "dashlets": { - "Stream": "Flux" - }, - "streamMessages": { - "create": "{user} a créé {entityType} {entity}", - "createAssigned": "{user} a créé {entityType} {entity} assigné à {assignee}", - "assign": "{user} a assigné {entityType} {entity} à {assignee}", - "post": "{user} a posté sur {entityType} {entity}", - "attach": "{user} attaché à {entityType} {entity}", - "status": "{user} a mis à jour {field} sur {entityType} {entity}", - "update": "{user} a mis à jour {entityType} {entity}", - "createRelated": "{user} created {relatedEntityType} {relatedEntity} linked to {entityType} {entity}", - "emailReceived": "{entity} a été reçu pour {entityType} {entity}", - - "createThis": "{user} a créé {entityType}", - "createAssignedThis": "{user} a créé {entityType} assigné à {assignee}", - "assignThis": "{user} a assigné {entityType} à {assignee}", - "postThis": "{user} a posté", - "attachThis": "{user} a attaché", - "statusThis": "{user} a mis à jour {field}", - "updateThis": "{user} a mis à jour {entityType}", - "createRelatedThis": "{user} created {relatedEntityType} {relatedEntity} linked to this {entityType}", - "emailReceivedThis": "{entity} a été reçu" - }, - "lists": { - "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] - }, - "options": { - "salutationName": { - "Mr.": "Mr.", - "Mrs.": "Mme", - "Dr.": "Dr.", - "Drs.": "Dr." - }, - "language": { - "af_ZA": "Afrikaner", - "az_AZ": "Azerbaïdjanais", - "be_BY": "Biélorusse", - "bg_BG": "Bulgare", - "bn_IN": "Bengali", - "bs_BA": "Bosnien", - "ca_ES": "Catalan", - "cs_CZ": "Tchèque", - "cy_GB": "Gallois", - "da_DK": "Danois", - "de_DE": "Allemand", - "el_GR": "Grec", - "en_GB":"English (UK)", - "en_US":"English (US)", - "es_ES":"Spanish (Spain)", - "et_EE": "Estonien", - "eu_ES": "Basque", - "fa_IR": "Farsi", - "fi_FI": "Finlandais", - "fo_FO": "féroïen", - "fr_CA":"French (Canada)", - "fr_FR":"French (France)", - "ga_IE": "Irlandais", - "gl_ES": "Galicien", - "gn_PY": "Guarani", - "he_IL": "Hébreu", - "hi_IN": "Hindi", - "hr_HR": "Croate", - "hu_HU": "Hongrois", - "hy_AM": "Arménien", - "id_ID": "Indonésien", - "is_IS": "Islandais", - "it_IT": "Italien", - "ja_JP": "Japonais", - "ka_GE": "Georgien", - "km_KH": "Khmer", - "ko_KR": "Coréen", - "ku_TR": "Kurde", - "lt_LT": "Lithuanien", - "lv_LV": "Lettonien", - "mk_MK": "Macedonien", - "ml_IN": "Malayalam", - "ms_MY": "Malais", - "nb_NO": "Norvegien Bokmål", - "nn_NO": "Norvegien Nynorsk", - "ne_NP": "Népalais", - "nl_NL": "Néerlandais", - "pa_IN": "Pendjabi", - "pl_PL": "Polonais", - "ps_AF": "Pachtoune", - "pt_BR":"Portuguese (Brazil)", - "pt_PT":"Portuguese (Portugal)", - "ro_RO": "Roumain", - "ru_RU": "Russe", - "sk_SK": "Slovaque", - "sl_SI": "Slovène", - "sq_AL": "Albanais", - "sr_RS": "Serbe", - "sv_SE": "Suèdois", - "sw_KE": "Swahili", - "ta_IN": "Tamoul", - "te_IN": "Télougou", - "th_TH": "Thailandais", - "tl_PH": "Tagalog", - "tr_TR": "Turc", - "uk_UA": "Ucrainien", - "ur_PK": "Urdu", - "vi_VN": "Vietnamien", - "zh_CN":"Simplified Chinese (China)", - "zh_HK":"Traditional Chinese (Hong Kong)", - "zh_TW":"Traditional Chinese (Taiwan)" - }, - "dateSearchRanges": { - "on": "En Marche", - "notOn": "Arrêté", - "after": "Après", - "before": "Avant", - "between": "Entre" - }, - "intSearchRanges": { - "equals": "Egual", - "notEquals": "Différent", - "greaterThan": "Supérieur à", - "lessThan": "Inférieur à", - "greaterThanOrEquals": "Supérieur ou Egual à", - "lessThanOrEquals": "Inférieur ou Egual à", - "between": "Entre" - }, - "autorefreshInterval": { - "0": "Aucun", - "0.5": "30 secondes", - "1": "1 minute", - "2": "2 minutes", - "5": "5 minutes", - "10": "10 minutes" - } - }, - "sets": { - "summernote": { - "NOTICE": "You can find translation here: https://github.com/HackerWins/summernote/tree/master/lang", - "font":{ - "bold": "Gras", - "italic": "Italique", - "underline": "Souligné", - "strike": "Touche", - "clear": "Retirer le Style de Police", - "height": "Hauteur de Ligne", - "name": "Police de Caractère", - "size": "Taille de Police" - }, - "image":{ - "image": "Image", - "insert": "Insérer une Image", - "resizeFull": "Redimensioner à 100%", - "resizeHalf": "Redimensioner à 50%", - "resizeQuarter": "Redimensioner à 25%", - "floatLeft": "Flottant Gauche", - "floatRight": "Flottant Droit", - "floatNone": "Aucun Flottant", - "dragImageHere": "Glisser une Image ici", - "selectFromFiles": "Parcourir", - "url": "Url de l'Image", - "remove": "Supprimer l'Image" - }, - "link":{ - "link": "Lien", - "insert": "Insérer un Lien", - "unlink": "Dissocier", - "edit": "Edition", - "textToDisplay": "Texte à Afficher", - "url":"To what URL should this link go?", - "openInNewWindow": "Ouvrir dans une Nouvelle Fenêtre" - }, - "video":{ - "video": "Vidéo", - "videoLink": "Lien Vidéo", - "insert": "Insérer une Vidéo", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" - }, - "table":{ - "table": "Tableau" - }, - "hr":{ - "insert": "Insérer une Régle Horizontale" - }, - "style":{ - "style": "Style", - "normal": "Normal", - "blockquote": "Guillemet", - "pre": "Code", - "h1": "Entête 1", - "h2": "Entête 2", - "h3": "Entête 3", - "h4": "Entête 4", - "h5": "Entête 5", - "h6": "Entête 6" - }, - "lists":{ - "unordered": "Liste non Ordonnée", - "ordered": "Liste Ordonnée" - }, - "options":{ - "help": "Aide", - "fullscreen": "Plein Ecran", - "codeview": "Visualiser le Code" - }, - "paragraph":{ - "paragraph": "Paragraphe", - "outdent": "Désindenter", - "indent": "Indenter", - "left": "Aligné à Gauche", - "center": "Centré", - "right": "Aligné à Droite", - "justify": "Justifié" - }, - "color":{ - "recent": "Couleur Récente", - "more": "Plus de Couleur", - "background": "Couleur de Fond", - "foreground": "Couleur de Police", - "transparent": "Transparent", - "setTransparent": "Réglage Transparent", - "reset": "Remise à zéro", - "resetToDefault": "Réglages par défaut" - }, - "shortcut":{ - "shortcuts": "Raccourcis Clavier", - "close": "Fermer", - "textFormatting": "Mise en forme du texte", - "action": "Action", - "paragraphFormatting": "Mise en forme du Paragraphe", - "documentStyle": "Style du Document" - }, - "history":{ - "undo": "Annuler", - "redo": "Restaurer" - } - } - } + "scopeNames": { + "Email": "Email", + "User": "Utilisateur", + "Team": "Equipe", + "Role": "Rôle", + "EmailTemplate": "Modèle d'Email", + "OutboundEmail": "Email Sortant", + "ScheduledJob": "Tâche Planifiée" + }, + "scopeNamesPlural": { + "Email": "Courriers", + "User": "Utilisateurs", + "Team": "Equipes", + "Role": "Rôles", + "EmailTemplate": "Modèles d'email", + "OutboundEmail": "Emails Sortants", + "ScheduledJob": "Tâches Planifiées" + }, + "labels": { + "Misc": "Divers", + "Merge": "Fusionner", + "None": "Aucun", + "by": "par", + "Saved": "Sauvegardé", + "Error": "Erreur", + "Select": "Selectionner", + "Not valid": "Invalide", + "Please wait...": "Veuillez patienter...", + "Please wait": "Veuillez patienter", + "Loading...": "Chargement...", + "Uploading...": "Téléchargement ...", + "Sending...": "Envoi en cours ...", + "Removed": "Supprimé", + "Posted": "Posté", + "Linked": "Associé", + "Unlinked": "Dissocié", + "Access denied": "Accès refusé", + "Access": "Accès", + "Are you sure?": "Are you sure?", + "Record has been removed": "Enregistrement éffacé", + "Wrong username/password": "Nom d'utilisateur/mot de passe erroné", + "Post cannot be empty": "Le poste ne peut être vide", + "Removing...": "Effacement...", + "Unlinking...": "Dissociation...", + "Posting...": "Envoi...", + "Username can not be empty!": "Le nom d'utilisateur doit être renseigné !", + "Cache is not enabled": "Le cache n'est pas activé", + "Cache has been cleared": "Le Cache a été vidé", + "Rebuild has been done": "Refonte terminée", + "Saving...": "Enregistrement...", + "Modified": "Modifié", + "Created": "Créé", + "Create": "Créer", + "create": "créer", + "Overview": "vue d'ensemble", + "Details": "Informations", + "Add Filter": "Ajouter un Filtre", + "Add Dashlet": "Ajouter un Dashlet", + "Add": "Ajouter", + "Reset": "Remise à zéro", + "Menu": "Menu", + "More": "Plus", + "Search": "Rechercher", + "Only My": "Seulement Moi", + "Open": "Ouvrir", + "Admin": "Admin", + "About": "A propos", + "Refresh": "Actualiser", + "Remove": "Supprimer", + "Options": "Options", + "Username": "Nom d'utilisateur", + "Password": "Mot de Passe", + "Login": "Connexion", + "Log Out": "Déconnexion", + "Preferences": "Préférences", + "State": "Département", + "Street": "Rue", + "Country": "Pays", + "City": "Ville", + "PostalCode": "Code Postal", + "Followed": "Suivi", + "Follow": "Suivre", + "Clear Local Cache": "Vider le Cache Local", + "Actions": "Actions", + "Delete": "Effacer", + "Update": "Mettre à jour", + "Save": "Enregistrer", + "Edit": "Edition", + "Cancel": "Annuler", + "Unlink": "Dissocier", + "Mass Update": "Mise à Jour en Masse", + "Export": "Exporter", + "No Data": "Données vides", + "All": "Tout", + "Active": "Activer", + "Inactive": "Désactiver", + "Write your comment here": "Ecrire ici votre commentaire", + "Post": "Poster", + "Stream": "Flux", + "Show more": "En savoir plus", + "Dashlet Options": "Options du Dashlet", + "Full Form": "Formulaire Complet", + "Insert": "Insertion", + "Person": "Personne", + "First Name": "Prénom", + "Last Name": "Nom de Famille", + "Original": "Original", + "You": "Vous", + "you": "vous", + "change": "Modifier", + "Primary": "Premier" + }, + "messages": { + "notModified": "Vous n'avez pas modifié l'enregistrement", + "duplicate": "La création de l'enregistrement ressemble à un doublon", + "fieldIsRequired": "{field} est requise", + "fieldShouldBeEmail": "{field} doit être une adresse email valide", + "fieldShouldBeFloat": "{field} doit être un flottant valide", + "fieldShouldBeInt": "{field} doit être un entier valide", + "fieldShouldBeDate": "{field} doit être une date valide", + "fieldShouldBeDatetime": "{field} doit être une date/heure valide", + "fieldShouldAfter": "{field} doit se situer après {otherField}", + "fieldShouldBefore": "{field} doit se situer avant {otherField}", + "fieldShouldBeBetween": "{field} doit se situer entre {min} et {max}", + "fieldShouldBeLess": "{field} doit être inférieur à {value}", + "fieldShouldBeGreater": "{field} doit être supérieur à {value}", + "fieldBadPasswordConfirm": "{field} confirmation inappropriée" + }, + "boolFilters": { + "onlyMy": "Seulement Moi", + "open": "Ouvrir", + "active": "Activer" + }, + "fields": { + "name": "Nom", + "firstName": "Prénom", + "lastName": "Nom de Famille", + "salutationName": "Salutation", + "assignedUser": "Utilisateur Assigné", + "emailAddress": "Email", + "assignedUserName": "Nom d'Utilisateur Assigné", + "teams": "Equipes", + "createdAt": "Créé le", + "modifiedAt": "Modifié le", + "createdBy": "Créé par", + "modifiedBy": "Modifié par", + "title": "Titre", + "dateFrom": "Date de Reception", + "dateTo": "Date d'Envoi", + "autorefreshInterval": "Intervalle d'Auto-actualisation", + "displayRecords": "Afficher les Enregistrements" + }, + "links": { + "teams": "Equipes", + "users": "Utilisateurs" + }, + "dashlets": { + "Stream": "Flux" + }, + "streamMessages": { + "create": "{user} a créé {entityType} {entity}", + "createAssigned": "{user} a créé {entityType} {entity} assigné à {assignee}", + "assign": "{user} a assigné {entityType} {entity} à {assignee}", + "post": "{user} a posté sur {entityType} {entity}", + "attach": "{user} attaché à {entityType} {entity}", + "status": "{user} a mis à jour {field} sur {entityType} {entity}", + "update": "{user} a mis à jour {entityType} {entity}", + "createRelated": "{user} created {relatedEntityType} {relatedEntity} linked to {entityType} {entity}", + "emailReceived": "{entity} a été reçu pour {entityType} {entity}", + + "createThis": "{user} a créé {entityType}", + "createAssignedThis": "{user} a créé {entityType} assigné à {assignee}", + "assignThis": "{user} a assigné {entityType} à {assignee}", + "postThis": "{user} a posté", + "attachThis": "{user} a attaché", + "statusThis": "{user} a mis à jour {field}", + "updateThis": "{user} a mis à jour {entityType}", + "createRelatedThis": "{user} created {relatedEntityType} {relatedEntity} linked to this {entityType}", + "emailReceivedThis": "{entity} a été reçu" + }, + "lists": { + "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] + }, + "options": { + "salutationName": { + "Mr.": "Mr.", + "Mrs.": "Mme", + "Dr.": "Dr.", + "Drs.": "Dr." + }, + "language": { + "af_ZA": "Afrikaner", + "az_AZ": "Azerbaïdjanais", + "be_BY": "Biélorusse", + "bg_BG": "Bulgare", + "bn_IN": "Bengali", + "bs_BA": "Bosnien", + "ca_ES": "Catalan", + "cs_CZ": "Tchèque", + "cy_GB": "Gallois", + "da_DK": "Danois", + "de_DE": "Allemand", + "el_GR": "Grec", + "en_GB":"English (UK)", + "en_US":"English (US)", + "es_ES":"Spanish (Spain)", + "et_EE": "Estonien", + "eu_ES": "Basque", + "fa_IR": "Farsi", + "fi_FI": "Finlandais", + "fo_FO": "féroïen", + "fr_CA":"French (Canada)", + "fr_FR":"French (France)", + "ga_IE": "Irlandais", + "gl_ES": "Galicien", + "gn_PY": "Guarani", + "he_IL": "Hébreu", + "hi_IN": "Hindi", + "hr_HR": "Croate", + "hu_HU": "Hongrois", + "hy_AM": "Arménien", + "id_ID": "Indonésien", + "is_IS": "Islandais", + "it_IT": "Italien", + "ja_JP": "Japonais", + "ka_GE": "Georgien", + "km_KH": "Khmer", + "ko_KR": "Coréen", + "ku_TR": "Kurde", + "lt_LT": "Lithuanien", + "lv_LV": "Lettonien", + "mk_MK": "Macedonien", + "ml_IN": "Malayalam", + "ms_MY": "Malais", + "nb_NO": "Norvegien Bokmål", + "nn_NO": "Norvegien Nynorsk", + "ne_NP": "Népalais", + "nl_NL": "Néerlandais", + "pa_IN": "Pendjabi", + "pl_PL": "Polonais", + "ps_AF": "Pachtoune", + "pt_BR":"Portuguese (Brazil)", + "pt_PT":"Portuguese (Portugal)", + "ro_RO": "Roumain", + "ru_RU": "Russe", + "sk_SK": "Slovaque", + "sl_SI": "Slovène", + "sq_AL": "Albanais", + "sr_RS": "Serbe", + "sv_SE": "Suèdois", + "sw_KE": "Swahili", + "ta_IN": "Tamoul", + "te_IN": "Télougou", + "th_TH": "Thailandais", + "tl_PH": "Tagalog", + "tr_TR": "Turc", + "uk_UA": "Ucrainien", + "ur_PK": "Urdu", + "vi_VN": "Vietnamien", + "zh_CN":"Simplified Chinese (China)", + "zh_HK":"Traditional Chinese (Hong Kong)", + "zh_TW":"Traditional Chinese (Taiwan)" + }, + "dateSearchRanges": { + "on": "En Marche", + "notOn": "Arrêté", + "after": "Après", + "before": "Avant", + "between": "Entre" + }, + "intSearchRanges": { + "equals": "Egual", + "notEquals": "Différent", + "greaterThan": "Supérieur à", + "lessThan": "Inférieur à", + "greaterThanOrEquals": "Supérieur ou Egual à", + "lessThanOrEquals": "Inférieur ou Egual à", + "between": "Entre" + }, + "autorefreshInterval": { + "0": "Aucun", + "0.5": "30 secondes", + "1": "1 minute", + "2": "2 minutes", + "5": "5 minutes", + "10": "10 minutes" + } + }, + "sets": { + "summernote": { + "NOTICE": "You can find translation here: https://github.com/HackerWins/summernote/tree/master/lang", + "font":{ + "bold": "Gras", + "italic": "Italique", + "underline": "Souligné", + "strike": "Touche", + "clear": "Retirer le Style de Police", + "height": "Hauteur de Ligne", + "name": "Police de Caractère", + "size": "Taille de Police" + }, + "image":{ + "image": "Image", + "insert": "Insérer une Image", + "resizeFull": "Redimensioner à 100%", + "resizeHalf": "Redimensioner à 50%", + "resizeQuarter": "Redimensioner à 25%", + "floatLeft": "Flottant Gauche", + "floatRight": "Flottant Droit", + "floatNone": "Aucun Flottant", + "dragImageHere": "Glisser une Image ici", + "selectFromFiles": "Parcourir", + "url": "Url de l'Image", + "remove": "Supprimer l'Image" + }, + "link":{ + "link": "Lien", + "insert": "Insérer un Lien", + "unlink": "Dissocier", + "edit": "Edition", + "textToDisplay": "Texte à Afficher", + "url":"To what URL should this link go?", + "openInNewWindow": "Ouvrir dans une Nouvelle Fenêtre" + }, + "video":{ + "video": "Vidéo", + "videoLink": "Lien Vidéo", + "insert": "Insérer une Vidéo", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" + }, + "table":{ + "table": "Tableau" + }, + "hr":{ + "insert": "Insérer une Régle Horizontale" + }, + "style":{ + "style": "Style", + "normal": "Normal", + "blockquote": "Guillemet", + "pre": "Code", + "h1": "Entête 1", + "h2": "Entête 2", + "h3": "Entête 3", + "h4": "Entête 4", + "h5": "Entête 5", + "h6": "Entête 6" + }, + "lists":{ + "unordered": "Liste non Ordonnée", + "ordered": "Liste Ordonnée" + }, + "options":{ + "help": "Aide", + "fullscreen": "Plein Ecran", + "codeview": "Visualiser le Code" + }, + "paragraph":{ + "paragraph": "Paragraphe", + "outdent": "Désindenter", + "indent": "Indenter", + "left": "Aligné à Gauche", + "center": "Centré", + "right": "Aligné à Droite", + "justify": "Justifié" + }, + "color":{ + "recent": "Couleur Récente", + "more": "Plus de Couleur", + "background": "Couleur de Fond", + "foreground": "Couleur de Police", + "transparent": "Transparent", + "setTransparent": "Réglage Transparent", + "reset": "Remise à zéro", + "resetToDefault": "Réglages par défaut" + }, + "shortcut":{ + "shortcuts": "Raccourcis Clavier", + "close": "Fermer", + "textFormatting": "Mise en forme du texte", + "action": "Action", + "paragraphFormatting": "Mise en forme du Paragraphe", + "documentStyle": "Style du Document" + }, + "history":{ + "undo": "Annuler", + "redo": "Restaurer" + } + } + } } diff --git a/application/Espo/Resources/i18n/fr_FR/Note.json b/application/Espo/Resources/i18n/fr_FR/Note.json index 1aeca5f257..f4daee3542 100644 --- a/application/Espo/Resources/i18n/fr_FR/Note.json +++ b/application/Espo/Resources/i18n/fr_FR/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Poster", - "attachments": "Fichiers Joints" - } + "fields": { + "post": "Poster", + "attachments": "Fichiers Joints" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/Preferences.json b/application/Espo/Resources/i18n/fr_FR/Preferences.json index 39803fa3c8..ae69f2e710 100644 --- a/application/Espo/Resources/i18n/fr_FR/Preferences.json +++ b/application/Espo/Resources/i18n/fr_FR/Preferences.json @@ -1,32 +1,32 @@ { - "fields": { - "dateFormat": "Format de Date", - "timeFormat": "Format de l'Heure", - "timeZone": "Fuseau Horaire", - "weekStart": "Premier Jour de la Semaine", - "thousandSeparator": "Séparateur de Milliers", - "decimalMark": "Marqueur Décimal", - "defaultCurrency": "Monnaie Courante", - "currencyList": "Liste des Monnaies", - "language": "Langue", - - "smtpServer": "Serveur", - "smtpPort": "Porte", - "smtpAuth": "Authorization", - "smtpSecurity": "Sécurité", - "smtpUsername": "Nom d'utilisateur", - "emailAddress": "Email", - "smtpPassword": "Mot de Passe", - "smtpEmailAddress": "Adresse Email", - - "exportDelimiter": "Délimiteur de champs (Export)" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Dimanche", - "1": "Lundi" - } - } + "fields": { + "dateFormat": "Format de Date", + "timeFormat": "Format de l'Heure", + "timeZone": "Fuseau Horaire", + "weekStart": "Premier Jour de la Semaine", + "thousandSeparator": "Séparateur de Milliers", + "decimalMark": "Marqueur Décimal", + "defaultCurrency": "Monnaie Courante", + "currencyList": "Liste des Monnaies", + "language": "Langue", + + "smtpServer": "Serveur", + "smtpPort": "Porte", + "smtpAuth": "Authorization", + "smtpSecurity": "Sécurité", + "smtpUsername": "Nom d'utilisateur", + "emailAddress": "Email", + "smtpPassword": "Mot de Passe", + "smtpEmailAddress": "Adresse Email", + + "exportDelimiter": "Délimiteur de champs (Export)" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Dimanche", + "1": "Lundi" + } + } } diff --git a/application/Espo/Resources/i18n/fr_FR/Role.json b/application/Espo/Resources/i18n/fr_FR/Role.json index 60fbdeb829..d50ca9a967 100644 --- a/application/Espo/Resources/i18n/fr_FR/Role.json +++ b/application/Espo/Resources/i18n/fr_FR/Role.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Nom", - "roles": "Rôles" - }, - "links": { - "users": "Utilisateurs", - "teams": "Equipes" - }, - "labels": { - "Access": "Accès", - "Create Role": "Créer un rôle" - }, - "options": { - "accessList": { - "not-set": "Indéfini", - "enabled": "activé", - "disabled": "désactivé" - }, - "levelList": { - "all": "tous", - "team": "équipe", - "own": "Appartient", - "no": "non" - } - }, - "actions": { - "read": "Lire", - "edit": "Edition", - "delete": "Effacer" - } + "fields": { + "name": "Nom", + "roles": "Rôles" + }, + "links": { + "users": "Utilisateurs", + "teams": "Equipes" + }, + "labels": { + "Access": "Accès", + "Create Role": "Créer un rôle" + }, + "options": { + "accessList": { + "not-set": "Indéfini", + "enabled": "activé", + "disabled": "désactivé" + }, + "levelList": { + "all": "tous", + "team": "équipe", + "own": "Appartient", + "no": "non" + } + }, + "actions": { + "read": "Lire", + "edit": "Edition", + "delete": "Effacer" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/ScheduledJob.json b/application/Espo/Resources/i18n/fr_FR/ScheduledJob.json index 17a4138807..590e410152 100644 --- a/application/Espo/Resources/i18n/fr_FR/ScheduledJob.json +++ b/application/Espo/Resources/i18n/fr_FR/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Nom", - "status": "Statut", - "job": "Tâche", - "scheduling": "Scheduling (crontab notation)" - }, - "links": { - "log": "Journal" - }, - "labels": { - "Create ScheduledJob": "Créer une tâche planifiée" - }, - "options": { - "job": { - "CheckInboundEmails": "Vérifier les Emails Entrants", - "Cleanup": "Nettoyer" - }, - "cronSetup": { - "linux": "", - "mac": "", - "windows": "Note: Create a batch file with the following commands to run Espo Scheduled Jobs using Windows Scheduled Tasks:", - "default": "Note: Add this command to Cron Job (Scheduled Task):" - }, - "status": { - "Active": "Activer", - "Inactive": "Désactiver" - } - } + "fields": { + "name": "Nom", + "status": "Statut", + "job": "Tâche", + "scheduling": "Scheduling (crontab notation)" + }, + "links": { + "log": "Journal" + }, + "labels": { + "Create ScheduledJob": "Créer une tâche planifiée" + }, + "options": { + "job": { + "CheckInboundEmails": "Vérifier les Emails Entrants", + "Cleanup": "Nettoyer" + }, + "cronSetup": { + "linux": "", + "mac": "", + "windows": "Note: Create a batch file with the following commands to run Espo Scheduled Jobs using Windows Scheduled Tasks:", + "default": "Note: Add this command to Cron Job (Scheduled Task):" + }, + "status": { + "Active": "Activer", + "Inactive": "Désactiver" + } + } } diff --git a/application/Espo/Resources/i18n/fr_FR/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/fr_FR/ScheduledJobLogRecord.json index d1be376c8f..5682f68ab6 100644 --- a/application/Espo/Resources/i18n/fr_FR/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/fr_FR/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Statut", - "executionTime": "Temps d'Exécution" - } + "fields": { + "status": "Statut", + "executionTime": "Temps d'Exécution" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/Settings.json b/application/Espo/Resources/i18n/fr_FR/Settings.json index 12c2a910fb..3c19e36ed9 100644 --- a/application/Espo/Resources/i18n/fr_FR/Settings.json +++ b/application/Espo/Resources/i18n/fr_FR/Settings.json @@ -1,63 +1,63 @@ { - "fields": { - "useCache": "Utiliser le Cache", - "dateFormat": "Format de Date", - "timeFormat": "Format de l'Heure", - "timeZone": "Fuseau Horaire", - "weekStart": "Premier Jour de la Semaine", - "thousandSeparator": "Séparateur de Milliers", - "decimalMark": "Marqueur Décimal", - "defaultCurrency": "Monnaie Courante", - "currencyList": "Liste des Monnaies", - "language": "Langue", - - "companyLogo": "Logo de la Société", - - "smtpServer": "Serveur", - "smtpPort": "Porte", - "smtpAuth": "Authorization", - "smtpSecurity": "Sécurité", - "smtpUsername": "Nom d'utilisateur", - "emailAddress": "Email", - "smtpPassword": "Mot de Passe", - "outboundEmailFromName": "Nom de l'Expéditeur", - "outboundEmailFromAddress": "Adresse de l'Emetteur", - "outboundEmailIsShared": "Est partagé", - - "recordsPerPage": "Enregistrements par page", - "recordsPerPageSmall": "Records Per Page (Small)", - "tabList": "Tab List", - "quickCreateList": "Création Rapide de Liste", - - "exportDelimiter": "Délimiteur de champs (Export)", - - "authenticationMethod": "Methode d'Authentification", - "ldapHost": "Hôte", - "ldapPort": "Porte", - "ldapAuth": "Authorization", - "ldapUsername": "Nom d'utilisateur", - "ldapPassword": "Mot de Passe", - "ldapBindRequiresDn": "Bind Requert Nom de Domaine", - "ldapBaseDn": "Base Nom de Domaine", - "ldapAccountCanonicalForm": "Formulaire du Compte Canonique", - "ldapAccountDomainName": "Compte du Nom de Domaine", - "ldapTryUsernameSplit": "Essayer le Nom d'utilisateur séparé", - "ldapCreateEspoUser": "Créer un Utilisateur dans EspoCRM", - "ldapSecurity": "Sécurité", - "ldapUserLoginFilter": "Filtre de Connexion Utilisateur", - "ldapAccountDomainNameShort": "Compte de Nom de Domaine Court", - "ldapOptReferrals": "Opt Referrals" - }, - "options": { - "weekStart": { - "0": "Dimanche", - "1": "Lundi" - } - }, - "labels": { - "System": "Système", - "Locale": "Local", - "SMTP": "SMTP", - "Configuration": "Configuration" - } + "fields": { + "useCache": "Utiliser le Cache", + "dateFormat": "Format de Date", + "timeFormat": "Format de l'Heure", + "timeZone": "Fuseau Horaire", + "weekStart": "Premier Jour de la Semaine", + "thousandSeparator": "Séparateur de Milliers", + "decimalMark": "Marqueur Décimal", + "defaultCurrency": "Monnaie Courante", + "currencyList": "Liste des Monnaies", + "language": "Langue", + + "companyLogo": "Logo de la Société", + + "smtpServer": "Serveur", + "smtpPort": "Porte", + "smtpAuth": "Authorization", + "smtpSecurity": "Sécurité", + "smtpUsername": "Nom d'utilisateur", + "emailAddress": "Email", + "smtpPassword": "Mot de Passe", + "outboundEmailFromName": "Nom de l'Expéditeur", + "outboundEmailFromAddress": "Adresse de l'Emetteur", + "outboundEmailIsShared": "Est partagé", + + "recordsPerPage": "Enregistrements par page", + "recordsPerPageSmall": "Records Per Page (Small)", + "tabList": "Tab List", + "quickCreateList": "Création Rapide de Liste", + + "exportDelimiter": "Délimiteur de champs (Export)", + + "authenticationMethod": "Methode d'Authentification", + "ldapHost": "Hôte", + "ldapPort": "Porte", + "ldapAuth": "Authorization", + "ldapUsername": "Nom d'utilisateur", + "ldapPassword": "Mot de Passe", + "ldapBindRequiresDn": "Bind Requert Nom de Domaine", + "ldapBaseDn": "Base Nom de Domaine", + "ldapAccountCanonicalForm": "Formulaire du Compte Canonique", + "ldapAccountDomainName": "Compte du Nom de Domaine", + "ldapTryUsernameSplit": "Essayer le Nom d'utilisateur séparé", + "ldapCreateEspoUser": "Créer un Utilisateur dans EspoCRM", + "ldapSecurity": "Sécurité", + "ldapUserLoginFilter": "Filtre de Connexion Utilisateur", + "ldapAccountDomainNameShort": "Compte de Nom de Domaine Court", + "ldapOptReferrals": "Opt Referrals" + }, + "options": { + "weekStart": { + "0": "Dimanche", + "1": "Lundi" + } + }, + "labels": { + "System": "Système", + "Locale": "Local", + "SMTP": "SMTP", + "Configuration": "Configuration" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/Team.json b/application/Espo/Resources/i18n/fr_FR/Team.json index 22fe540f09..b6f8dfac28 100644 --- a/application/Espo/Resources/i18n/fr_FR/Team.json +++ b/application/Espo/Resources/i18n/fr_FR/Team.json @@ -1,12 +1,12 @@ { - "fields": { - "name": "Nom", - "roles": "Rôles" - }, - "links": { - "users": "Utilisateurs" - }, - "labels": { - "Create Team": "Créer une Equipe" - } + "fields": { + "name": "Nom", + "roles": "Rôles" + }, + "links": { + "users": "Utilisateurs" + }, + "labels": { + "Create Team": "Créer une Equipe" + } } diff --git a/application/Espo/Resources/i18n/fr_FR/User.json b/application/Espo/Resources/i18n/fr_FR/User.json index 808c0aca7c..8bec49081e 100644 --- a/application/Espo/Resources/i18n/fr_FR/User.json +++ b/application/Espo/Resources/i18n/fr_FR/User.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Nom", - "userName": "Nom d'utilisateur", - "title": "Titre", - "isAdmin": "Est Admin", - "defaultTeam": "Equipe Standard", - "emailAddress": "Email", - "phoneNumber": "Téléphone", - "roles": "Rôles", - "password": "Mot de Passe", - "passwordConfirm": "Confirmer le Mot de Passe", - "newPassword": "Nouveau Mot de Passe" - }, - "links": { - "teams": "Equipes", - "roles": "Rôles" - }, - "labels": { - "Create User": "Créer un Utilisateur", - "Generate": "Générer", - "Access": "Accès", - "Preferences": "Préférences", - "Change Password": "Changer le Mot de Passe" - }, - "messages": { - "passwordWillBeSent": "Le Mot de Passe sera envoyé à l'adresse email de l'utilisateur", - "accountInfoEmailSubject": "Information du compte", - "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", - "passwordChanged": "Mot de passe changé" - } + "fields": { + "name": "Nom", + "userName": "Nom d'utilisateur", + "title": "Titre", + "isAdmin": "Est Admin", + "defaultTeam": "Equipe Standard", + "emailAddress": "Email", + "phoneNumber": "Téléphone", + "roles": "Rôles", + "password": "Mot de Passe", + "passwordConfirm": "Confirmer le Mot de Passe", + "newPassword": "Nouveau Mot de Passe" + }, + "links": { + "teams": "Equipes", + "roles": "Rôles" + }, + "labels": { + "Create User": "Créer un Utilisateur", + "Generate": "Générer", + "Access": "Accès", + "Preferences": "Préférences", + "Change Password": "Changer le Mot de Passe" + }, + "messages": { + "passwordWillBeSent": "Le Mot de Passe sera envoyé à l'adresse email de l'utilisateur", + "accountInfoEmailSubject": "Information du compte", + "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", + "passwordChanged": "Mot de passe changé" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/Admin.json b/application/Espo/Resources/i18n/nl_NL/Admin.json index 9467cae8c8..81f03e564b 100644 --- a/application/Espo/Resources/i18n/nl_NL/Admin.json +++ b/application/Espo/Resources/i18n/nl_NL/Admin.json @@ -1,128 +1,128 @@ { - "labels": { - "Enabled": "Activeren", - "Disabled": "Uitschakelen", - "System": "Systeem", - "Users": "Gebruikers", - "Email": "Email", - "Data": "Data", - "Customization": "Aanpassing", - "Available Fields": "Beschikbare Velden", - "Layout": "Opmaak", - "Enabled": "Activeren", - "Disabled": "Uitschakelen", - "Add Panel": "Kader toevoegen", - "Add Field": "Veld toevoegen", - "Settings": "Instellingen", - "Scheduled Jobs": "Geplande Opdrachten", - "Upgrade": "Upgrade", - "Clear Cache": "Cache Opschonen", - "Rebuild": "Herbouwen", - "Users": "Gebruikers", - "Teams": "Groepen", - "Roles": "Regels", - "Outbound Emails": "Uitgaande Emails", - "Inbound Emails": "Inkomende Emails", - "Email Templates": "Email Templates", - "Import": "Importeren", - "Layout Manager": "Layout Manager", - "Field Manager": "Velden Manager", - "User Interface": "Gebruikers Interface", - "Auth Tokens": "Auth Token", - "Authentication": "Authenticatie", - "Currency": "Valuta" - }, - "layouts": { - "list": "Toon", - "detail": "Detail", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Zoek Filters", - "massUpdate": "Totale Update", - "relationships": "Relaties" - }, - "fieldTypes": { - "address": "Adres", - "array": "Array", - "foreign": "Buitenland", - "duration": "Gedurende", - "password": "Wachtwoord", - "parsonName": "Persoons Naam", - "autoincrement": "Auto-increment", - "bool": "Bool", - "currency": "Valuta", - "date": "Datum", - "datetime": "DateTime", - "email": "Email", - "enum": "Enum", - "enumInt": "Enum Integer", - "enumFloat": "Enum Float", - "float": "Drijvende komma", - "int": "Int", - "link": "Link", - "linkMultiple": "Meerdere Links", - "linkParent": "Link Parent", - "multienim": "Multienum", - "phone": "Telefoon", - "text": "Tekst", - "url": "Url", - "varchar": "Varchar", - "file": "Bestand", - "image": "Plaatje" - }, - "fields": { - "type": "Type", - "name": "Record Naam", - "label": "Eigen Veldnaam", - "required": "Nodig", - "default": "Voorkeur", - "maxLength": "Max Lengte", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Link", - "field": "Veld", - "min": "Min", - "max": "Max", - "translation": "Vertaling", - "previewSize": "Voorbeeld Maat" - }, - "messages": { - "upgradeVersion": "Uw EspoCRM wordt geupgrade naar versie {version}. Dit kan enige tijd duren.", - "upgradeDone": "Uw EspoCRM wordt geupgrade naar versie {version}. Herstart uw browser scherm.", - "upgradeBackup": "We adviseren om eerst een backup te maken van uw EspoCRM bestanden en data, alvorens te upgraden.", - "thousandSeparatorEqualsDecimalMark": "Het duizendtal scheidingsteken mag niet hetzelfde zijn als het honderdtal", - "userHasNoEmailAddress": "Gebruiker heeft geen email adres.", - "selectEntityType": "Selecteer de eenheid soort in het linker menu.", - "selectUpgradePackage": "Selecteer het upgrade pakket", - "selectLayout": "Selecteer de gewenste layout in het linker menu en pas dit aan." - }, - "descriptions": { - "settings": "Systeem instellingen van het programma.", - "scheduledJob": "Opdrachten die uitgevoerd worden door cron.", - "upgrade": "Upgrade EspoCRM.", - "clearCache": "Verwijder achtergrond cache.", - "rebuild": "Reconstrueer achtergrond en schoon het geheugen.", - "users": "Gebruikers beheer.", - "teams": "Groepen beheer.", - "roles": "Rechten beheer.", - "outboundEmails": "SMTP instellingen voor uitgaande emails.", - "inboundEmails": "Group IMAP email accouts. Email import and Email-to-Case.", - "emailTemplates": "Templates voor uitgaande emails.", - "import": "Importeer data van CSV bestand.", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Maak nieuwe of bewerk bestaande velden.", - "userInterface": "Configureer UI.", - "authTokens": "Actieve bevestigde sessie. IP adres en laatste datum.", - "authentication": "Authentication settings.", - "currency": "Currency settings and rates." - }, - "options": { - "previewSize": { - "x-small": "X-Small", - "small": "Small", - "medium": "Medium", - "large": "Large" - } - } + "labels": { + "Enabled": "Activeren", + "Disabled": "Uitschakelen", + "System": "Systeem", + "Users": "Gebruikers", + "Email": "Email", + "Data": "Data", + "Customization": "Aanpassing", + "Available Fields": "Beschikbare Velden", + "Layout": "Opmaak", + "Enabled": "Activeren", + "Disabled": "Uitschakelen", + "Add Panel": "Kader toevoegen", + "Add Field": "Veld toevoegen", + "Settings": "Instellingen", + "Scheduled Jobs": "Geplande Opdrachten", + "Upgrade": "Upgrade", + "Clear Cache": "Cache Opschonen", + "Rebuild": "Herbouwen", + "Users": "Gebruikers", + "Teams": "Groepen", + "Roles": "Regels", + "Outbound Emails": "Uitgaande Emails", + "Inbound Emails": "Inkomende Emails", + "Email Templates": "Email Templates", + "Import": "Importeren", + "Layout Manager": "Layout Manager", + "Field Manager": "Velden Manager", + "User Interface": "Gebruikers Interface", + "Auth Tokens": "Auth Token", + "Authentication": "Authenticatie", + "Currency": "Valuta" + }, + "layouts": { + "list": "Toon", + "detail": "Detail", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Zoek Filters", + "massUpdate": "Totale Update", + "relationships": "Relaties" + }, + "fieldTypes": { + "address": "Adres", + "array": "Array", + "foreign": "Buitenland", + "duration": "Gedurende", + "password": "Wachtwoord", + "parsonName": "Persoons Naam", + "autoincrement": "Auto-increment", + "bool": "Bool", + "currency": "Valuta", + "date": "Datum", + "datetime": "DateTime", + "email": "Email", + "enum": "Enum", + "enumInt": "Enum Integer", + "enumFloat": "Enum Float", + "float": "Drijvende komma", + "int": "Int", + "link": "Link", + "linkMultiple": "Meerdere Links", + "linkParent": "Link Parent", + "multienim": "Multienum", + "phone": "Telefoon", + "text": "Tekst", + "url": "Url", + "varchar": "Varchar", + "file": "Bestand", + "image": "Plaatje" + }, + "fields": { + "type": "Type", + "name": "Record Naam", + "label": "Eigen Veldnaam", + "required": "Nodig", + "default": "Voorkeur", + "maxLength": "Max Lengte", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Link", + "field": "Veld", + "min": "Min", + "max": "Max", + "translation": "Vertaling", + "previewSize": "Voorbeeld Maat" + }, + "messages": { + "upgradeVersion": "Uw EspoCRM wordt geupgrade naar versie {version}. Dit kan enige tijd duren.", + "upgradeDone": "Uw EspoCRM wordt geupgrade naar versie {version}. Herstart uw browser scherm.", + "upgradeBackup": "We adviseren om eerst een backup te maken van uw EspoCRM bestanden en data, alvorens te upgraden.", + "thousandSeparatorEqualsDecimalMark": "Het duizendtal scheidingsteken mag niet hetzelfde zijn als het honderdtal", + "userHasNoEmailAddress": "Gebruiker heeft geen email adres.", + "selectEntityType": "Selecteer de eenheid soort in het linker menu.", + "selectUpgradePackage": "Selecteer het upgrade pakket", + "selectLayout": "Selecteer de gewenste layout in het linker menu en pas dit aan." + }, + "descriptions": { + "settings": "Systeem instellingen van het programma.", + "scheduledJob": "Opdrachten die uitgevoerd worden door cron.", + "upgrade": "Upgrade EspoCRM.", + "clearCache": "Verwijder achtergrond cache.", + "rebuild": "Reconstrueer achtergrond en schoon het geheugen.", + "users": "Gebruikers beheer.", + "teams": "Groepen beheer.", + "roles": "Rechten beheer.", + "outboundEmails": "SMTP instellingen voor uitgaande emails.", + "inboundEmails": "Group IMAP email accouts. Email import and Email-to-Case.", + "emailTemplates": "Templates voor uitgaande emails.", + "import": "Importeer data van CSV bestand.", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Maak nieuwe of bewerk bestaande velden.", + "userInterface": "Configureer UI.", + "authTokens": "Actieve bevestigde sessie. IP adres en laatste datum.", + "authentication": "Authentication settings.", + "currency": "Currency settings and rates." + }, + "options": { + "previewSize": { + "x-small": "X-Small", + "small": "Small", + "medium": "Medium", + "large": "Large" + } + } } diff --git a/application/Espo/Resources/i18n/nl_NL/AuthToken.json b/application/Espo/Resources/i18n/nl_NL/AuthToken.json index 8e04b9e451..6a205421b9 100644 --- a/application/Espo/Resources/i18n/nl_NL/AuthToken.json +++ b/application/Espo/Resources/i18n/nl_NL/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "Gebruiker", - "ipAddress": "IP Adres", - "lastAccess": "Laatste toegangs datum", - "createdAt": "Login Datum" + "fields": { + "user": "Gebruiker", + "ipAddress": "IP Adres", + "lastAccess": "Laatste toegangs datum", + "createdAt": "Login Datum" - } + } } diff --git a/application/Espo/Resources/i18n/nl_NL/Email.json b/application/Espo/Resources/i18n/nl_NL/Email.json index 9e631375e7..392cc6f98a 100644 --- a/application/Espo/Resources/i18n/nl_NL/Email.json +++ b/application/Espo/Resources/i18n/nl_NL/Email.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Onderwerp", - "parent": "Behorende bij", - "status": "Status", - "dateSent": "Datum verzonden", - "from": "Van", - "to": "Naar", - "cc": "CC", - "bcc": "BCC", - "isHtml": "Is Html", - "body": "Inhoud", - "subject": "Onderwerp", - "attachments": "Bijlagen", - "selectTemplate": "Selecteer Template", - "fromEmailAddress": "Van Adres", - "toEmailAddresses": "Naar Adres", - "emailAddress": "Email Adres" - }, - "links": { - }, - "options": { - "Draft": "Tijdelijk", - "Sending": "Verzenden", - "Sent": "Verstuur", - "Archived": "Archiveren" - }, - "labels": { - "Create Email": "Archiveer Email", - "Compose": "Maak" - }, - "presetFilters": { - "sent": "Verstuur", - "archived": "Archiveren" - } + "fields": { + "name": "Onderwerp", + "parent": "Behorende bij", + "status": "Status", + "dateSent": "Datum verzonden", + "from": "Van", + "to": "Naar", + "cc": "CC", + "bcc": "BCC", + "isHtml": "Is Html", + "body": "Inhoud", + "subject": "Onderwerp", + "attachments": "Bijlagen", + "selectTemplate": "Selecteer Template", + "fromEmailAddress": "Van Adres", + "toEmailAddresses": "Naar Adres", + "emailAddress": "Email Adres" + }, + "links": { + }, + "options": { + "Draft": "Tijdelijk", + "Sending": "Verzenden", + "Sent": "Verstuur", + "Archived": "Archiveren" + }, + "labels": { + "Create Email": "Archiveer Email", + "Compose": "Maak" + }, + "presetFilters": { + "sent": "Verstuur", + "archived": "Archiveren" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/EmailAddress.json b/application/Espo/Resources/i18n/nl_NL/EmailAddress.json index b26a90083a..f37566b336 100644 --- a/application/Espo/Resources/i18n/nl_NL/EmailAddress.json +++ b/application/Espo/Resources/i18n/nl_NL/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Primair", - "Opted Out": "Opted Out", - "Invalid": "Onjuist" - } + "labels": { + "Primary": "Primair", + "Opted Out": "Opted Out", + "Invalid": "Onjuist" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/EmailTemplate.json b/application/Espo/Resources/i18n/nl_NL/EmailTemplate.json index feedcd4000..434760585a 100644 --- a/application/Espo/Resources/i18n/nl_NL/EmailTemplate.json +++ b/application/Espo/Resources/i18n/nl_NL/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Record Naam", - "status": "Status", - "isHtml": "Is Html", - "body": "Inhoud", - "subject": "Onderwerp", - "attachments": "Bijlagen", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Maak Email Template" - } + "fields": { + "name": "Record Naam", + "status": "Status", + "isHtml": "Is Html", + "body": "Inhoud", + "subject": "Onderwerp", + "attachments": "Bijlagen", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Maak Email Template" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/Global.json b/application/Espo/Resources/i18n/nl_NL/Global.json index b237ab66ba..f1d2e9c625 100644 --- a/application/Espo/Resources/i18n/nl_NL/Global.json +++ b/application/Espo/Resources/i18n/nl_NL/Global.json @@ -1,420 +1,420 @@ { - "scopeNames": { - "Email": "Email", - "User": "Gebruiker", - "Team": "Team", - "Role": "Voorwaarde", - "EmailTemplate": "Email Template", - "OutboundEmail": "Uitgaande Email", - "ScheduledJob": "Geplande Opdracht" - }, - "scopeNamesPlural": { - "Email": "Emails", - "User": "Gebruikers", - "Team": "Groepen", - "Role": "Regels", - "EmailTemplate": "Email Templates", - "OutboundEmail": "Uitgaande Emails", - "ScheduledJob": "Geplande Opdrachten" - }, - "labels": { - "Misc": "Versch.", - "Merge": "Samenvoegen", - "None": "Geen", - "by": "door", - "Saved": "Opgeslagen", - "Error": "Fout", - "Select": "Selecteer", - "Not valid": "Niet juist", - "Please wait...": "Even geduld...", - "Please wait": "Even geduld", - "Loading...": "Laden...", - "Uploading...": "Uploaden...", - "Sending...": "Verzenden...", - "Removed": "Verwijderd", - "Posted": "Geplaatst", - "Linked": "Linked", - "Unlinked": "Unlinked", - "Access denied": "Verboden toegang", - "Access": "Rechten", - "Are you sure?": "Are you sure?", - "Record has been removed": "Record is verwijderd", - "Wrong username/password": "Verkeerde gebruikersnaam/wachtwoord", - "Post cannot be empty": "Veld kan niet leeg zijn", - "Removing...": "Verwijderen...", - "Unlinking...": "Unlinken...", - "Posting...": "Plaatsen...", - "Username can not be empty!": "Gebruikersnaam kan niet leeg zijn!", - "Cache is not enabled": "Cache is niet geactiveerd", - "Cache has been cleared": "Cache is leeg gemaakt", - "Rebuild has been done": "Het reconstrueren is klaar", - "Saving...": "Opslaan...", - "Modified": "Aangepast", - "Created": "Gemaakt", - "Create": "Maak", - "create": "maak", - "Overview": "Overzicht", - "Details": "Details", - "Add Filter": "Maak Filter", - "Add Dashlet": "Dashlet Toevoegen", - "Add": "Toevoegen", - "Reset": "Reset", - "Menu": "Menu", - "More": "Meer", - "Search": "Zoeken", - "Only My": "Ik Alleen ", - "Open": "Open", - "Admin": "Admin", - "About": "Over", - "Refresh": "Verversen", - "Remove": "Verwijderen", - "Options": "Opties", - "Username": "Gebruikersnaam", - "Password": "Wachtwoord", - "Login": "Login", - "Log Out": "Uitloggen", - "Preferences": "Voorkeuren", - "State": "Deelstaat", - "Street": "Straat", - "Country": "Land", - "City": "Plaats", - "PostalCode": "Postcode", - "Followed": "Gevolgd", - "Follow": "Volgen", - "Clear Local Cache": "Lokale Cache Schonen", - "Actions": "Acties", - "Delete": "Verwijder", - "Update": "Update", - "Save": "Opslaan", - "Edit": "Aanpassen", - "Cancel": "Annuleren", - "Unlink": "Unlink", - "Mass Update": "Totale Update", - "Export": "Exporteer", - "No Data": "Geen Data", - "All": "Alles", - "Active": "Active", - "Inactive": "Inactive", - "Write your comment here": "Schrijf hier uw opmerkingen", - "Post": "Plaats", - "Stream": "Activiteiten", - "Show more": "Meer tonen", - "Dashlet Options": "Kader opties", - "Full Form": "Volledig Formulier", - "Insert": "Voeg in", - "Person": "Persoon", - "First Name": "Voornaam", - "Last Name": "Achternaam", - "Original": "Origineel", - "You": "U", - "you": "u", - "change": "Pas aan", - "Primary": "Primair", - "Save Filters": "Filters opslaan", - "Administration": "Administratie", - "Run Import": "Start Import", - "Duplicate": "Dupliceer", - "Notifications": "Notificaties", - "Mark all read": "Mark all read", - "See more": "See more" - }, - "messages": { - "notModified": "U heeft het veld niet aangepast", - "duplicate": "Het veld dat u maakt lijkt een duplicaat", - "fieldIsRequired": "{field} is nodig", - "fieldShouldBeEmail": "{field} moet een geldend mailadres zijn", - "fieldShouldBeFloat": "{field} moet een geldende 'float'waarde zijn", - "fieldShouldBeInt": "{field} moet een geldende integer waarde zijn", - "fieldShouldBeDate": "{field} moet een geldende datum zijn", - "fieldShouldBeDatetime": "{field} moet een geldende datum/tijd zijn", - "fieldShouldAfter": "{field} moet na {otherField} zijn", - "fieldShouldBefore": "{field} moet voor {otherField} zijn", - "fieldShouldBeBetween": "{field} moet tussen {min} en {max}", - "fieldShouldBeLess": "{field} moet minder zijn dan {value}", - "fieldShouldBeGreater": "{field} moet groter zijn dan {value}", - "fieldBadPasswordConfirm": "{field} onjuist bevestigd", - "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", - "assignmentEmailNotificationBody": "{assignerUserName} has assigned {entityType} '{Entity.name}' to you\n\n{recordUrl}", - "confirmation": "Are you sure?", - "removeRecordConfirmation": "Are you sure you want to remove the record?", - "unlinkRecordConfirmation": "Are you sure you want to unlink relationship?", - "removeSelectedRecordsConfirmation": "Are you sure you want to remove selected records?" - }, - "boolFilters": { - "onlyMy": "Ik Alleen ", - "open": "Open", - "active": "Active" - }, - "fields": { - "name": "Record Naam", - "firstName": "Voornaam", - "lastName": "Achternaam", - "salutationName": "Groeten", - "assignedUser": "Toegewezen Gebruiker", - "emailAddress": "Email", - "assignedUserName": "Toegewezen Gebruikers Naam", - "teams": "Groepen", - "createdAt": "Gemaakt op", - "modifiedAt": "Aangepast op", - "createdBy": "Gemaakt door", - "modifiedBy": "Aangepast door", - "title": "Titel", - "dateFrom": "Datum Vanaf", - "dateTo": "Datum Tot", - "autorefreshInterval": "Auto-herstel Interval", - "displayRecords": "Toon velden" - }, - "links": { - "teams": "Groepen", - "users": "Gebruikers" - }, - "dashlets": { - "Stream": "Activiteiten" - }, - "streamMessages": { - "create": "{user} maakte {entityType} {entity}", - "createAssigned": "{user} maakte {entityType} {entity} toegewezen aan {assignee}", - "assign": "{user} toegewezen {entityType} {entity} aan {assignee}", - "post": "{user} ingevoerd op {entityType} {entity}", - "attach": "{user} toegevoegd aan {entityType} {entity}", - "status": "{user} paste {field} aan op {entityType} {entity}", - "update": "{user} paste {entityType} {entity} aan", - "createRelated": "{user} maakte {relatedEntityType} {relatedEntity} gekoppeld aan {entityType} {entity}", - "emailReceived": "{entity} is ontvangen voor {entityType} {entity}", - - "createThis": "{user} maakte dit {entityType}", - "createAssignedThis": "{user} maakte dit {entityType} toegewezen aan {assignee}", - "assignThis": "{user} wees dit {entityType} toe aan {assignee}", - "postThis": "{user} gepost", - "attachThis": "{user} toegevoegd", - "statusThis": "{user} paste {field} aan", - "updateThis": "{user} paste dit {entityType} aan", - "createRelatedThis": "{user} maakte {relatedEntityType} {relatedEntity} en koppelde dit aan {entityType}", - "emailReceivedThis": "{entity} is ontvangen" - }, - "lists": { - "monthNames": ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], - "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], - "dayNames": ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], - "dayNamesShort": ["Zon", "Maa", "Din", "Woe", "Don", "Vrij", "Zat"], - "dayNamesMin": ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] - }, - "options": { - "salutationName": { - "Mr.": "Dhr.", - "Mrs.": "Mevr.", - "Dr.": "Dr.", - "Drs.": "Drs." - }, - "language": { - "af_ZA": "Afrikaans", - "az_AZ": "Azerbeidzjaans", - "be_BY": "Wit-Russisch", - "bg_BG": "Bulgaars", - "bn_IN": "Bengaals", - "bs_BA": "Bosnisch", - "ca_ES": "Catalaans", - "cs_CZ": "Tsjechisch", - "cy_GB": "Wels", - "da_DK": "Deens", - "de_DE": "Duits", - "el_GR": "Grieks", - "en_GB":"English (UK)", - "en_US":"English (US)", - "es_ES":"Spanish (Spain)", - "et_EE": "Estlands", - "eu_ES": "Baskisch", - "fa_IR": "Perzisch", - "fi_FI": "Fins", - "fo_FO": "Faroese", - "fr_CA":"French (Canada)", - "fr_FR":"French (France)", - "ga_IE": "Iers", - "gl_ES": "Galicisch", - "gn_PY": "Guarani", - "he_IL": "Hebreeuws", - "hi_IN": "Hindies", - "hr_HR": "Kroatisch", - "hu_HU": "Hungaars", - "hy_AM": "Armeens", - "id_ID": "Indonesisch", - "is_IS": "IJSlands", - "it_IT": "Italiaans", - "ja_JP": "Japans", - "ka_GE": "Georgisch", - "km_KH": "Khmer", - "ko_KR": "Koreans", - "ku_TR": "Koerdisch", - "lt_LT": "Litouws", - "lv_LV": "Lets", - "mk_MK": "Macedonisch", - "ml_IN": "Malayalam", - "ms_MY": "Maleis", - "nb_NO": "Noorse Bokmål", - "nn_NO": "Noorse Nynorsk", - "ne_NP": "Nepalees", - "nl_NL": "Nederlands", - "pa_IN": "Punjabi", - "pl_PL": "Pools", - "ps_AF": "Pasjtoe", - "pt_BR":"Portuguese (Brazil)", - "pt_PT":"Portuguese (Portugal)", - "ro_RO": "Roemeens", - "ru_RU": "Russisch", - "sk_SK": "Slowaaks", - "sl_SI": "Sloveens", - "sq_AL": "Albanees", - "sr_RS": "Servisch", - "sv_SE": "Zweeds", - "sw_KE": "Swahili", - "ta_IN": "Tamil", - "te_IN": "Telugu", - "th_TH": "Thais", - "tl_PH": "Tagalog", - "tr_TR": "Turks", - "uk_UA": "Oekraïens", - "ur_PK": "Urdu", - "vi_VN": "Viëtnamees", - "zh_CN":"Simplified Chinese (China)", - "zh_HK":"Traditional Chinese (Hong Kong)", - "zh_TW":"Traditional Chinese (Taiwan)" - }, - "dateSearchRanges": { - "on": "Op", - "notOn": "Niet op", - "after": "Na", - "before": "Voor", - "between": "Tussen", - "today": "Vandaag", - "past": "Verleden", - "future": "Toekomst" - }, - "intSearchRanges": { - "equals": "Gelijk", - "notEquals": "Ongelijk", - "greaterThan": "Groter dan", - "lessThan": "Minder dan", - "greaterThanOrEquals": "Groter dan of gelijk", - "lessThanOrEquals": "Minder dan of gelijk", - "between": "Tussen" - }, - "autorefreshInterval": { - "0": "Geen", - "0.5": "30 seconden", - "1": "1 minuut", - "2": "2 minuten", - "5": "5 minuten", - "10": "10 minuten" - }, - "phoneNumber": { - "Mobile": "Mobiel", - "Office": "Kantoor", - "Fax": "Fax", - "Home": "Prive", - "Other": "Ander" - } - }, - "sets": { - "summernote": { - "NOTICE": "U kunt hier de vertaling vinden: https://github.com/xx", - "font":{ - "bold": "Vet", - "italic": "Italic", - "underline": "Onderstreept", - "strike": "Opvallend", - "clear": "Verwijder text Font", - "height": "Lijn Hoogte", - "name": "Font Familie", - "size": "Font Grootte" - }, - "image":{ - "image": "PLaatje", - "insert": "Plaatje invoegen", - "resizeFull": "Volledig schalen", - "resizeHalf": "Helft verschalen", - "resizeQuarter": "Een kwart verschalen", - "floatLeft": "Float Left", - "floatRight": "Float Right", - "floatNone": "Float None", - "dragImageHere": "Plaatje naar hier verslepen", - "selectFromFiles": "Selecteer vanuit bestanden", - "url": "URL plaatje", - "remove": "Verwijder plaatje" - }, - "link":{ - "link": "Link", - "insert": "Koppeling invoegen", - "unlink": "Unlink", - "edit": "Aanpassen", - "textToDisplay": "Toon de tekst", - "url":"To what URL should this link go?", - "openInNewWindow": "In een nieuw scherm openen" - }, - "video":{ - "video": "Video", - "videoLink": "Video Link", - "insert": "Video toevoegen", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" - }, - "table":{ - "table": "Tabel" - }, - "hr":{ - "insert": "Horizontale Regel toevoegen" - }, - "style":{ - "style": "Stijl", - "normal": "Normaal", - "blockquote": "Aanhaling", - "pre": "Code", - "h1": "Header 1", - "h2": "Header 2", - "h3": "Header 3", - "h4": "Header 4", - "h5": "Header 5", - "h6": "Header 6" - }, - "lists":{ - "unordered": "Ongesorteerde lijst", - "ordered": "Gesorteerde lijst" - }, - "options":{ - "help": "Help", - "fullscreen": "Volledig scherm", - "codeview": "Code View" - }, - "paragraph":{ - "paragraph": "Hoofdstuk", - "outdent": "Outdent", - "indent": "Indent", - "left": "Align left", - "center": "Align center", - "right": "Align right", - "justify": "Justify full" - }, - "color":{ - "recent": "Recent Color", - "more": "More Color", - "background": "BackColor", - "foreground": "FontColor", - "transparent": "Transparent", - "setTransparent": "Set transparent", - "reset": "Reset", - "resetToDefault": "Reset to default" - }, - "shortcut":{ - "shortcuts": "Keyboard shortcuts", - "close": "Close", - "textFormatting": "Text formatting", - "action": "Action", - "paragraphFormatting": "Paragraph formatting", - "documentStyle": "Document Style" - }, - "history":{ - "undo": "Undo", - "redo": "Redo" - } - } - } + "scopeNames": { + "Email": "Email", + "User": "Gebruiker", + "Team": "Team", + "Role": "Voorwaarde", + "EmailTemplate": "Email Template", + "OutboundEmail": "Uitgaande Email", + "ScheduledJob": "Geplande Opdracht" + }, + "scopeNamesPlural": { + "Email": "Emails", + "User": "Gebruikers", + "Team": "Groepen", + "Role": "Regels", + "EmailTemplate": "Email Templates", + "OutboundEmail": "Uitgaande Emails", + "ScheduledJob": "Geplande Opdrachten" + }, + "labels": { + "Misc": "Versch.", + "Merge": "Samenvoegen", + "None": "Geen", + "by": "door", + "Saved": "Opgeslagen", + "Error": "Fout", + "Select": "Selecteer", + "Not valid": "Niet juist", + "Please wait...": "Even geduld...", + "Please wait": "Even geduld", + "Loading...": "Laden...", + "Uploading...": "Uploaden...", + "Sending...": "Verzenden...", + "Removed": "Verwijderd", + "Posted": "Geplaatst", + "Linked": "Linked", + "Unlinked": "Unlinked", + "Access denied": "Verboden toegang", + "Access": "Rechten", + "Are you sure?": "Are you sure?", + "Record has been removed": "Record is verwijderd", + "Wrong username/password": "Verkeerde gebruikersnaam/wachtwoord", + "Post cannot be empty": "Veld kan niet leeg zijn", + "Removing...": "Verwijderen...", + "Unlinking...": "Unlinken...", + "Posting...": "Plaatsen...", + "Username can not be empty!": "Gebruikersnaam kan niet leeg zijn!", + "Cache is not enabled": "Cache is niet geactiveerd", + "Cache has been cleared": "Cache is leeg gemaakt", + "Rebuild has been done": "Het reconstrueren is klaar", + "Saving...": "Opslaan...", + "Modified": "Aangepast", + "Created": "Gemaakt", + "Create": "Maak", + "create": "maak", + "Overview": "Overzicht", + "Details": "Details", + "Add Filter": "Maak Filter", + "Add Dashlet": "Dashlet Toevoegen", + "Add": "Toevoegen", + "Reset": "Reset", + "Menu": "Menu", + "More": "Meer", + "Search": "Zoeken", + "Only My": "Ik Alleen ", + "Open": "Open", + "Admin": "Admin", + "About": "Over", + "Refresh": "Verversen", + "Remove": "Verwijderen", + "Options": "Opties", + "Username": "Gebruikersnaam", + "Password": "Wachtwoord", + "Login": "Login", + "Log Out": "Uitloggen", + "Preferences": "Voorkeuren", + "State": "Deelstaat", + "Street": "Straat", + "Country": "Land", + "City": "Plaats", + "PostalCode": "Postcode", + "Followed": "Gevolgd", + "Follow": "Volgen", + "Clear Local Cache": "Lokale Cache Schonen", + "Actions": "Acties", + "Delete": "Verwijder", + "Update": "Update", + "Save": "Opslaan", + "Edit": "Aanpassen", + "Cancel": "Annuleren", + "Unlink": "Unlink", + "Mass Update": "Totale Update", + "Export": "Exporteer", + "No Data": "Geen Data", + "All": "Alles", + "Active": "Active", + "Inactive": "Inactive", + "Write your comment here": "Schrijf hier uw opmerkingen", + "Post": "Plaats", + "Stream": "Activiteiten", + "Show more": "Meer tonen", + "Dashlet Options": "Kader opties", + "Full Form": "Volledig Formulier", + "Insert": "Voeg in", + "Person": "Persoon", + "First Name": "Voornaam", + "Last Name": "Achternaam", + "Original": "Origineel", + "You": "U", + "you": "u", + "change": "Pas aan", + "Primary": "Primair", + "Save Filters": "Filters opslaan", + "Administration": "Administratie", + "Run Import": "Start Import", + "Duplicate": "Dupliceer", + "Notifications": "Notificaties", + "Mark all read": "Mark all read", + "See more": "See more" + }, + "messages": { + "notModified": "U heeft het veld niet aangepast", + "duplicate": "Het veld dat u maakt lijkt een duplicaat", + "fieldIsRequired": "{field} is nodig", + "fieldShouldBeEmail": "{field} moet een geldend mailadres zijn", + "fieldShouldBeFloat": "{field} moet een geldende 'float'waarde zijn", + "fieldShouldBeInt": "{field} moet een geldende integer waarde zijn", + "fieldShouldBeDate": "{field} moet een geldende datum zijn", + "fieldShouldBeDatetime": "{field} moet een geldende datum/tijd zijn", + "fieldShouldAfter": "{field} moet na {otherField} zijn", + "fieldShouldBefore": "{field} moet voor {otherField} zijn", + "fieldShouldBeBetween": "{field} moet tussen {min} en {max}", + "fieldShouldBeLess": "{field} moet minder zijn dan {value}", + "fieldShouldBeGreater": "{field} moet groter zijn dan {value}", + "fieldBadPasswordConfirm": "{field} onjuist bevestigd", + "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", + "assignmentEmailNotificationBody": "{assignerUserName} has assigned {entityType} '{Entity.name}' to you\n\n{recordUrl}", + "confirmation": "Are you sure?", + "removeRecordConfirmation": "Are you sure you want to remove the record?", + "unlinkRecordConfirmation": "Are you sure you want to unlink relationship?", + "removeSelectedRecordsConfirmation": "Are you sure you want to remove selected records?" + }, + "boolFilters": { + "onlyMy": "Ik Alleen ", + "open": "Open", + "active": "Active" + }, + "fields": { + "name": "Record Naam", + "firstName": "Voornaam", + "lastName": "Achternaam", + "salutationName": "Groeten", + "assignedUser": "Toegewezen Gebruiker", + "emailAddress": "Email", + "assignedUserName": "Toegewezen Gebruikers Naam", + "teams": "Groepen", + "createdAt": "Gemaakt op", + "modifiedAt": "Aangepast op", + "createdBy": "Gemaakt door", + "modifiedBy": "Aangepast door", + "title": "Titel", + "dateFrom": "Datum Vanaf", + "dateTo": "Datum Tot", + "autorefreshInterval": "Auto-herstel Interval", + "displayRecords": "Toon velden" + }, + "links": { + "teams": "Groepen", + "users": "Gebruikers" + }, + "dashlets": { + "Stream": "Activiteiten" + }, + "streamMessages": { + "create": "{user} maakte {entityType} {entity}", + "createAssigned": "{user} maakte {entityType} {entity} toegewezen aan {assignee}", + "assign": "{user} toegewezen {entityType} {entity} aan {assignee}", + "post": "{user} ingevoerd op {entityType} {entity}", + "attach": "{user} toegevoegd aan {entityType} {entity}", + "status": "{user} paste {field} aan op {entityType} {entity}", + "update": "{user} paste {entityType} {entity} aan", + "createRelated": "{user} maakte {relatedEntityType} {relatedEntity} gekoppeld aan {entityType} {entity}", + "emailReceived": "{entity} is ontvangen voor {entityType} {entity}", + + "createThis": "{user} maakte dit {entityType}", + "createAssignedThis": "{user} maakte dit {entityType} toegewezen aan {assignee}", + "assignThis": "{user} wees dit {entityType} toe aan {assignee}", + "postThis": "{user} gepost", + "attachThis": "{user} toegevoegd", + "statusThis": "{user} paste {field} aan", + "updateThis": "{user} paste dit {entityType} aan", + "createRelatedThis": "{user} maakte {relatedEntityType} {relatedEntity} en koppelde dit aan {entityType}", + "emailReceivedThis": "{entity} is ontvangen" + }, + "lists": { + "monthNames": ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], + "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], + "dayNames": ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], + "dayNamesShort": ["Zon", "Maa", "Din", "Woe", "Don", "Vrij", "Zat"], + "dayNamesMin": ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] + }, + "options": { + "salutationName": { + "Mr.": "Dhr.", + "Mrs.": "Mevr.", + "Dr.": "Dr.", + "Drs.": "Drs." + }, + "language": { + "af_ZA": "Afrikaans", + "az_AZ": "Azerbeidzjaans", + "be_BY": "Wit-Russisch", + "bg_BG": "Bulgaars", + "bn_IN": "Bengaals", + "bs_BA": "Bosnisch", + "ca_ES": "Catalaans", + "cs_CZ": "Tsjechisch", + "cy_GB": "Wels", + "da_DK": "Deens", + "de_DE": "Duits", + "el_GR": "Grieks", + "en_GB":"English (UK)", + "en_US":"English (US)", + "es_ES":"Spanish (Spain)", + "et_EE": "Estlands", + "eu_ES": "Baskisch", + "fa_IR": "Perzisch", + "fi_FI": "Fins", + "fo_FO": "Faroese", + "fr_CA":"French (Canada)", + "fr_FR":"French (France)", + "ga_IE": "Iers", + "gl_ES": "Galicisch", + "gn_PY": "Guarani", + "he_IL": "Hebreeuws", + "hi_IN": "Hindies", + "hr_HR": "Kroatisch", + "hu_HU": "Hungaars", + "hy_AM": "Armeens", + "id_ID": "Indonesisch", + "is_IS": "IJSlands", + "it_IT": "Italiaans", + "ja_JP": "Japans", + "ka_GE": "Georgisch", + "km_KH": "Khmer", + "ko_KR": "Koreans", + "ku_TR": "Koerdisch", + "lt_LT": "Litouws", + "lv_LV": "Lets", + "mk_MK": "Macedonisch", + "ml_IN": "Malayalam", + "ms_MY": "Maleis", + "nb_NO": "Noorse Bokmål", + "nn_NO": "Noorse Nynorsk", + "ne_NP": "Nepalees", + "nl_NL": "Nederlands", + "pa_IN": "Punjabi", + "pl_PL": "Pools", + "ps_AF": "Pasjtoe", + "pt_BR":"Portuguese (Brazil)", + "pt_PT":"Portuguese (Portugal)", + "ro_RO": "Roemeens", + "ru_RU": "Russisch", + "sk_SK": "Slowaaks", + "sl_SI": "Sloveens", + "sq_AL": "Albanees", + "sr_RS": "Servisch", + "sv_SE": "Zweeds", + "sw_KE": "Swahili", + "ta_IN": "Tamil", + "te_IN": "Telugu", + "th_TH": "Thais", + "tl_PH": "Tagalog", + "tr_TR": "Turks", + "uk_UA": "Oekraïens", + "ur_PK": "Urdu", + "vi_VN": "Viëtnamees", + "zh_CN":"Simplified Chinese (China)", + "zh_HK":"Traditional Chinese (Hong Kong)", + "zh_TW":"Traditional Chinese (Taiwan)" + }, + "dateSearchRanges": { + "on": "Op", + "notOn": "Niet op", + "after": "Na", + "before": "Voor", + "between": "Tussen", + "today": "Vandaag", + "past": "Verleden", + "future": "Toekomst" + }, + "intSearchRanges": { + "equals": "Gelijk", + "notEquals": "Ongelijk", + "greaterThan": "Groter dan", + "lessThan": "Minder dan", + "greaterThanOrEquals": "Groter dan of gelijk", + "lessThanOrEquals": "Minder dan of gelijk", + "between": "Tussen" + }, + "autorefreshInterval": { + "0": "Geen", + "0.5": "30 seconden", + "1": "1 minuut", + "2": "2 minuten", + "5": "5 minuten", + "10": "10 minuten" + }, + "phoneNumber": { + "Mobile": "Mobiel", + "Office": "Kantoor", + "Fax": "Fax", + "Home": "Prive", + "Other": "Ander" + } + }, + "sets": { + "summernote": { + "NOTICE": "U kunt hier de vertaling vinden: https://github.com/xx", + "font":{ + "bold": "Vet", + "italic": "Italic", + "underline": "Onderstreept", + "strike": "Opvallend", + "clear": "Verwijder text Font", + "height": "Lijn Hoogte", + "name": "Font Familie", + "size": "Font Grootte" + }, + "image":{ + "image": "PLaatje", + "insert": "Plaatje invoegen", + "resizeFull": "Volledig schalen", + "resizeHalf": "Helft verschalen", + "resizeQuarter": "Een kwart verschalen", + "floatLeft": "Float Left", + "floatRight": "Float Right", + "floatNone": "Float None", + "dragImageHere": "Plaatje naar hier verslepen", + "selectFromFiles": "Selecteer vanuit bestanden", + "url": "URL plaatje", + "remove": "Verwijder plaatje" + }, + "link":{ + "link": "Link", + "insert": "Koppeling invoegen", + "unlink": "Unlink", + "edit": "Aanpassen", + "textToDisplay": "Toon de tekst", + "url":"To what URL should this link go?", + "openInNewWindow": "In een nieuw scherm openen" + }, + "video":{ + "video": "Video", + "videoLink": "Video Link", + "insert": "Video toevoegen", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" + }, + "table":{ + "table": "Tabel" + }, + "hr":{ + "insert": "Horizontale Regel toevoegen" + }, + "style":{ + "style": "Stijl", + "normal": "Normaal", + "blockquote": "Aanhaling", + "pre": "Code", + "h1": "Header 1", + "h2": "Header 2", + "h3": "Header 3", + "h4": "Header 4", + "h5": "Header 5", + "h6": "Header 6" + }, + "lists":{ + "unordered": "Ongesorteerde lijst", + "ordered": "Gesorteerde lijst" + }, + "options":{ + "help": "Help", + "fullscreen": "Volledig scherm", + "codeview": "Code View" + }, + "paragraph":{ + "paragraph": "Hoofdstuk", + "outdent": "Outdent", + "indent": "Indent", + "left": "Align left", + "center": "Align center", + "right": "Align right", + "justify": "Justify full" + }, + "color":{ + "recent": "Recent Color", + "more": "More Color", + "background": "BackColor", + "foreground": "FontColor", + "transparent": "Transparent", + "setTransparent": "Set transparent", + "reset": "Reset", + "resetToDefault": "Reset to default" + }, + "shortcut":{ + "shortcuts": "Keyboard shortcuts", + "close": "Close", + "textFormatting": "Text formatting", + "action": "Action", + "paragraphFormatting": "Paragraph formatting", + "documentStyle": "Document Style" + }, + "history":{ + "undo": "Undo", + "redo": "Redo" + } + } + } } diff --git a/application/Espo/Resources/i18n/nl_NL/Note.json b/application/Espo/Resources/i18n/nl_NL/Note.json index 0c8be8d3e3..1ad66321f1 100644 --- a/application/Espo/Resources/i18n/nl_NL/Note.json +++ b/application/Espo/Resources/i18n/nl_NL/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Plaats", - "attachments": "Bijlagen" - } + "fields": { + "post": "Plaats", + "attachments": "Bijlagen" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/Preferences.json b/application/Espo/Resources/i18n/nl_NL/Preferences.json index 0c0b78deaa..70ccc9fb5d 100644 --- a/application/Espo/Resources/i18n/nl_NL/Preferences.json +++ b/application/Espo/Resources/i18n/nl_NL/Preferences.json @@ -1,37 +1,37 @@ { - "fields": { - "dateFormat": "Datum notatie", - "timeFormat": "Tijdnotatie", - "timeZone": "Tijd Zone", - "weekStart": "Eerste dag van de Week", - "thousandSeparator": "Duizendtal scheidingsteken", - "decimalMark": "Duizendtal scheidingsteken", - "defaultCurrency": "Voorkeur Valuta", - "currencyList": "Valuta Lijst", - "language": "Taal", - - "smtpServer": "Server", - "smtpPort": "Poort", - "smtpAuth": "Authenticatie", - "smtpSecurity": "Veiligheid", - "smtpUsername": "Gebruikersnaam", - "emailAddress": "Email", - "smtpPassword": "Wachtwoord", - "smtpEmailAddress": "Email Adres", - - "exportDelimiter": "Scheidingsteken Export", - - "receiveAssignmentEmailNotifications": "Receive Email Notifications upon Assignment" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Zondag", - "1": "Maandag" - } - }, - "labels": { - "Notifications": "Notificaties" - } + "fields": { + "dateFormat": "Datum notatie", + "timeFormat": "Tijdnotatie", + "timeZone": "Tijd Zone", + "weekStart": "Eerste dag van de Week", + "thousandSeparator": "Duizendtal scheidingsteken", + "decimalMark": "Duizendtal scheidingsteken", + "defaultCurrency": "Voorkeur Valuta", + "currencyList": "Valuta Lijst", + "language": "Taal", + + "smtpServer": "Server", + "smtpPort": "Poort", + "smtpAuth": "Authenticatie", + "smtpSecurity": "Veiligheid", + "smtpUsername": "Gebruikersnaam", + "emailAddress": "Email", + "smtpPassword": "Wachtwoord", + "smtpEmailAddress": "Email Adres", + + "exportDelimiter": "Scheidingsteken Export", + + "receiveAssignmentEmailNotifications": "Receive Email Notifications upon Assignment" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Zondag", + "1": "Maandag" + } + }, + "labels": { + "Notifications": "Notificaties" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/Role.json b/application/Espo/Resources/i18n/nl_NL/Role.json index 9c5885e0b1..be66029fda 100644 --- a/application/Espo/Resources/i18n/nl_NL/Role.json +++ b/application/Espo/Resources/i18n/nl_NL/Role.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Record Naam", - "roles": "Regels" - }, - "links": { - "users": "Gebruikers", - "teams": "Groepen" - }, - "labels": { - "Access": "Rechten", - "Create Role": "Maak Voorwaarde" - }, - "options": { - "accessList": { - "not-set": "niet-actief", - "enabled": "ingeschakeld", - "disabled": "uitgeschakeld" - }, - "levelList": { - "all": "allemaal", - "team": "team", - "own": "eigen", - "no": "nee" - } - }, - "actions": { - "read": "Lees", - "edit": "Aanpassen", - "delete": "Verwijder" - }, - "messages": { - "changesAfterClearCache": "All changes in an access control will be applied after cache will be cleared." - } + "fields": { + "name": "Record Naam", + "roles": "Regels" + }, + "links": { + "users": "Gebruikers", + "teams": "Groepen" + }, + "labels": { + "Access": "Rechten", + "Create Role": "Maak Voorwaarde" + }, + "options": { + "accessList": { + "not-set": "niet-actief", + "enabled": "ingeschakeld", + "disabled": "uitgeschakeld" + }, + "levelList": { + "all": "allemaal", + "team": "team", + "own": "eigen", + "no": "nee" + } + }, + "actions": { + "read": "Lees", + "edit": "Aanpassen", + "delete": "Verwijder" + }, + "messages": { + "changesAfterClearCache": "All changes in an access control will be applied after cache will be cleared." + } } diff --git a/application/Espo/Resources/i18n/nl_NL/ScheduledJob.json b/application/Espo/Resources/i18n/nl_NL/ScheduledJob.json index 07b5d322e0..a2df22c0dc 100644 --- a/application/Espo/Resources/i18n/nl_NL/ScheduledJob.json +++ b/application/Espo/Resources/i18n/nl_NL/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Record Naam", - "status": "Status", - "job": "Opdracht", - "scheduling": "Scheduling (crontab notation)" - }, - "links": { - "log": "Log" - }, - "labels": { - "Create ScheduledJob": "Maak Geplande Opdracht" - }, - "options": { - "job": { - "CheckInboundEmails": "Controleer Binnenkomende Emails", - "Cleanup": "Opschonen" - }, - "cronSetup": { - "linux": "Note: Voeg deze regel toe aan uw crontab bestand tbv de geplande Espo opdrachten:", - "mac": "Note: Voeg deze regel toe aan uw crontab bestand tbv de geplande Espo opdrachten:", - "windows": "Note: Maak een batch file met de volgende commando's om de geplande opdrachten voor Espo onder Windows te gebruiken:", - "default": "Note: Add this command to Cron Job (Scheduled Task):" - }, - "status": { - "Active": "Active", - "Inactive": "Inactive" - } - } + "fields": { + "name": "Record Naam", + "status": "Status", + "job": "Opdracht", + "scheduling": "Scheduling (crontab notation)" + }, + "links": { + "log": "Log" + }, + "labels": { + "Create ScheduledJob": "Maak Geplande Opdracht" + }, + "options": { + "job": { + "CheckInboundEmails": "Controleer Binnenkomende Emails", + "Cleanup": "Opschonen" + }, + "cronSetup": { + "linux": "Note: Voeg deze regel toe aan uw crontab bestand tbv de geplande Espo opdrachten:", + "mac": "Note: Voeg deze regel toe aan uw crontab bestand tbv de geplande Espo opdrachten:", + "windows": "Note: Maak een batch file met de volgende commando's om de geplande opdrachten voor Espo onder Windows te gebruiken:", + "default": "Note: Add this command to Cron Job (Scheduled Task):" + }, + "status": { + "Active": "Active", + "Inactive": "Inactive" + } + } } diff --git a/application/Espo/Resources/i18n/nl_NL/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/nl_NL/ScheduledJobLogRecord.json index 06d381acdb..c01fd9028c 100644 --- a/application/Espo/Resources/i18n/nl_NL/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/nl_NL/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Status", - "executionTime": "Start Tijd" - } + "fields": { + "status": "Status", + "executionTime": "Start Tijd" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/Settings.json b/application/Espo/Resources/i18n/nl_NL/Settings.json index df5fb60a5a..1c61fc4393 100644 --- a/application/Espo/Resources/i18n/nl_NL/Settings.json +++ b/application/Espo/Resources/i18n/nl_NL/Settings.json @@ -1,76 +1,76 @@ { - "fields": { - "useCache": "Gebruik Cache", - "dateFormat": "Datum notatie", - "timeFormat": "Tijdnotatie", - "timeZone": "Tijd Zone", - "weekStart": "Eerste dag van de Week", - "thousandSeparator": "Duizendtal scheidingsteken", - "decimalMark": "Duizendtal scheidingsteken", - "defaultCurrency": "Voorkeur Valuta", - "baseCurrency": "Base Currency", - "baseCurrency": "Base Currency", - "currencyRates": "Rate Values", - - "currencyList": "Valuta Lijst", - "language": "Taal", - - "companyLogo": "Firma logo", - - "smtpServer": "Server", - "smtpPort": "Poort", - "smtpAuth": "Authenticatie", - "smtpSecurity": "Veiligheid", - "smtpUsername": "Gebruikersnaam", - "emailAddress": "Email", - "smtpPassword": "Wachtwoord", - "outboundEmailFromName": "Naam van", - "outboundEmailFromAddress": "Van Adres", - "outboundEmailIsShared": "Is Gedeeld", - - "recordsPerPage": "Velden per pagina", - "recordsPerPageSmall": "Records Per Page (Small)", - "tabList": "Tab lijst", - "quickCreateList": "Snel gemaakte lijst", - - "exportDelimiter": "Scheidingsteken Export", - - "authenticationMethod": "Authentication Methode", - "ldapHost": "Host", - "ldapPort": "Poort", - "ldapAuth": "Authenticatie", - "ldapUsername": "Gebruikersnaam", - "ldapPassword": "Wachtwoord", - "ldapBindRequiresDn": "Bind heeft Dn Nodig", - "ldapBaseDn": "Base Dn", - "ldapAccountCanonicalForm": "Standaard Formulier Gebruiker", - "ldapAccountDomainName": "Contact Domein Naam", - "ldapTryUsernameSplit": "Probeer gesplitste Gebruikersnaam", - "ldapCreateEspoUser": "Gebruiker aanmaken in EspoCRM", - "ldapSecurity": "Veiligheid", - "ldapUserLoginFilter": "Gebruikers Login Filter", - "ldapAccountDomainNameShort": "Korte Contact Domein Naam", - "ldapOptReferrals": "Opt Referentie", - "disableExport": "Disable Export (only admin is allowed)", - "assignmentEmailNotifications": "Send Email Notifications upon Assignment", - "assignmentEmailNotificationsEntityList": "Entities to Notify About" - }, - "options": { - "weekStart": { - "0": "Zondag", - "1": "Maandag" - } - }, - "tooltips": { - "recordsPerPageSmall": "Count of records in relatinship panels." - }, - "labels": { - "System": "Systeem", - "Locale": "Lokaal", - "SMTP": "SMTP", - "Configuration": "Configuratie", - "Notifications": "Notificaties", - "Currency Settings": "Currency Settings", - "Currency Rtes": "Currency Rates" - } + "fields": { + "useCache": "Gebruik Cache", + "dateFormat": "Datum notatie", + "timeFormat": "Tijdnotatie", + "timeZone": "Tijd Zone", + "weekStart": "Eerste dag van de Week", + "thousandSeparator": "Duizendtal scheidingsteken", + "decimalMark": "Duizendtal scheidingsteken", + "defaultCurrency": "Voorkeur Valuta", + "baseCurrency": "Base Currency", + "baseCurrency": "Base Currency", + "currencyRates": "Rate Values", + + "currencyList": "Valuta Lijst", + "language": "Taal", + + "companyLogo": "Firma logo", + + "smtpServer": "Server", + "smtpPort": "Poort", + "smtpAuth": "Authenticatie", + "smtpSecurity": "Veiligheid", + "smtpUsername": "Gebruikersnaam", + "emailAddress": "Email", + "smtpPassword": "Wachtwoord", + "outboundEmailFromName": "Naam van", + "outboundEmailFromAddress": "Van Adres", + "outboundEmailIsShared": "Is Gedeeld", + + "recordsPerPage": "Velden per pagina", + "recordsPerPageSmall": "Records Per Page (Small)", + "tabList": "Tab lijst", + "quickCreateList": "Snel gemaakte lijst", + + "exportDelimiter": "Scheidingsteken Export", + + "authenticationMethod": "Authentication Methode", + "ldapHost": "Host", + "ldapPort": "Poort", + "ldapAuth": "Authenticatie", + "ldapUsername": "Gebruikersnaam", + "ldapPassword": "Wachtwoord", + "ldapBindRequiresDn": "Bind heeft Dn Nodig", + "ldapBaseDn": "Base Dn", + "ldapAccountCanonicalForm": "Standaard Formulier Gebruiker", + "ldapAccountDomainName": "Contact Domein Naam", + "ldapTryUsernameSplit": "Probeer gesplitste Gebruikersnaam", + "ldapCreateEspoUser": "Gebruiker aanmaken in EspoCRM", + "ldapSecurity": "Veiligheid", + "ldapUserLoginFilter": "Gebruikers Login Filter", + "ldapAccountDomainNameShort": "Korte Contact Domein Naam", + "ldapOptReferrals": "Opt Referentie", + "disableExport": "Disable Export (only admin is allowed)", + "assignmentEmailNotifications": "Send Email Notifications upon Assignment", + "assignmentEmailNotificationsEntityList": "Entities to Notify About" + }, + "options": { + "weekStart": { + "0": "Zondag", + "1": "Maandag" + } + }, + "tooltips": { + "recordsPerPageSmall": "Count of records in relatinship panels." + }, + "labels": { + "System": "Systeem", + "Locale": "Lokaal", + "SMTP": "SMTP", + "Configuration": "Configuratie", + "Notifications": "Notificaties", + "Currency Settings": "Currency Settings", + "Currency Rtes": "Currency Rates" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/Team.json b/application/Espo/Resources/i18n/nl_NL/Team.json index 97f0e9f19d..4f44d67167 100644 --- a/application/Espo/Resources/i18n/nl_NL/Team.json +++ b/application/Espo/Resources/i18n/nl_NL/Team.json @@ -1,15 +1,15 @@ { - "fields": { - "name": "Record Naam", - "roles": "Regels" - }, - "links": { - "users": "Gebruikers" - }, - "tooltips": { - "roles": "All users from this team will get access settings from selected roles." - }, - "labels": { - "Create Team": "Maak een Team" - } + "fields": { + "name": "Record Naam", + "roles": "Regels" + }, + "links": { + "users": "Gebruikers" + }, + "tooltips": { + "roles": "All users from this team will get access settings from selected roles." + }, + "labels": { + "Create Team": "Maak een Team" + } } diff --git a/application/Espo/Resources/i18n/nl_NL/User.json b/application/Espo/Resources/i18n/nl_NL/User.json index fffc4710c4..6b706147be 100644 --- a/application/Espo/Resources/i18n/nl_NL/User.json +++ b/application/Espo/Resources/i18n/nl_NL/User.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Record Naam", - "userName": "Gebruikers Naam", - "title": "Titel", - "isAdmin": "Is Admin", - "defaultTeam": "Voorkeur Team", - "emailAddress": "Email", - "phoneNumber": "Telefoon", - "roles": "Regels", - "password": "Wachtwoord", - "passwordConfirm": "Bevestig Wachtwoord", - "newPassword": "Nieuw Wachtwoord" - }, - "links": { - "teams": "Groepen", - "roles": "Regels" - }, - "labels": { - "Create User": "Gebruiker Aanmaken", - "Generate": "Genereer", - "Access": "Rechten", - "Preferences": "Voorkeuren", - "Change Password": "Wachtwoord Aanpassen" - }, - "tooltips": { - "defaultTeam": "All records created by this user will be related to this team by default." - }, - "messages": { - "passwordWillBeSent": "Het Wachtwoord wordt naar het email adres van de gebruiker verzonden.", - "accountInfoEmailSubject": "Gebruiker Informatie", - "accountInfoEmailBody": "Uw gebruikers informatie:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", - "passwordChanged": "Het wachtwoord is aangepast" - } + "fields": { + "name": "Record Naam", + "userName": "Gebruikers Naam", + "title": "Titel", + "isAdmin": "Is Admin", + "defaultTeam": "Voorkeur Team", + "emailAddress": "Email", + "phoneNumber": "Telefoon", + "roles": "Regels", + "password": "Wachtwoord", + "passwordConfirm": "Bevestig Wachtwoord", + "newPassword": "Nieuw Wachtwoord" + }, + "links": { + "teams": "Groepen", + "roles": "Regels" + }, + "labels": { + "Create User": "Gebruiker Aanmaken", + "Generate": "Genereer", + "Access": "Rechten", + "Preferences": "Voorkeuren", + "Change Password": "Wachtwoord Aanpassen" + }, + "tooltips": { + "defaultTeam": "All records created by this user will be related to this team by default." + }, + "messages": { + "passwordWillBeSent": "Het Wachtwoord wordt naar het email adres van de gebruiker verzonden.", + "accountInfoEmailSubject": "Gebruiker Informatie", + "accountInfoEmailBody": "Uw gebruikers informatie:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", + "passwordChanged": "Het wachtwoord is aangepast" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/Admin.json b/application/Espo/Resources/i18n/pl_PL/Admin.json index b1f0ac3893..4120abeb96 100644 --- a/application/Espo/Resources/i18n/pl_PL/Admin.json +++ b/application/Espo/Resources/i18n/pl_PL/Admin.json @@ -1,128 +1,128 @@ { - "labels": { - "Enabled": "Włączony", - "Disabled": "Wyłączony", - "System": "System", - "Users": "Użytkownik", - "Email": "E-mail", - "Data": "Data", - "Customization": "Dostosowanie", - "Available Fields": "Dostępne Pola", - "Layout": "Układ", - "Enabled": "Włączony", - "Disabled": "Wyłączony", - "Add Panel": "Dodaj Panel", - "Add Field": "Dodaj Pole", - "Settings": "Ustawienia", - "Scheduled Jobs": "Zaplanowane działanie", - "Upgrade": "Aktualizacja", - "Clear Cache": "Wyczyść Pamięć Podręczną", - "Rebuild": "Przebuduj", - "Users": "Użytkownik", - "Teams": "Zespoły", - "Roles": "Rola", - "Outbound Emails": "Poczta Wychodząca", - "Inbound Emails": "Poczta Przychodząca", - "Email Templates": "Szkice Wiadomości", - "Import": "Import", - "Layout Manager": "Menadżer Widoku", - "Field Manager": "Mendżer Pól", - "User Interface": "Interfejs Użytkonika", - "Auth Tokens": "Auth Tokens", - "Authentication": "Autoryzacja", - "Currency": "Waluta" - }, - "layouts": { - "list": "Lista", - "detail": "Detale", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Filtry Wyszukiwania", - "massUpdate": "Masowa Akrualizacja", - "relationships": "Relacje" - }, - "fieldTypes": { - "address": "Adres", - "array": "Tablica", - "foreign": "Zagraniczny", - "duration": "Czas", - "password": "Hasło", - "parsonName": "Imię", - "autoincrement": "Auto-increment", - "bool": "Bool", - "currency": "Waluta", - "date": "Data", - "datetime": "DataCzas", - "email": "E-mail", - "enum": "Enum", - "enumInt": "Enum Integer", - "enumFloat": "Enum Float", - "float": "Float", - "int": "Int", - "link": "Link", - "linkMultiple": "Link Multiple", - "linkParent": "Link Parent", - "multienim": "Multienum", - "phone": "Telefon", - "text": "Tekst", - "url": "Strona Internetowa", - "varchar": "Varchar", - "file": "Plik", - "image": "Obraz" - }, - "fields": { - "type": "Rodzaj", - "name": "Imię", - "label": "Etykieta", - "required": "Wymagany", - "default": "Standardowy", - "maxLength": "Długość Maksymalna", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Link", - "field": "Pole", - "min": "Min", - "max": "Max", - "translation": "Tłumaczenie", - "previewSize": "Podgląd Rozmiaru" - }, - "messages": { - "upgradeVersion": "Twój EspoCRM jest aktualizowany do wersji {version}. To może zająć trochę czasu.", - "upgradeDone": "Twój CRM został zaaktualizowany do najnowszej wersji {version}. Odśwież swoją przeglądarke aby zobaczyć zmiany.", - "upgradeBackup": "Zalecamy abyś wykonał archiwizacje swoich danych, przed aktualizacją.", - "thousandSeparatorEqualsDecimalMark": "Separator dziesiętny nie może być taki sam jak znak oddzielenia", - "userHasNoEmailAddress": "Użytkownik nie ma przypisanego adres e-mail.", - "selectEntityType": "Wybierz jednostkę z menu po lewej stonie.", - "selectUpgradePackage": "Wypierz paczkę do aktualizacji", - "selectLayout": "Wybierz interesujący Cię układ z menu po lewej stronie i zacznij go edytować." - }, - "descriptions": { - "settings": "Ustawienia systemu dla aplikacji.", - "scheduledJob": "Zadania wykonywane przez skrypt cron.", - "upgrade": "Aktualizuj EspoCRM.", - "clearCache": "Wyczyść wszystkie dane zapisane w pamięci podręcznej.", - "rebuild": "Przebuduj oraz wyczyść pamięć podręczną.", - "users": "Zarządzanie użytkonikami.", - "teams": "Zarządzanie zespołami.", - "roles": "Zarządzanie Rolami.", - "outboundEmails": "Ustawienia SMTP dla poczty wychodzącej.", - "inboundEmails": "Glabalne ustawienia IMAP. Importowanie wiadomości i e-mail-do-zadania.", - "emailTemplates": "Szkice wiadomości dla poczty wychodzącej.", - "import": "Importuj dane z pliku CSV.", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Utwórz nowe pole lub dopasuj istniejące.", - "userInterface": "Konfiguruj UI(interfejs użytkownika).", - "authTokens": "Aktywuj autoryzacje sesji. Adres IP oraz data ostaniego wejścia.", - "authentication": "Ustawinia Autoryzacji.", - "currency": "Ustawienia waluty oraz przelicznika." - }, - "options": { - "previewSize": { - "x-small": "Bardzo Małe", - "small": "Małe", - "medium": "Średnie", - "large": "Duże" - } - } + "labels": { + "Enabled": "Włączony", + "Disabled": "Wyłączony", + "System": "System", + "Users": "Użytkownik", + "Email": "E-mail", + "Data": "Data", + "Customization": "Dostosowanie", + "Available Fields": "Dostępne Pola", + "Layout": "Układ", + "Enabled": "Włączony", + "Disabled": "Wyłączony", + "Add Panel": "Dodaj Panel", + "Add Field": "Dodaj Pole", + "Settings": "Ustawienia", + "Scheduled Jobs": "Zaplanowane działanie", + "Upgrade": "Aktualizacja", + "Clear Cache": "Wyczyść Pamięć Podręczną", + "Rebuild": "Przebuduj", + "Users": "Użytkownik", + "Teams": "Zespoły", + "Roles": "Rola", + "Outbound Emails": "Poczta Wychodząca", + "Inbound Emails": "Poczta Przychodząca", + "Email Templates": "Szkice Wiadomości", + "Import": "Import", + "Layout Manager": "Menadżer Widoku", + "Field Manager": "Mendżer Pól", + "User Interface": "Interfejs Użytkonika", + "Auth Tokens": "Auth Tokens", + "Authentication": "Autoryzacja", + "Currency": "Waluta" + }, + "layouts": { + "list": "Lista", + "detail": "Detale", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Filtry Wyszukiwania", + "massUpdate": "Masowa Akrualizacja", + "relationships": "Relacje" + }, + "fieldTypes": { + "address": "Adres", + "array": "Tablica", + "foreign": "Zagraniczny", + "duration": "Czas", + "password": "Hasło", + "parsonName": "Imię", + "autoincrement": "Auto-increment", + "bool": "Bool", + "currency": "Waluta", + "date": "Data", + "datetime": "DataCzas", + "email": "E-mail", + "enum": "Enum", + "enumInt": "Enum Integer", + "enumFloat": "Enum Float", + "float": "Float", + "int": "Int", + "link": "Link", + "linkMultiple": "Link Multiple", + "linkParent": "Link Parent", + "multienim": "Multienum", + "phone": "Telefon", + "text": "Tekst", + "url": "Strona Internetowa", + "varchar": "Varchar", + "file": "Plik", + "image": "Obraz" + }, + "fields": { + "type": "Rodzaj", + "name": "Imię", + "label": "Etykieta", + "required": "Wymagany", + "default": "Standardowy", + "maxLength": "Długość Maksymalna", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Link", + "field": "Pole", + "min": "Min", + "max": "Max", + "translation": "Tłumaczenie", + "previewSize": "Podgląd Rozmiaru" + }, + "messages": { + "upgradeVersion": "Twój EspoCRM jest aktualizowany do wersji {version}. To może zająć trochę czasu.", + "upgradeDone": "Twój CRM został zaaktualizowany do najnowszej wersji {version}. Odśwież swoją przeglądarke aby zobaczyć zmiany.", + "upgradeBackup": "Zalecamy abyś wykonał archiwizacje swoich danych, przed aktualizacją.", + "thousandSeparatorEqualsDecimalMark": "Separator dziesiętny nie może być taki sam jak znak oddzielenia", + "userHasNoEmailAddress": "Użytkownik nie ma przypisanego adres e-mail.", + "selectEntityType": "Wybierz jednostkę z menu po lewej stonie.", + "selectUpgradePackage": "Wypierz paczkę do aktualizacji", + "selectLayout": "Wybierz interesujący Cię układ z menu po lewej stronie i zacznij go edytować." + }, + "descriptions": { + "settings": "Ustawienia systemu dla aplikacji.", + "scheduledJob": "Zadania wykonywane przez skrypt cron.", + "upgrade": "Aktualizuj EspoCRM.", + "clearCache": "Wyczyść wszystkie dane zapisane w pamięci podręcznej.", + "rebuild": "Przebuduj oraz wyczyść pamięć podręczną.", + "users": "Zarządzanie użytkonikami.", + "teams": "Zarządzanie zespołami.", + "roles": "Zarządzanie Rolami.", + "outboundEmails": "Ustawienia SMTP dla poczty wychodzącej.", + "inboundEmails": "Glabalne ustawienia IMAP. Importowanie wiadomości i e-mail-do-zadania.", + "emailTemplates": "Szkice wiadomości dla poczty wychodzącej.", + "import": "Importuj dane z pliku CSV.", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Utwórz nowe pole lub dopasuj istniejące.", + "userInterface": "Konfiguruj UI(interfejs użytkownika).", + "authTokens": "Aktywuj autoryzacje sesji. Adres IP oraz data ostaniego wejścia.", + "authentication": "Ustawinia Autoryzacji.", + "currency": "Ustawienia waluty oraz przelicznika." + }, + "options": { + "previewSize": { + "x-small": "Bardzo Małe", + "small": "Małe", + "medium": "Średnie", + "large": "Duże" + } + } } diff --git a/application/Espo/Resources/i18n/pl_PL/AuthToken.json b/application/Espo/Resources/i18n/pl_PL/AuthToken.json index f0014c2663..ff9bf365cb 100644 --- a/application/Espo/Resources/i18n/pl_PL/AuthToken.json +++ b/application/Espo/Resources/i18n/pl_PL/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "Użytkownik", - "ipAddress": "IP Adres", - "lastAccess": "Data ostatniego logowania", - "createdAt": "Data Logowania" + "fields": { + "user": "Użytkownik", + "ipAddress": "IP Adres", + "lastAccess": "Data ostatniego logowania", + "createdAt": "Data Logowania" - } + } } diff --git a/application/Espo/Resources/i18n/pl_PL/Email.json b/application/Espo/Resources/i18n/pl_PL/Email.json index e22ed45157..0a00b61ac9 100644 --- a/application/Espo/Resources/i18n/pl_PL/Email.json +++ b/application/Espo/Resources/i18n/pl_PL/Email.json @@ -1,42 +1,42 @@ { - "fields": { - "name": "Temat", - "parent": "Konto", - "status": "Status", - "dateSent": "Data Wysłania", - "from": "Od", - "to": "Do", - "cc": "Kopia Do", - "bcc": "Ukryta Kopia Do", - "isHtml": "Format HTML", - "body": "Treść", - "subject": "Temat", - "attachments": "Załącznik", - "selectTemplate": "Wybierz szkic wiadomości", - "fromEmailAddress": "Z adresu", - "toEmailAddresses": "Do adresu", - "emailAddress": "E-mail Adres" - }, - "links": { - }, - "options": { - "Draft": "Szkic", - "Sending": "Wysyłam", - "Sent": "Wysłane", - "Archived": "Zapisane" - }, - "labels": { - "Create Email": "Archiwizuj e-mail", - "Archive Email": "Archiwizuj e-mail", - "Compose": "Utwórz", - "Reply": "Odpowiedz", - "Reply to All": "Reply to All", - "Forward": "Forward", - "Original message": "Original message", - "Forwarded message": "Forwarded message" - }, - "presetFilters": { - "sent": "Wysłane", - "archived": "Zapisane" - } + "fields": { + "name": "Temat", + "parent": "Konto", + "status": "Status", + "dateSent": "Data Wysłania", + "from": "Od", + "to": "Do", + "cc": "Kopia Do", + "bcc": "Ukryta Kopia Do", + "isHtml": "Format HTML", + "body": "Treść", + "subject": "Temat", + "attachments": "Załącznik", + "selectTemplate": "Wybierz szkic wiadomości", + "fromEmailAddress": "Z adresu", + "toEmailAddresses": "Do adresu", + "emailAddress": "E-mail Adres" + }, + "links": { + }, + "options": { + "Draft": "Szkic", + "Sending": "Wysyłam", + "Sent": "Wysłane", + "Archived": "Zapisane" + }, + "labels": { + "Create Email": "Archiwizuj e-mail", + "Archive Email": "Archiwizuj e-mail", + "Compose": "Utwórz", + "Reply": "Odpowiedz", + "Reply to All": "Reply to All", + "Forward": "Forward", + "Original message": "Original message", + "Forwarded message": "Forwarded message" + }, + "presetFilters": { + "sent": "Wysłane", + "archived": "Zapisane" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/EmailAddress.json b/application/Espo/Resources/i18n/pl_PL/EmailAddress.json index 3212d19a94..4f4aa868dc 100644 --- a/application/Espo/Resources/i18n/pl_PL/EmailAddress.json +++ b/application/Espo/Resources/i18n/pl_PL/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Główny", - "Opted Out": "Porzucony", - "Invalid": "Błędny" - } + "labels": { + "Primary": "Główny", + "Opted Out": "Porzucony", + "Invalid": "Błędny" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/EmailTemplate.json b/application/Espo/Resources/i18n/pl_PL/EmailTemplate.json index 7be521d5d8..56914bda7c 100644 --- a/application/Espo/Resources/i18n/pl_PL/EmailTemplate.json +++ b/application/Espo/Resources/i18n/pl_PL/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Imię", - "status": "Status", - "isHtml": "Format HTML", - "body": "Treść", - "subject": "Temat", - "attachments": "Załącznik", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Utwórz Szkic Wiadomości" - } + "fields": { + "name": "Imię", + "status": "Status", + "isHtml": "Format HTML", + "body": "Treść", + "subject": "Temat", + "attachments": "Załącznik", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Utwórz Szkic Wiadomości" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/Global.json b/application/Espo/Resources/i18n/pl_PL/Global.json index 7d0c980159..0dbec1646e 100644 --- a/application/Espo/Resources/i18n/pl_PL/Global.json +++ b/application/Espo/Resources/i18n/pl_PL/Global.json @@ -1,420 +1,420 @@ { - "scopeNames": { - "Email": "E-mail", - "User": "Użytkownik", - "Team": "Zespół", - "Role": "Rola", - "EmailTemplate": "Szkic wiadomości", - "OutboundEmail": "Poczta Wychodząca", - "ScheduledJob": "Automatyczne działanie" - }, - "scopeNamesPlural": { - "Email": "Emails", - "User": "Użytkownik", - "Team": "Zespoły", - "Role": "Rola", - "EmailTemplate": "Szkice Wiadomości", - "OutboundEmail": "Poczta Wychodząca", - "ScheduledJob": "Zaplanowane działanie" - }, - "labels": { - "Misc": "Misc", - "Merge": "Merge", - "None": "None", - "by": "przez", - "Saved": "Zapisane", - "Error": "Błąd", - "Select": "Wybierz", - "Not valid": "Nie poprawnie", - "Please wait...": "Proszę Czekać...", - "Please wait": "Proszę Czekać", - "Loading...": "Ładuje...", - "Uploading...": "Wgrywam na serwer...", - "Sending...": "Wysyłam...", - "Removed": "Usunięty", - "Posted": "Opublikowany", - "Linked": "Linked", - "Unlinked": "Unlinked", - "Access denied": "Dostęp zabroniony", - "Access": "Dostęp", - "Are you sure?": "Are you sure?", - "Record has been removed": "Rekord został usunięty", - "Wrong username/password": "Zła nazwa użytkonika/hasło", - "Post cannot be empty": "Notatka nie może byc pusta", - "Removing...": "Usuwam...", - "Unlinking...": "Unlinking...", - "Posting...": "Nadaje...", - "Username can not be empty!": "Nazwa użytkownika nie może byc pusta!", - "Cache is not enabled": "Pamięć podręczna jest nie dostępna", - "Cache has been cleared": "Pamięć podręczna została wyczyszczona", - "Rebuild has been done": "Przebudowanie zostało zakończone", - "Saving...": "Zapisuje...", - "Modified": "Zmieniony", - "Created": "Utworzony", - "Create": "Utwórz", - "create": "utwórz", - "Overview": "Podgląd", - "Details": "Detale", - "Add Filter": "Dodaj Filtr", - "Add Dashlet": "Dodaj Podgląd", - "Add": "Dodaj", - "Reset": "Reset", - "Menu": "Menu", - "More": "Więcej", - "Search": "Szukaj", - "Only My": "Tylko Moje", - "Open": "Otwórz", - "Admin": "Admin", - "About": "O", - "Refresh": "Odśwież", - "Remove": "Usuń", - "Options": "Opcje", - "Username": "Użytkownik", - "Password": "Hasło", - "Login": "Login", - "Log Out": "Wyloguj się", - "Preferences": "Preferencje", - "State": "Województwo", - "Street": "Ulica", - "Country": "Kraj", - "City": "Miasto", - "PostalCode": "Kod Pocztowy", - "Followed": "Śledzony", - "Follow": "Śledź", - "Clear Local Cache": "Wyczyść Pamięć Podręczną", - "Actions": "Akcja", - "Delete": "Usuń", - "Update": "Aktualizuj", - "Save": "Zapisz", - "Edit": "Edytuj", - "Cancel": "Anuluj", - "Unlink": "Unlink", - "Mass Update": "Masowa Akrualizacja", - "Export": "Eksportuj", - "No Data": "Brak Danych", - "All": "Wszystko", - "Active": "Aktywny", - "Inactive": "Nie Aktywny", - "Write your comment here": "Dodaj swój komentarz tutaj", - "Post": "Opublikuj", - "Stream": "Komunikator", - "Show more": "Pokaż Więcej", - "Dashlet Options": "Opcje Podglądu", - "Full Form": "Pełen Formularz", - "Insert": "Wstaw", - "Person": "Osoba", - "First Name": "Imię", - "Last Name": "Nazwisko", - "Original": "Originalny", - "You": "Ty", - "you": "ty", - "change": "zmień", - "Primary": "Główny", - "Save Filters": "Zapisz filtry wyszukiwania", - "Administration": "Administracja", - "Run Import": "Uruchom Importowanie", - "Duplicate": "Powielony", - "Notifications": "powiadomienia", - "Mark all read": "Oznacz wszystko jako przeczytane", - "See more": "Zobacz więcej" - }, - "messages": { - "notModified": "Nie zmodyfikowałeś żadnych danych", - "duplicate": "Dane które wprowadziłeś wyglądają na powielone", - "fieldIsRequired": "{field} wymagane", - "fieldShouldBeEmail": "{field} wprowadź poprawny adres e-mail", - "fieldShouldBeFloat": "{field} powinno być poprawnie wyjustowane", - "fieldShouldBeInt": "{field} powinno być poprawną liczbą całkowitą", - "fieldShouldBeDate": "{field} powinno być poprawną datą", - "fieldShouldBeDatetime": "{field} powinno być poprawną datą/czasem", - "fieldShouldAfter": "{field} powinno być po {otherField}", - "fieldShouldBefore": "{field} powinno być po {otherField}", - "fieldShouldBeBetween": "{field} powinno być między {min} i {max}", - "fieldShouldBeLess": "{field} powinno być mniejsze niż {value}", - "fieldShouldBeGreater": "{field} powinno być większe niż {value}", - "fieldBadPasswordConfirm": "{field} błędnie potwierdzony", - "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", - "assignmentEmailNotificationBody": "{assignerUserName} został przypisany {entityType} '{Entity.name}' do Ciebie\n\n{recordUrl}", - "confirmation": "Are you sure?", - "removeRecordConfirmation": "Are you sure you want to remove the record?", - "unlinkRecordConfirmation": "Are you sure you want to unlink relationship?", - "removeSelectedRecordsConfirmation": "Are you sure you want to remove selected records?" - }, - "boolFilters": { - "onlyMy": "Tylko Moje", - "open": "Otwórz", - "active": "Aktywny" - }, - "fields": { - "name": "Imię", - "firstName": "Imię", - "lastName": "Nazwisko", - "salutationName": "Zwrot", - "assignedUser": "Przypisany użytkownik", - "emailAddress": "E-mail", - "assignedUserName": "Przypisana Nazwa Użytkownika", - "teams": "Zespoły", - "createdAt": "Utworzony do", - "modifiedAt": "Zmodyfikowany do", - "createdBy": "Utworzony przez", - "modifiedBy": "Zmodyfikowany przez", - "title": "Tytuł", - "dateFrom": "Data Od", - "dateTo": "Data Do", - "autorefreshInterval": "Odświeżanie co", - "displayRecords": "Wyświetlane Dane" - }, - "links": { - "teams": "Zespoły", - "users": "Użytkownik" - }, - "dashlets": { - "Stream": "Komunikator" - }, - "streamMessages": { - "create": "{user} utworzony {entityType} {entity}", - "createAssigned": "{user} utworzony {entityType} {entity} assigned to {assignee}", - "assign": "{user} przypisany {entityType} {entity} to {assignee}", - "post": "{user} opublikował {entityType} {entity}", - "attach": "{user} załączył {entityType} {entity}", - "status": "{user} zaaktualizował {field} on {entityType} {entity}", - "update": "{user} zaaktualizował {entityType} {entity}", - "createRelated": "{user} created {relatedEntityType} {relatedEntity} linked to {entityType} {entity}", - "emailReceived": "{entity} został otrzymane dla {entityType} {entity}", - - "createThis": "{user} utwórz to {entityType}", - "createAssignedThis": "{user} utwórz to {entityType} assigned to {assignee}", - "assignThis": "{user} przypisz to {entityType} to {assignee}", - "postThis": "{user} opublikował", - "attachThis": "{user} załączył", - "statusThis": "{user} zaaktualizował {field}", - "updateThis": "{user} aktualizuj to {entityType}", - "createRelatedThis": "{user} created {relatedEntityType} {relatedEntity} linked to this {entityType}", - "emailReceivedThis": "{entity} has been received" - }, - "lists": { - "monthNames": ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], - "monthNamesShort": ["Sty", "Lut", "Mar", "Kwi", "Maj", "Czer", "Lip", "Sie", "Wrze", "Paź", "Lis", "Gru"], - "dayNames": ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], - "dayNamesShort": ["Ndz", "Pon", "Wto", "Śro", "Czwa", "Pią", "Sob"], - "dayNamesMin": ["Nd", "Pn", "Wt", "Śr", "Czw", "Pi", "So"] - }, - "options": { - "salutationName": { - "Mr.": "Pan.", - "Mrs.": "Pani.", - "Dr.": "Dr.", - "Drs.": "Drs." - }, - "language": { - "af_ZA": "Afrikaans", - "az_AZ": "Azerbaijani", - "be_BY": "Belarusian", - "bg_BG": "Bulgarian", - "bn_IN": "Bengali", - "bs_BA": "Bosnian", - "ca_ES": "Catalan", - "cs_CZ": "Czech", - "cy_GB": "Welsh", - "da_DK": "Danish", - "de_DE": "German", - "el_GR": "Greek", - "en_GB":"English (UK)", - "en_US":"English (US)", - "es_ES":"Spanish (Spain)", - "et_EE": "Estonian", - "eu_ES": "Basque", - "fa_IR": "Persian", - "fi_FI": "Finnish", - "fo_FO": "Faroese", - "fr_CA":"French (Canada)", - "fr_FR":"French (France)", - "ga_IE": "Irish", - "gl_ES": "Galician", - "gn_PY": "Guarani", - "he_IL": "Hebrew", - "hi_IN": "Hindi", - "hr_HR": "Croatian", - "hu_HU": "Hungarian", - "hy_AM": "Armenian", - "id_ID": "Indonesian", - "is_IS": "Icelandic", - "it_IT": "Italian", - "ja_JP": "Japanese", - "ka_GE": "Georgian", - "km_KH": "Khmer", - "ko_KR": "Korean", - "ku_TR": "Kurdish", - "lt_LT": "Lithuanian", - "lv_LV": "Latvian", - "mk_MK": "Macedonian", - "ml_IN": "Malayalam", - "ms_MY": "Malay", - "nb_NO": "Norwegian Bokmål", - "nn_NO": "Norwegian Nynorsk", - "ne_NP": "Nepali", - "nl_NL": "Dutch", - "pa_IN": "Punjabi", - "pl_PL": "Polski", - "ps_AF": "Pashto", - "pt_BR":"Portuguese (Brazil)", - "pt_PT":"Portuguese (Portugal)", - "ro_RO": "Romanian", - "ru_RU": "Russian", - "sk_SK": "Slovak", - "sl_SI": "Slovene", - "sq_AL": "Albanian", - "sr_RS": "Serbian", - "sv_SE": "Swedish", - "sw_KE": "Swahili", - "ta_IN": "Tamil", - "te_IN": "Telugu", - "th_TH": "Thai", - "tl_PH": "Tagalog", - "tr_TR": "Turkish", - "uk_UA": "Ukrainian", - "ur_PK": "Urdu", - "vi_VN": "Vietnamese", - "zh_CN":"Simplified Chinese (China)", - "zh_HK":"Traditional Chinese (Hong Kong)", - "zh_TW":"Traditional Chinese (Taiwan)" - }, - "dateSearchRanges": { - "on": "Włączony", - "notOn": "Nie Włączony", - "after": "Po", - "before": "Przed", - "between": "Między", - "today": "Dziś", - "past": "Przeszłość", - "future": "Przyszłość" - }, - "intSearchRanges": { - "equals": "Równy", - "notEquals": "Nie Równy", - "greaterThan": "Większy Niż", - "lessThan": "Mniejszy Niż", - "greaterThanOrEquals": "Większy lub Równy", - "lessThanOrEquals": "Mniejszy lub Równy", - "between": "Między" - }, - "autorefreshInterval": { - "0": "None", - "0.5": "30 sekund", - "1": "1 minuta", - "2": "2 minuty", - "5": "5 minut", - "10": "10 minut" - }, - "phoneNumber": { - "Mobile": "Komórka", - "Office": "Biuro", - "Fax": "Faks", - "Home": "Domowy", - "Other": "Inny" - } - }, - "sets": { - "summernote": { - "NOTICE": "Możesz znaleść tłumaczenie tutaj: https://github.com/HackerWins/summernote/tree/master/lang", - "font":{ - "bold": "Pogrubiony", - "italic": "Pochylenie", - "underline": "Podkreślenie", - "strike": "Przekreślnie", - "clear": "Usunięto formatowanie tekstu", - "height": "Szerokość Lini", - "name": "Czcionka", - "size": "Rozmiar Czcionki" - }, - "image":{ - "image": "Obraz", - "insert": "Dodaj Obraz", - "resizeFull": "Przeskaluj na pełny rozmiar", - "resizeHalf": "Przeszkaluj na połowę rozmiaru", - "resizeQuarter": "Przeskaluj do 1/4 rozmiaru", - "floatLeft": "Równaj do lewej", - "floatRight": "Równaj do prawej", - "floatNone": "Nie zmieniaj ", - "dragImageHere": "Upuść obraz tutaj", - "selectFromFiles": "Wybierz plik z dysku", - "url": "Adres do Obrazu", - "remove": "Usuń Obraz" - }, - "link":{ - "link":"Link", - "insert":"Insert Link", - "unlink":"Unlink", - "edit": "Edytuj", - "textToDisplay": "Tekst do wyświetlenia", - "url":"To what URL should this link go?", - "openInNewWindow": "Otwórz w nowym oknie" - }, - "video":{ - "video": "Video", - "videoLink":"Video Link", - "insert": "Wstaw Video", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" - }, - "table":{ - "table": "Tabela" - }, - "hr":{ - "insert": "Wstaw Linię Poziomą" - }, - "style":{ - "style": "Styl", - "normal": "Normalny", - "blockquote": "Cytat", - "pre": "Code", - "h1": "Nagłówek 1", - "h2": "Nagłówek 2", - "h3": "Nagłówek 3", - "h4": "Nagłówek 4", - "h5": "Nagłówek 5", - "h6": "Nagłówek 6" - }, - "lists":{ - "unordered": "Niewypunktowana lista", - "ordered": "Wypunktowana lista" - }, - "options":{ - "help": "Pomoc", - "fullscreen": "Pełny Ekran", - "codeview": "Źródło" - }, - "paragraph":{ - "paragraph": "Akapit", - "outdent": "Zmniejsz wcięcie", - "indent": "Zwiększ wcięcie", - "left": "Wyrównaj do lewej", - "center": "Wyrównaj do środka", - "right": "Wyrównaj do prawej", - "justify": "Wyrównaj do lewej i prawej" - }, - "color":{ - "recent": "Ostatni Kolor", - "more": "Więcej Kolorów", - "background": "Kolor Tła", - "foreground": "Kolor Czcionki", - "transparent": "Przeźroczystość", - "setTransparent": "Ustwa przeźroczystość", - "reset": "Reset", - "resetToDefault": "Domyślnie" - }, - "shortcut":{ - "shortcuts": "Skróty klawiaturowe", - "close": "Zamknij", - "textFormatting": "Formatowanie tekstu", - "action": "Akcja", - "paragraphFormatting": "Formatowanie akapitu", - "documentStyle": "Style dokumentu" - }, - "history":{ - "undo": "Cofnij", - "redo":"Redo" - } - } - } + "scopeNames": { + "Email": "E-mail", + "User": "Użytkownik", + "Team": "Zespół", + "Role": "Rola", + "EmailTemplate": "Szkic wiadomości", + "OutboundEmail": "Poczta Wychodząca", + "ScheduledJob": "Automatyczne działanie" + }, + "scopeNamesPlural": { + "Email": "Emails", + "User": "Użytkownik", + "Team": "Zespoły", + "Role": "Rola", + "EmailTemplate": "Szkice Wiadomości", + "OutboundEmail": "Poczta Wychodząca", + "ScheduledJob": "Zaplanowane działanie" + }, + "labels": { + "Misc": "Misc", + "Merge": "Merge", + "None": "None", + "by": "przez", + "Saved": "Zapisane", + "Error": "Błąd", + "Select": "Wybierz", + "Not valid": "Nie poprawnie", + "Please wait...": "Proszę Czekać...", + "Please wait": "Proszę Czekać", + "Loading...": "Ładuje...", + "Uploading...": "Wgrywam na serwer...", + "Sending...": "Wysyłam...", + "Removed": "Usunięty", + "Posted": "Opublikowany", + "Linked": "Linked", + "Unlinked": "Unlinked", + "Access denied": "Dostęp zabroniony", + "Access": "Dostęp", + "Are you sure?": "Are you sure?", + "Record has been removed": "Rekord został usunięty", + "Wrong username/password": "Zła nazwa użytkonika/hasło", + "Post cannot be empty": "Notatka nie może byc pusta", + "Removing...": "Usuwam...", + "Unlinking...": "Unlinking...", + "Posting...": "Nadaje...", + "Username can not be empty!": "Nazwa użytkownika nie może byc pusta!", + "Cache is not enabled": "Pamięć podręczna jest nie dostępna", + "Cache has been cleared": "Pamięć podręczna została wyczyszczona", + "Rebuild has been done": "Przebudowanie zostało zakończone", + "Saving...": "Zapisuje...", + "Modified": "Zmieniony", + "Created": "Utworzony", + "Create": "Utwórz", + "create": "utwórz", + "Overview": "Podgląd", + "Details": "Detale", + "Add Filter": "Dodaj Filtr", + "Add Dashlet": "Dodaj Podgląd", + "Add": "Dodaj", + "Reset": "Reset", + "Menu": "Menu", + "More": "Więcej", + "Search": "Szukaj", + "Only My": "Tylko Moje", + "Open": "Otwórz", + "Admin": "Admin", + "About": "O", + "Refresh": "Odśwież", + "Remove": "Usuń", + "Options": "Opcje", + "Username": "Użytkownik", + "Password": "Hasło", + "Login": "Login", + "Log Out": "Wyloguj się", + "Preferences": "Preferencje", + "State": "Województwo", + "Street": "Ulica", + "Country": "Kraj", + "City": "Miasto", + "PostalCode": "Kod Pocztowy", + "Followed": "Śledzony", + "Follow": "Śledź", + "Clear Local Cache": "Wyczyść Pamięć Podręczną", + "Actions": "Akcja", + "Delete": "Usuń", + "Update": "Aktualizuj", + "Save": "Zapisz", + "Edit": "Edytuj", + "Cancel": "Anuluj", + "Unlink": "Unlink", + "Mass Update": "Masowa Akrualizacja", + "Export": "Eksportuj", + "No Data": "Brak Danych", + "All": "Wszystko", + "Active": "Aktywny", + "Inactive": "Nie Aktywny", + "Write your comment here": "Dodaj swój komentarz tutaj", + "Post": "Opublikuj", + "Stream": "Komunikator", + "Show more": "Pokaż Więcej", + "Dashlet Options": "Opcje Podglądu", + "Full Form": "Pełen Formularz", + "Insert": "Wstaw", + "Person": "Osoba", + "First Name": "Imię", + "Last Name": "Nazwisko", + "Original": "Originalny", + "You": "Ty", + "you": "ty", + "change": "zmień", + "Primary": "Główny", + "Save Filters": "Zapisz filtry wyszukiwania", + "Administration": "Administracja", + "Run Import": "Uruchom Importowanie", + "Duplicate": "Powielony", + "Notifications": "powiadomienia", + "Mark all read": "Oznacz wszystko jako przeczytane", + "See more": "Zobacz więcej" + }, + "messages": { + "notModified": "Nie zmodyfikowałeś żadnych danych", + "duplicate": "Dane które wprowadziłeś wyglądają na powielone", + "fieldIsRequired": "{field} wymagane", + "fieldShouldBeEmail": "{field} wprowadź poprawny adres e-mail", + "fieldShouldBeFloat": "{field} powinno być poprawnie wyjustowane", + "fieldShouldBeInt": "{field} powinno być poprawną liczbą całkowitą", + "fieldShouldBeDate": "{field} powinno być poprawną datą", + "fieldShouldBeDatetime": "{field} powinno być poprawną datą/czasem", + "fieldShouldAfter": "{field} powinno być po {otherField}", + "fieldShouldBefore": "{field} powinno być po {otherField}", + "fieldShouldBeBetween": "{field} powinno być między {min} i {max}", + "fieldShouldBeLess": "{field} powinno być mniejsze niż {value}", + "fieldShouldBeGreater": "{field} powinno być większe niż {value}", + "fieldBadPasswordConfirm": "{field} błędnie potwierdzony", + "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", + "assignmentEmailNotificationBody": "{assignerUserName} został przypisany {entityType} '{Entity.name}' do Ciebie\n\n{recordUrl}", + "confirmation": "Are you sure?", + "removeRecordConfirmation": "Are you sure you want to remove the record?", + "unlinkRecordConfirmation": "Are you sure you want to unlink relationship?", + "removeSelectedRecordsConfirmation": "Are you sure you want to remove selected records?" + }, + "boolFilters": { + "onlyMy": "Tylko Moje", + "open": "Otwórz", + "active": "Aktywny" + }, + "fields": { + "name": "Imię", + "firstName": "Imię", + "lastName": "Nazwisko", + "salutationName": "Zwrot", + "assignedUser": "Przypisany użytkownik", + "emailAddress": "E-mail", + "assignedUserName": "Przypisana Nazwa Użytkownika", + "teams": "Zespoły", + "createdAt": "Utworzony do", + "modifiedAt": "Zmodyfikowany do", + "createdBy": "Utworzony przez", + "modifiedBy": "Zmodyfikowany przez", + "title": "Tytuł", + "dateFrom": "Data Od", + "dateTo": "Data Do", + "autorefreshInterval": "Odświeżanie co", + "displayRecords": "Wyświetlane Dane" + }, + "links": { + "teams": "Zespoły", + "users": "Użytkownik" + }, + "dashlets": { + "Stream": "Komunikator" + }, + "streamMessages": { + "create": "{user} utworzony {entityType} {entity}", + "createAssigned": "{user} utworzony {entityType} {entity} assigned to {assignee}", + "assign": "{user} przypisany {entityType} {entity} to {assignee}", + "post": "{user} opublikował {entityType} {entity}", + "attach": "{user} załączył {entityType} {entity}", + "status": "{user} zaaktualizował {field} on {entityType} {entity}", + "update": "{user} zaaktualizował {entityType} {entity}", + "createRelated": "{user} created {relatedEntityType} {relatedEntity} linked to {entityType} {entity}", + "emailReceived": "{entity} został otrzymane dla {entityType} {entity}", + + "createThis": "{user} utwórz to {entityType}", + "createAssignedThis": "{user} utwórz to {entityType} assigned to {assignee}", + "assignThis": "{user} przypisz to {entityType} to {assignee}", + "postThis": "{user} opublikował", + "attachThis": "{user} załączył", + "statusThis": "{user} zaaktualizował {field}", + "updateThis": "{user} aktualizuj to {entityType}", + "createRelatedThis": "{user} created {relatedEntityType} {relatedEntity} linked to this {entityType}", + "emailReceivedThis": "{entity} has been received" + }, + "lists": { + "monthNames": ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], + "monthNamesShort": ["Sty", "Lut", "Mar", "Kwi", "Maj", "Czer", "Lip", "Sie", "Wrze", "Paź", "Lis", "Gru"], + "dayNames": ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], + "dayNamesShort": ["Ndz", "Pon", "Wto", "Śro", "Czwa", "Pią", "Sob"], + "dayNamesMin": ["Nd", "Pn", "Wt", "Śr", "Czw", "Pi", "So"] + }, + "options": { + "salutationName": { + "Mr.": "Pan.", + "Mrs.": "Pani.", + "Dr.": "Dr.", + "Drs.": "Drs." + }, + "language": { + "af_ZA": "Afrikaans", + "az_AZ": "Azerbaijani", + "be_BY": "Belarusian", + "bg_BG": "Bulgarian", + "bn_IN": "Bengali", + "bs_BA": "Bosnian", + "ca_ES": "Catalan", + "cs_CZ": "Czech", + "cy_GB": "Welsh", + "da_DK": "Danish", + "de_DE": "German", + "el_GR": "Greek", + "en_GB":"English (UK)", + "en_US":"English (US)", + "es_ES":"Spanish (Spain)", + "et_EE": "Estonian", + "eu_ES": "Basque", + "fa_IR": "Persian", + "fi_FI": "Finnish", + "fo_FO": "Faroese", + "fr_CA":"French (Canada)", + "fr_FR":"French (France)", + "ga_IE": "Irish", + "gl_ES": "Galician", + "gn_PY": "Guarani", + "he_IL": "Hebrew", + "hi_IN": "Hindi", + "hr_HR": "Croatian", + "hu_HU": "Hungarian", + "hy_AM": "Armenian", + "id_ID": "Indonesian", + "is_IS": "Icelandic", + "it_IT": "Italian", + "ja_JP": "Japanese", + "ka_GE": "Georgian", + "km_KH": "Khmer", + "ko_KR": "Korean", + "ku_TR": "Kurdish", + "lt_LT": "Lithuanian", + "lv_LV": "Latvian", + "mk_MK": "Macedonian", + "ml_IN": "Malayalam", + "ms_MY": "Malay", + "nb_NO": "Norwegian Bokmål", + "nn_NO": "Norwegian Nynorsk", + "ne_NP": "Nepali", + "nl_NL": "Dutch", + "pa_IN": "Punjabi", + "pl_PL": "Polski", + "ps_AF": "Pashto", + "pt_BR":"Portuguese (Brazil)", + "pt_PT":"Portuguese (Portugal)", + "ro_RO": "Romanian", + "ru_RU": "Russian", + "sk_SK": "Slovak", + "sl_SI": "Slovene", + "sq_AL": "Albanian", + "sr_RS": "Serbian", + "sv_SE": "Swedish", + "sw_KE": "Swahili", + "ta_IN": "Tamil", + "te_IN": "Telugu", + "th_TH": "Thai", + "tl_PH": "Tagalog", + "tr_TR": "Turkish", + "uk_UA": "Ukrainian", + "ur_PK": "Urdu", + "vi_VN": "Vietnamese", + "zh_CN":"Simplified Chinese (China)", + "zh_HK":"Traditional Chinese (Hong Kong)", + "zh_TW":"Traditional Chinese (Taiwan)" + }, + "dateSearchRanges": { + "on": "Włączony", + "notOn": "Nie Włączony", + "after": "Po", + "before": "Przed", + "between": "Między", + "today": "Dziś", + "past": "Przeszłość", + "future": "Przyszłość" + }, + "intSearchRanges": { + "equals": "Równy", + "notEquals": "Nie Równy", + "greaterThan": "Większy Niż", + "lessThan": "Mniejszy Niż", + "greaterThanOrEquals": "Większy lub Równy", + "lessThanOrEquals": "Mniejszy lub Równy", + "between": "Między" + }, + "autorefreshInterval": { + "0": "None", + "0.5": "30 sekund", + "1": "1 minuta", + "2": "2 minuty", + "5": "5 minut", + "10": "10 minut" + }, + "phoneNumber": { + "Mobile": "Komórka", + "Office": "Biuro", + "Fax": "Faks", + "Home": "Domowy", + "Other": "Inny" + } + }, + "sets": { + "summernote": { + "NOTICE": "Możesz znaleść tłumaczenie tutaj: https://github.com/HackerWins/summernote/tree/master/lang", + "font":{ + "bold": "Pogrubiony", + "italic": "Pochylenie", + "underline": "Podkreślenie", + "strike": "Przekreślnie", + "clear": "Usunięto formatowanie tekstu", + "height": "Szerokość Lini", + "name": "Czcionka", + "size": "Rozmiar Czcionki" + }, + "image":{ + "image": "Obraz", + "insert": "Dodaj Obraz", + "resizeFull": "Przeskaluj na pełny rozmiar", + "resizeHalf": "Przeszkaluj na połowę rozmiaru", + "resizeQuarter": "Przeskaluj do 1/4 rozmiaru", + "floatLeft": "Równaj do lewej", + "floatRight": "Równaj do prawej", + "floatNone": "Nie zmieniaj ", + "dragImageHere": "Upuść obraz tutaj", + "selectFromFiles": "Wybierz plik z dysku", + "url": "Adres do Obrazu", + "remove": "Usuń Obraz" + }, + "link":{ + "link":"Link", + "insert":"Insert Link", + "unlink":"Unlink", + "edit": "Edytuj", + "textToDisplay": "Tekst do wyświetlenia", + "url":"To what URL should this link go?", + "openInNewWindow": "Otwórz w nowym oknie" + }, + "video":{ + "video": "Video", + "videoLink":"Video Link", + "insert": "Wstaw Video", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" + }, + "table":{ + "table": "Tabela" + }, + "hr":{ + "insert": "Wstaw Linię Poziomą" + }, + "style":{ + "style": "Styl", + "normal": "Normalny", + "blockquote": "Cytat", + "pre": "Code", + "h1": "Nagłówek 1", + "h2": "Nagłówek 2", + "h3": "Nagłówek 3", + "h4": "Nagłówek 4", + "h5": "Nagłówek 5", + "h6": "Nagłówek 6" + }, + "lists":{ + "unordered": "Niewypunktowana lista", + "ordered": "Wypunktowana lista" + }, + "options":{ + "help": "Pomoc", + "fullscreen": "Pełny Ekran", + "codeview": "Źródło" + }, + "paragraph":{ + "paragraph": "Akapit", + "outdent": "Zmniejsz wcięcie", + "indent": "Zwiększ wcięcie", + "left": "Wyrównaj do lewej", + "center": "Wyrównaj do środka", + "right": "Wyrównaj do prawej", + "justify": "Wyrównaj do lewej i prawej" + }, + "color":{ + "recent": "Ostatni Kolor", + "more": "Więcej Kolorów", + "background": "Kolor Tła", + "foreground": "Kolor Czcionki", + "transparent": "Przeźroczystość", + "setTransparent": "Ustwa przeźroczystość", + "reset": "Reset", + "resetToDefault": "Domyślnie" + }, + "shortcut":{ + "shortcuts": "Skróty klawiaturowe", + "close": "Zamknij", + "textFormatting": "Formatowanie tekstu", + "action": "Akcja", + "paragraphFormatting": "Formatowanie akapitu", + "documentStyle": "Style dokumentu" + }, + "history":{ + "undo": "Cofnij", + "redo":"Redo" + } + } + } } diff --git a/application/Espo/Resources/i18n/pl_PL/Note.json b/application/Espo/Resources/i18n/pl_PL/Note.json index 32c9f7a84c..f191707a62 100644 --- a/application/Espo/Resources/i18n/pl_PL/Note.json +++ b/application/Espo/Resources/i18n/pl_PL/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Opublikuj", - "attachments": "Załącznik" - } + "fields": { + "post": "Opublikuj", + "attachments": "Załącznik" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/Preferences.json b/application/Espo/Resources/i18n/pl_PL/Preferences.json index 3b740dbd8f..68621dab42 100644 --- a/application/Espo/Resources/i18n/pl_PL/Preferences.json +++ b/application/Espo/Resources/i18n/pl_PL/Preferences.json @@ -1,37 +1,37 @@ { - "fields": { - "dateFormat": "Format Daty", - "timeFormat": "Format Czasu", - "timeZone": "Strefa Czasowa", - "weekStart": "Pierwszy dzień tygodnia", - "thousandSeparator": "Separator Dziesiętny", - "decimalMark": "Znak rozdzielenia", - "defaultCurrency": "Domyślna Waluta", - "currencyList": "Domyślana Lista", - "language": "Język", - - "smtpServer": "Server", - "smtpPort": "Port", - "smtpAuth": "Auth", - "smtpSecurity": "Zabezpieczenia", - "smtpUsername": "Użytkownik", - "emailAddress": "E-mail", - "smtpPassword": "Hasło", - "smtpEmailAddress": "E-mail Adres", - - "exportDelimiter": "Znak rodzielenia eksportu", - - "receiveAssignmentEmailNotifications": "Otrzymać informację w trakcie jej przypisywania" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Niedziela", - "1": "Poniedziałek" - } - }, - "labels": { - "Notifications": "powiadomienia" - } + "fields": { + "dateFormat": "Format Daty", + "timeFormat": "Format Czasu", + "timeZone": "Strefa Czasowa", + "weekStart": "Pierwszy dzień tygodnia", + "thousandSeparator": "Separator Dziesiętny", + "decimalMark": "Znak rozdzielenia", + "defaultCurrency": "Domyślna Waluta", + "currencyList": "Domyślana Lista", + "language": "Język", + + "smtpServer": "Server", + "smtpPort": "Port", + "smtpAuth": "Auth", + "smtpSecurity": "Zabezpieczenia", + "smtpUsername": "Użytkownik", + "emailAddress": "E-mail", + "smtpPassword": "Hasło", + "smtpEmailAddress": "E-mail Adres", + + "exportDelimiter": "Znak rodzielenia eksportu", + + "receiveAssignmentEmailNotifications": "Otrzymać informację w trakcie jej przypisywania" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Niedziela", + "1": "Poniedziałek" + } + }, + "labels": { + "Notifications": "powiadomienia" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/Role.json b/application/Espo/Resources/i18n/pl_PL/Role.json index 5d9aa70c75..bc78bedb6a 100644 --- a/application/Espo/Resources/i18n/pl_PL/Role.json +++ b/application/Espo/Resources/i18n/pl_PL/Role.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Imię", - "roles": "Rola" - }, - "links": { - "users": "Użytkownik", - "teams": "Zespoły" - }, - "labels": { - "Access": "Dostęp", - "Create Role": "Utwórz Role " - }, - "options": { - "accessList": { - "not-set": "nie ustawiony", - "enabled": "włączony", - "disabled": "wyłączony" - }, - "levelList": { - "all": "wszystko", - "team": "zespół", - "own": "własny", - "no": "nie" - } - }, - "actions": { - "read": "Przeczytany", - "edit": "Edytuj", - "delete": "Usuń" - }, - "messages": { - "changesAfterClearCache": "Wszystkie zmiany w dostępie zostaną aktywowany w momencie wyczyszczenia pamięci." - } + "fields": { + "name": "Imię", + "roles": "Rola" + }, + "links": { + "users": "Użytkownik", + "teams": "Zespoły" + }, + "labels": { + "Access": "Dostęp", + "Create Role": "Utwórz Role " + }, + "options": { + "accessList": { + "not-set": "nie ustawiony", + "enabled": "włączony", + "disabled": "wyłączony" + }, + "levelList": { + "all": "wszystko", + "team": "zespół", + "own": "własny", + "no": "nie" + } + }, + "actions": { + "read": "Przeczytany", + "edit": "Edytuj", + "delete": "Usuń" + }, + "messages": { + "changesAfterClearCache": "Wszystkie zmiany w dostępie zostaną aktywowany w momencie wyczyszczenia pamięci." + } } diff --git a/application/Espo/Resources/i18n/pl_PL/ScheduledJob.json b/application/Espo/Resources/i18n/pl_PL/ScheduledJob.json index b6d5de63ba..5133cac088 100644 --- a/application/Espo/Resources/i18n/pl_PL/ScheduledJob.json +++ b/application/Espo/Resources/i18n/pl_PL/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Imię", - "status": "Status", - "job": "Zadanie", - "scheduling": "Scheduling (crontab notation)" - }, - "links": { - "log": "Log" - }, - "labels": { - "Create ScheduledJob": "Utwórz zaplanowane działania" - }, - "options": { - "job": { - "CheckInboundEmails": "Sprawdź pocztę przychodzącą", - "Cleanup": "Wyczyść" - }, - "cronSetup": { - "linux": "Uwaga: Dodaj tą linię do pliku crontab, aby uruchomić zaplanowane zadania Espo:", - "mac": "Uwaga: Dodaj tą linię do pliku crontab, aby uruchomić zaplanowane zadania Espo:", - "windows": "Uwaga: Utwórz plik wsadowy z następujących poleceń, aby uruchomić zaplanowane zadania Espo w systemie Windows:", - "default": "Note: Add this command to Cron Job (Scheduled Task):" - }, - "status": { - "Active": "Aktywny", - "Inactive": "Nie Aktywny" - } - } + "fields": { + "name": "Imię", + "status": "Status", + "job": "Zadanie", + "scheduling": "Scheduling (crontab notation)" + }, + "links": { + "log": "Log" + }, + "labels": { + "Create ScheduledJob": "Utwórz zaplanowane działania" + }, + "options": { + "job": { + "CheckInboundEmails": "Sprawdź pocztę przychodzącą", + "Cleanup": "Wyczyść" + }, + "cronSetup": { + "linux": "Uwaga: Dodaj tą linię do pliku crontab, aby uruchomić zaplanowane zadania Espo:", + "mac": "Uwaga: Dodaj tą linię do pliku crontab, aby uruchomić zaplanowane zadania Espo:", + "windows": "Uwaga: Utwórz plik wsadowy z następujących poleceń, aby uruchomić zaplanowane zadania Espo w systemie Windows:", + "default": "Note: Add this command to Cron Job (Scheduled Task):" + }, + "status": { + "Active": "Aktywny", + "Inactive": "Nie Aktywny" + } + } } diff --git a/application/Espo/Resources/i18n/pl_PL/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/pl_PL/ScheduledJobLogRecord.json index 3e7615b6aa..4c70a67ba3 100644 --- a/application/Espo/Resources/i18n/pl_PL/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/pl_PL/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Status", - "executionTime": "Czas realizacji" - } + "fields": { + "status": "Status", + "executionTime": "Czas realizacji" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/Settings.json b/application/Espo/Resources/i18n/pl_PL/Settings.json index 8c8eeec22f..f722725a79 100644 --- a/application/Espo/Resources/i18n/pl_PL/Settings.json +++ b/application/Espo/Resources/i18n/pl_PL/Settings.json @@ -1,76 +1,76 @@ { - "fields": { - "useCache": "Użyj pamięci podręcznej", - "dateFormat": "Format Daty", - "timeFormat": "Format Czasu", - "timeZone": "Strefa Czasowa", - "weekStart": "Pierwszy dzień tygodnia", - "thousandSeparator": "Separator Dziesiętny", - "decimalMark": "Znak rozdzielenia", - "defaultCurrency": "Domyślna Waluta", - "baseCurrency": "Podstawowa Waluta", - "baseCurrency": "Podstawowa Waluta", - "currencyRates": "Kurs Waluty", - - "currencyList": "Domyślana Lista", - "language": "Język", - - "companyLogo": "Logo Firmowe", - - "smtpServer": "Server", - "smtpPort": "Port", - "smtpAuth": "Auth", - "smtpSecurity": "Zabezpieczenia", - "smtpUsername": "Użytkownik", - "emailAddress": "E-mail", - "smtpPassword": "Hasło", - "outboundEmailFromName": "Od", - "outboundEmailFromAddress": "Z adresu", - "outboundEmailIsShared": "Jest Udostępniane", - - "recordsPerPage": "Wyników na stronę", - "recordsPerPageSmall": "Records Per Page (Small)", - "tabList": "Lista ", - "quickCreateList": "Szybkie utworzenie listy", - - "exportDelimiter": "Znak rodzielenia eksportu", - - "authenticationMethod": "Metoda autentykcji", - "ldapHost": "Host", - "ldapPort": "Port", - "ldapAuth": "Auth", - "ldapUsername": "Użytkownik", - "ldapPassword": "Hasło", - "ldapBindRequiresDn": "Bind Requires Dn", - "ldapBaseDn": "Base Dn", - "ldapAccountCanonicalForm": "Account Canonical Form", - "ldapAccountDomainName": "Nazwa konta domeny", - "ldapTryUsernameSplit": "Spróbuj rodzielić nazwę użytkonika", - "ldapCreateEspoUser": "Utwórz uzytkonika w EspoCRM", - "ldapSecurity": "Zabezpieczenia", - "ldapUserLoginFilter": "Filtr użytkoników ", - "ldapAccountDomainNameShort": "Krótka nazwa konta domeny", - "ldapOptReferrals": "Opt Referrals", - "disableExport": "Disable Export (only admin is allowed)", - "assignmentEmailNotifications": "Wyślij powiadominie do użytkonika o przypisaniu", - "assignmentEmailNotificationsEntityList": "Entities to Notify About" - }, - "options": { - "weekStart": { - "0": "Niedziela", - "1": "Poniedziałek" - } - }, - "tooltips": { - "recordsPerPageSmall": "Policz wyniki w panelu relacji." - }, - "labels": { - "System": "System", - "Locale": "Lokalne", - "SMTP": "SMTP", - "Configuration": "Konfiguracja", - "Notifications": "powiadomienia", - "Currency Settings": "Ustwienia Waluty", - "Currency Rtes": "Ustawienia Kursu" - } + "fields": { + "useCache": "Użyj pamięci podręcznej", + "dateFormat": "Format Daty", + "timeFormat": "Format Czasu", + "timeZone": "Strefa Czasowa", + "weekStart": "Pierwszy dzień tygodnia", + "thousandSeparator": "Separator Dziesiętny", + "decimalMark": "Znak rozdzielenia", + "defaultCurrency": "Domyślna Waluta", + "baseCurrency": "Podstawowa Waluta", + "baseCurrency": "Podstawowa Waluta", + "currencyRates": "Kurs Waluty", + + "currencyList": "Domyślana Lista", + "language": "Język", + + "companyLogo": "Logo Firmowe", + + "smtpServer": "Server", + "smtpPort": "Port", + "smtpAuth": "Auth", + "smtpSecurity": "Zabezpieczenia", + "smtpUsername": "Użytkownik", + "emailAddress": "E-mail", + "smtpPassword": "Hasło", + "outboundEmailFromName": "Od", + "outboundEmailFromAddress": "Z adresu", + "outboundEmailIsShared": "Jest Udostępniane", + + "recordsPerPage": "Wyników na stronę", + "recordsPerPageSmall": "Records Per Page (Small)", + "tabList": "Lista ", + "quickCreateList": "Szybkie utworzenie listy", + + "exportDelimiter": "Znak rodzielenia eksportu", + + "authenticationMethod": "Metoda autentykcji", + "ldapHost": "Host", + "ldapPort": "Port", + "ldapAuth": "Auth", + "ldapUsername": "Użytkownik", + "ldapPassword": "Hasło", + "ldapBindRequiresDn": "Bind Requires Dn", + "ldapBaseDn": "Base Dn", + "ldapAccountCanonicalForm": "Account Canonical Form", + "ldapAccountDomainName": "Nazwa konta domeny", + "ldapTryUsernameSplit": "Spróbuj rodzielić nazwę użytkonika", + "ldapCreateEspoUser": "Utwórz uzytkonika w EspoCRM", + "ldapSecurity": "Zabezpieczenia", + "ldapUserLoginFilter": "Filtr użytkoników ", + "ldapAccountDomainNameShort": "Krótka nazwa konta domeny", + "ldapOptReferrals": "Opt Referrals", + "disableExport": "Disable Export (only admin is allowed)", + "assignmentEmailNotifications": "Wyślij powiadominie do użytkonika o przypisaniu", + "assignmentEmailNotificationsEntityList": "Entities to Notify About" + }, + "options": { + "weekStart": { + "0": "Niedziela", + "1": "Poniedziałek" + } + }, + "tooltips": { + "recordsPerPageSmall": "Policz wyniki w panelu relacji." + }, + "labels": { + "System": "System", + "Locale": "Lokalne", + "SMTP": "SMTP", + "Configuration": "Konfiguracja", + "Notifications": "powiadomienia", + "Currency Settings": "Ustwienia Waluty", + "Currency Rtes": "Ustawienia Kursu" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/Team.json b/application/Espo/Resources/i18n/pl_PL/Team.json index 95a14c1b93..a78d7e2860 100644 --- a/application/Espo/Resources/i18n/pl_PL/Team.json +++ b/application/Espo/Resources/i18n/pl_PL/Team.json @@ -1,15 +1,15 @@ { - "fields": { - "name": "Imię", - "roles": "Rola" - }, - "links": { - "users": "Użytkownik" - }, - "tooltips": { - "roles": "Wszyscy użytkownicy z zespołu, otrzymają dostęp do ustawień zgodnie z rolami ." - }, - "labels": { - "Create Team": "Utwórz Zespół" - } + "fields": { + "name": "Imię", + "roles": "Rola" + }, + "links": { + "users": "Użytkownik" + }, + "tooltips": { + "roles": "Wszyscy użytkownicy z zespołu, otrzymają dostęp do ustawień zgodnie z rolami ." + }, + "labels": { + "Create Team": "Utwórz Zespół" + } } diff --git a/application/Espo/Resources/i18n/pl_PL/User.json b/application/Espo/Resources/i18n/pl_PL/User.json index 3cf8c157b0..6336847c2c 100644 --- a/application/Espo/Resources/i18n/pl_PL/User.json +++ b/application/Espo/Resources/i18n/pl_PL/User.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Imię", - "userName": "Nazwa Użytkownika", - "title": "Tytuł", - "isAdmin": "Czy jest Administratorem", - "defaultTeam": "Domyślny Zespół", - "emailAddress": "E-mail", - "phoneNumber": "Telefon", - "roles": "Rola", - "password": "Hasło", - "passwordConfirm": "Potwierdź Hasło", - "newPassword": "Nowe Hasło" - }, - "links": { - "teams": "Zespoły", - "roles": "Rola" - }, - "labels": { - "Create User": "Utwórz Użytkonika", - "Generate": "Generuj", - "Access": "Dostęp", - "Preferences": "Preferencje", - "Change Password": "Zmień hasło" - }, - "tooltips": { - "defaultTeam": "Wszytskie dane utworzone przez tego użytkonika, zostaną przypisane do domyślnego zespołu." - }, - "messages": { - "passwordWillBeSent": "Hasło zostanie wysłane na adres e-mail użytkonika.", - "accountInfoEmailSubject": "Informacje o koncie", - "accountInfoEmailBody": "Informacje o twoim koncie:\n\nUżytkonik: {userName}\nHasło: {password}\n\n{siteUrl}", - "passwordChanged": "Hasło zostało zmienione" - } + "fields": { + "name": "Imię", + "userName": "Nazwa Użytkownika", + "title": "Tytuł", + "isAdmin": "Czy jest Administratorem", + "defaultTeam": "Domyślny Zespół", + "emailAddress": "E-mail", + "phoneNumber": "Telefon", + "roles": "Rola", + "password": "Hasło", + "passwordConfirm": "Potwierdź Hasło", + "newPassword": "Nowe Hasło" + }, + "links": { + "teams": "Zespoły", + "roles": "Rola" + }, + "labels": { + "Create User": "Utwórz Użytkonika", + "Generate": "Generuj", + "Access": "Dostęp", + "Preferences": "Preferencje", + "Change Password": "Zmień hasło" + }, + "tooltips": { + "defaultTeam": "Wszytskie dane utworzone przez tego użytkonika, zostaną przypisane do domyślnego zespołu." + }, + "messages": { + "passwordWillBeSent": "Hasło zostanie wysłane na adres e-mail użytkonika.", + "accountInfoEmailSubject": "Informacje o koncie", + "accountInfoEmailBody": "Informacje o twoim koncie:\n\nUżytkonik: {userName}\nHasło: {password}\n\n{siteUrl}", + "passwordChanged": "Hasło zostało zmienione" + } } diff --git a/application/Espo/Resources/i18n/pt_BR/Admin.json b/application/Espo/Resources/i18n/pt_BR/Admin.json index d5908ba1cd..9b1286a8f6 100644 --- a/application/Espo/Resources/i18n/pt_BR/Admin.json +++ b/application/Espo/Resources/i18n/pt_BR/Admin.json @@ -9,8 +9,8 @@ "Customization": "Customização", "Available Fields": "Campos Disponíveis", "Layout": "Layout", - - + + "Add Panel": "Adicionar Painel", "Add Field": "Adicionar Campo", "Settings": "Preferências", @@ -18,7 +18,7 @@ "Upgrade": "Atualização", "Clear Cache": "Limpar Cache", "Rebuild": "Reconstruir", - + "Teams": "Times", "Roles": "Regras", "Outbound Emails": "E-mails de Saída", @@ -30,8 +30,8 @@ "User Interface": "Interface do Usuário", "Auth Tokens": "Tokens de Autenticação", "Authentication": "Autenticação", - "Currency": "Moeda", - "Integrations": "Integrações" + "Currency": "Moeda", + "Integrations": "Integrações" }, "layouts": { "list": "Lista", @@ -116,7 +116,7 @@ "userInterface": "Configurar UI.", "authTokens": "Sessões autenticadas ativas. Endereço de IP e última data de acesso.", "authentication": "Configurações de autenticação.", - "currency": "Configurações de moeda e taxas." + "currency": "Configurações de moeda e taxas." }, "options": { "previewSize": { diff --git a/application/Espo/Resources/i18n/pt_BR/AuthToken.json b/application/Espo/Resources/i18n/pt_BR/AuthToken.json index 9ac0742ce3..1e7c1ed311 100644 --- a/application/Espo/Resources/i18n/pt_BR/AuthToken.json +++ b/application/Espo/Resources/i18n/pt_BR/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "Usuário", - "ipAddress": "Endereço de IP", - "lastAccess": "Último acesso", - "createdAt": "Data do login" + "fields": { + "user": "Usuário", + "ipAddress": "Endereço de IP", + "lastAccess": "Último acesso", + "createdAt": "Data do login" - } + } } diff --git a/application/Espo/Resources/i18n/pt_BR/Email.json b/application/Espo/Resources/i18n/pt_BR/Email.json index 8597139b6a..5a9f5df269 100644 --- a/application/Espo/Resources/i18n/pt_BR/Email.json +++ b/application/Espo/Resources/i18n/pt_BR/Email.json @@ -1,44 +1,44 @@ { - "fields": { - "name": "Assunto", - "parent": "Origem", - "status": "Status", - "dateSent": "Data do envio", - "from": "De", - "to": "Para", - "cc": "CC", - "bcc": "BCC", - "isHtml": "Html", - "body": "Corpo", - "subject": "Assunto", - "attachments": "Anexos", - "selectTemplate": "Escolher Template", - "fromEmailAddress": "E-mail do rementente", - "toEmailAddresses": "E-mail do destinatário", - "emailAddress": "Endereço de E-mail", - "deliveryDate": "Data de envio" - }, - "links": { - }, - "options": { - "Draft": "Rascunho", - "Sending": "Enviando", - "Sent": "Enviado", - "Archived": "Arquivado" - }, - "labels": { - "Create Email": "Criar e-mail", - "Archive Email": "Arquivar e-mail", - "Compose": "Compor", - "Reply": "Responder", - "Reply to All": "Responder a Todos", - "Forward": "Encaminhar", - "Original message": "Mensagem original", - "Forwarded message": "Mensagem encaminhada", - "Email Accounts": "Contas de e-mail" - }, - "presetFilters": { - "sent": "Enviado", - "archived": "Arquivado" - } + "fields": { + "name": "Assunto", + "parent": "Origem", + "status": "Status", + "dateSent": "Data do envio", + "from": "De", + "to": "Para", + "cc": "CC", + "bcc": "BCC", + "isHtml": "Html", + "body": "Corpo", + "subject": "Assunto", + "attachments": "Anexos", + "selectTemplate": "Escolher Template", + "fromEmailAddress": "E-mail do rementente", + "toEmailAddresses": "E-mail do destinatário", + "emailAddress": "Endereço de E-mail", + "deliveryDate": "Data de envio" + }, + "links": { + }, + "options": { + "Draft": "Rascunho", + "Sending": "Enviando", + "Sent": "Enviado", + "Archived": "Arquivado" + }, + "labels": { + "Create Email": "Criar e-mail", + "Archive Email": "Arquivar e-mail", + "Compose": "Compor", + "Reply": "Responder", + "Reply to All": "Responder a Todos", + "Forward": "Encaminhar", + "Original message": "Mensagem original", + "Forwarded message": "Mensagem encaminhada", + "Email Accounts": "Contas de e-mail" + }, + "presetFilters": { + "sent": "Enviado", + "archived": "Arquivado" + } } diff --git a/application/Espo/Resources/i18n/pt_BR/EmailAccount.json b/application/Espo/Resources/i18n/pt_BR/EmailAccount.json index ae036851c7..d23674832f 100644 --- a/application/Espo/Resources/i18n/pt_BR/EmailAccount.json +++ b/application/Espo/Resources/i18n/pt_BR/EmailAccount.json @@ -1,29 +1,29 @@ { - "fields": { - "name": "Nome", - "status": "Status", - "host": "Host", - "username": "Usuário", - "password": "Senha", - "port": "Porta", - "monitoredFolders": "Pastas monitoradas", - "ssl": "SSL", - "fetchSince": "Buscar desde" - }, - "links": { - }, - "options": { - "status": { - "Active": "Ativa", - "Inactive": "Inativa" - } - }, - "labels": { - "Create EmailAccount": "Criar conta de e-mail", - "IMAP": "IMAP", - "Main": "Principal" - }, - "messages": { - "couldNotConnectToImap": "Não foi possível conectar ao servidor IMAP" - } + "fields": { + "name": "Nome", + "status": "Status", + "host": "Host", + "username": "Usuário", + "password": "Senha", + "port": "Porta", + "monitoredFolders": "Pastas monitoradas", + "ssl": "SSL", + "fetchSince": "Buscar desde" + }, + "links": { + }, + "options": { + "status": { + "Active": "Ativa", + "Inactive": "Inativa" + } + }, + "labels": { + "Create EmailAccount": "Criar conta de e-mail", + "IMAP": "IMAP", + "Main": "Principal" + }, + "messages": { + "couldNotConnectToImap": "Não foi possível conectar ao servidor IMAP" + } } diff --git a/application/Espo/Resources/i18n/pt_BR/EmailAddress.json b/application/Espo/Resources/i18n/pt_BR/EmailAddress.json index 58582e9f51..5740e88684 100644 --- a/application/Espo/Resources/i18n/pt_BR/EmailAddress.json +++ b/application/Espo/Resources/i18n/pt_BR/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Primário", - "Opted Out": "Cancelou (opt-out)", - "Invalid": "Inválido" - } + "labels": { + "Primary": "Primário", + "Opted Out": "Cancelou (opt-out)", + "Invalid": "Inválido" + } } diff --git a/application/Espo/Resources/i18n/pt_BR/ExternalAccount.json b/application/Espo/Resources/i18n/pt_BR/ExternalAccount.json index b62b91cd3a..b9517ef54e 100644 --- a/application/Espo/Resources/i18n/pt_BR/ExternalAccount.json +++ b/application/Espo/Resources/i18n/pt_BR/ExternalAccount.json @@ -1,7 +1,7 @@ { - "labels": { - "Connect": "Conectar" - }, - "help": { - } + "labels": { + "Connect": "Conectar" + }, + "help": { + } } diff --git a/application/Espo/Resources/i18n/pt_BR/Global.json b/application/Espo/Resources/i18n/pt_BR/Global.json index 8f00fc4e34..bf3e171b6b 100644 --- a/application/Espo/Resources/i18n/pt_BR/Global.json +++ b/application/Espo/Resources/i18n/pt_BR/Global.json @@ -5,10 +5,10 @@ "Team": "Time", "Role": "Regra", "EmailTemplate": "Template de E-mail", - "EmailAccount": "Conta de e-mail", + "EmailAccount": "Conta de e-mail", "OutboundEmail": "E-mail de Saída", "ScheduledJob": "Tarefa Agendada", - "ExternalAccount": "Conta externa" + "ExternalAccount": "Conta externa" }, "scopeNamesPlural": { "Email": "E-mails", @@ -16,10 +16,10 @@ "Team": "Times", "Role": "Regras", "EmailTemplate": "Templates de E-mail", - "EmailAccount": "Contas de e-mail", + "EmailAccount": "Contas de e-mail", "OutboundEmail": "E-mails de Saída", "ScheduledJob": "Tarefas Agendadas", - "ExternalAccount": "Contas externas" + "ExternalAccount": "Contas externas" }, "labels": { "Misc": "Misc", @@ -114,13 +114,13 @@ "you": "você", "change": "modificar", "Primary": "Primário", - "Save Filters": "Salvar Filtros", - "Administration": "Administração", - "Run Import": "Executar Importação", - "Duplicate": "Duplicar", - "Notifications": "Notificações", - "Mark all read": "Marcar tudo como lido", - "See more": "Ver mais" + "Save Filters": "Salvar Filtros", + "Administration": "Administração", + "Run Import": "Executar Importação", + "Duplicate": "Duplicar", + "Notifications": "Notificações", + "Mark all read": "Marcar tudo como lido", + "See more": "Ver mais" }, "messages": { "notModified": "Você não modificou o registro", @@ -137,12 +137,12 @@ "fieldShouldBeLess": "{field} deve ser menos que {value}", "fieldShouldBeGreater": "{field} deve ser maior que {value}", "fieldBadPasswordConfirm": "{field} confirmado impropriamente", - "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", - "assignmentEmailNotificationBody": "{assignerUserName} designou {entityType} '{Entity.name}' para você\n\n{recordUrl}", - "confirmation": "Você tem certeza?", - "removeRecordConfirmation": "Você gostaria mesmo de remover este registro?", - "unlinkRecordConfirmation": "Você gostaria mesmo de desfazer este relacionamento?", - "removeSelectedRecordsConfirmation": "Você gostaria mesmo de remover os registros selecionados?" + "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", + "assignmentEmailNotificationBody": "{assignerUserName} designou {entityType} '{Entity.name}' para você\n\n{recordUrl}", + "confirmation": "Você tem certeza?", + "removeRecordConfirmation": "Você gostaria mesmo de remover este registro?", + "unlinkRecordConfirmation": "Você gostaria mesmo de desfazer este relacionamento?", + "removeSelectedRecordsConfirmation": "Você gostaria mesmo de remover os registros selecionados?" }, "boolFilters": { "onlyMy": "Meus", @@ -289,9 +289,9 @@ "after": "Anterior", "before": "Posterior", "between": "Entre", - "today": "Hoje", - "past": "Passado", - "future": "Futuro" + "today": "Hoje", + "past": "Passado", + "future": "Futuro" }, "intSearchRanges": { "equals": "Igual", @@ -310,13 +310,13 @@ "5": "5 minutos", "10": "10 minutos" }, - "phoneNumber": { - "Mobile": "Celular", - "Office": "Escritório", - "Fax": "Fax", - "Home": "Residencial", - "Other": "Outro" - } + "phoneNumber": { + "Mobile": "Celular", + "Office": "Escritório", + "Fax": "Fax", + "Home": "Residencial", + "Other": "Outro" + } }, "sets": { "summernote": { diff --git a/application/Espo/Resources/i18n/pt_BR/Integration.json b/application/Espo/Resources/i18n/pt_BR/Integration.json index 821b4bf8a0..5ff1fd9f3f 100644 --- a/application/Espo/Resources/i18n/pt_BR/Integration.json +++ b/application/Espo/Resources/i18n/pt_BR/Integration.json @@ -1,14 +1,14 @@ { - "fields": { - "enabled": "Habilitado", - "clientId": "Client ID", - "clientSecret": "Client Secret", - "redirectUri": "URL de Redirecionamento" - }, - "messages": { - "selectIntegration": "Selecione uma integração no menu." - }, - "help": { - "Google": "

Obtenha as credenciais OAuth 2.0 do Google Developers Console.

Visite o Google Developers Console para obter as credenciais OAuth 2.0 como Client ID e Client Secret comuns ao Google e ao EspoCRM.

" - } + "fields": { + "enabled": "Habilitado", + "clientId": "Client ID", + "clientSecret": "Client Secret", + "redirectUri": "URL de Redirecionamento" + }, + "messages": { + "selectIntegration": "Selecione uma integração no menu." + }, + "help": { + "Google": "

Obtenha as credenciais OAuth 2.0 do Google Developers Console.

Visite o Google Developers Console para obter as credenciais OAuth 2.0 como Client ID e Client Secret comuns ao Google e ao EspoCRM.

" + } } diff --git a/application/Espo/Resources/i18n/pt_BR/Preferences.json b/application/Espo/Resources/i18n/pt_BR/Preferences.json index 384afd6292..8b22a33865 100644 --- a/application/Espo/Resources/i18n/pt_BR/Preferences.json +++ b/application/Espo/Resources/i18n/pt_BR/Preferences.json @@ -20,8 +20,8 @@ "smtpEmailAddress": "Endereço de E-mail", "exportDelimiter": "Delimitador de Exportação", - - "receiveAssignmentEmailNotifications": "Receber e-mail de notificação quando designado" + + "receiveAssignmentEmailNotifications": "Receber e-mail de notificação quando designado" }, "links": { }, @@ -31,7 +31,7 @@ "1": "Segunda" } }, - "labels": { - "Notifications": "Notificações" - } + "labels": { + "Notifications": "Notificações" + } } diff --git a/application/Espo/Resources/i18n/pt_BR/Role.json b/application/Espo/Resources/i18n/pt_BR/Role.json index 49fd2c2f78..08c5aefe2b 100644 --- a/application/Espo/Resources/i18n/pt_BR/Role.json +++ b/application/Espo/Resources/i18n/pt_BR/Role.json @@ -29,7 +29,7 @@ "edit": "Editar", "delete": "Excluir" }, - "messages": { - "changesAfterClearCache": "Todas as modificações no controle de acesso serão aplicadas após a limpeza do cache." - } + "messages": { + "changesAfterClearCache": "Todas as modificações no controle de acesso serão aplicadas após a limpeza do cache." + } } diff --git a/application/Espo/Resources/i18n/pt_BR/Settings.json b/application/Espo/Resources/i18n/pt_BR/Settings.json index 467a291612..a932f56193 100644 --- a/application/Espo/Resources/i18n/pt_BR/Settings.json +++ b/application/Espo/Resources/i18n/pt_BR/Settings.json @@ -8,10 +8,10 @@ "thousandSeparator": "Separador de Milhar", "decimalMark": "Deparador Decimal", "defaultCurrency": "Moeda Padrão", - "baseCurrency": "Moeda Base", - - "currencyRates": "Conversão de Moedas", - + "baseCurrency": "Moeda Base", + + "currencyRates": "Conversão de Moedas", + "currencyList": "Moedas Disponíveis", "language": "Idioma", @@ -34,26 +34,26 @@ "quickCreateList": "Lista de Criação Rápida", "exportDelimiter": "Delimitador de exportação", - - "authenticationMethod": "Método de Autenticação", - "ldapHost": "Host", - "ldapPort": "Porta", - "ldapAuth": "Auth", - "ldapUsername": "Usuário", - "ldapPassword": "Senha", - "ldapBindRequiresDn": "Ligação exige Dn", - "ldapBaseDn": "Dn Base", - "ldapAccountCanonicalForm": "Formulário Canônico de Conta", - "ldapAccountDomainName": "Nome de Domínio da Conta", - "ldapTryUsernameSplit": "Tentar dividir o Nome de Usuário", - "ldapCreateEspoUser": "Criar usuário no EspoCRM", - "ldapSecurity": "Segurança", - "ldapUserLoginFilter": "Filtro para Login de Usuário", - "ldapAccountDomainNameShort": "Nome curto do Domínio da Conta", - "ldapOptReferrals": "Referências Opt", - "disableExport": "Desabilitar exportação (permitido apenas para administradores)", - "assignmentEmailNotifications": "Enviar notificações sobre as designações por e-mail", - "assignmentEmailNotificationsEntityList": "Entidades para notificar" + + "authenticationMethod": "Método de Autenticação", + "ldapHost": "Host", + "ldapPort": "Porta", + "ldapAuth": "Auth", + "ldapUsername": "Usuário", + "ldapPassword": "Senha", + "ldapBindRequiresDn": "Ligação exige Dn", + "ldapBaseDn": "Dn Base", + "ldapAccountCanonicalForm": "Formulário Canônico de Conta", + "ldapAccountDomainName": "Nome de Domínio da Conta", + "ldapTryUsernameSplit": "Tentar dividir o Nome de Usuário", + "ldapCreateEspoUser": "Criar usuário no EspoCRM", + "ldapSecurity": "Segurança", + "ldapUserLoginFilter": "Filtro para Login de Usuário", + "ldapAccountDomainNameShort": "Nome curto do Domínio da Conta", + "ldapOptReferrals": "Referências Opt", + "disableExport": "Desabilitar exportação (permitido apenas para administradores)", + "assignmentEmailNotifications": "Enviar notificações sobre as designações por e-mail", + "assignmentEmailNotificationsEntityList": "Entidades para notificar" }, "options": { "weekStart": { @@ -61,16 +61,16 @@ "1": "Segunda" } }, - "tooltips": { - "recordsPerPageSmall": "Contar registros nos painéis de relacionamento." - }, + "tooltips": { + "recordsPerPageSmall": "Contar registros nos painéis de relacionamento." + }, "labels": { "System": "Sistema", "Locale": "Idioma", "SMTP": "SMTP", "Configuration": "Configuração", - "Notifications": "Notificações", - "Currency Settings": "Configurações de Moeda", - "Currency Rates": "Conversão de moedas" + "Notifications": "Notificações", + "Currency Settings": "Configurações de Moeda", + "Currency Rates": "Conversão de moedas" } } diff --git a/application/Espo/Resources/i18n/pt_BR/Team.json b/application/Espo/Resources/i18n/pt_BR/Team.json index 305642a089..334b8ae2a9 100644 --- a/application/Espo/Resources/i18n/pt_BR/Team.json +++ b/application/Espo/Resources/i18n/pt_BR/Team.json @@ -6,9 +6,9 @@ "links": { "users": "Usuários" }, - "tooltips": { - "roles": "Todos os usuários deste time terão acesso as configurações das regras selecionadas." - }, + "tooltips": { + "roles": "Todos os usuários deste time terão acesso as configurações das regras selecionadas." + }, "labels": { "Create Team": "Criar Time" } diff --git a/application/Espo/Resources/i18n/pt_BR/User.json b/application/Espo/Resources/i18n/pt_BR/User.json index d4f8e5390a..ec0cebb2fe 100644 --- a/application/Espo/Resources/i18n/pt_BR/User.json +++ b/application/Espo/Resources/i18n/pt_BR/User.json @@ -23,9 +23,9 @@ "Preferences": "Preferências", "Change Password": "Trocar Senha" }, - "tooltips": { - "defaultTeam": "Todos os registros criados por este usuário serão relacionados e este time por padrão." - }, + "tooltips": { + "defaultTeam": "Todos os registros criados por este usuário serão relacionados e este time por padrão." + }, "messages": { "passwordWillBeSent": "A senha será enviada para o email do usuário.", "accountInfoEmailSubject": "Informações da Conta", diff --git a/application/Espo/Resources/i18n/ro_RO/Admin.json b/application/Espo/Resources/i18n/ro_RO/Admin.json index dc4f989a89..135771de09 100644 --- a/application/Espo/Resources/i18n/ro_RO/Admin.json +++ b/application/Espo/Resources/i18n/ro_RO/Admin.json @@ -1,126 +1,126 @@ { - "labels": { - "Enabled": "Activat", - "Disabled": "Dezactivat", - "System": "Sistem", - "Users": "Utilizatori", - "Email": "Email", - "Data": "Data", - "Customization": "Personalizare", - "Available Fields": "Campuri valabile", - "Layout": "Aspect", - "Enabled": "Activat", - "Disabled": "Dezactivat", - "Add Panel": "Adauga Panou", - "Add Field": "Adauga Camp", - "Settings": "Setari", - "Scheduled Jobs": "Activitati Planificate", - "Upgrade": "Actualizare", - "Clear Cache": "Sterge Cache", - "Rebuild": "Recontruire", - "Users": "Utilizatori", - "Teams": "Echipe", - "Roles": "Roluri", - "Outbound Emails": "Email-uri trimise", - "Inbound Emails": "Email-uri intrate", - "Email Templates": "Template-uri Email", - "Import": "Importare", - "Layout Manager": "Manager Aspect", - "Field Manager": "Manager Campuri", - "User Interface": "Interfata Utilizator", - "Auth Tokens": "Token-uri Autentificare", - "Authentication": "Authentication" - }, - "layouts": { - "list": "Lista", - "detail": "Detalii", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Filtre Cautare", - "massUpdate": "Actualizeaza tot", - "relationships": "Relatii" - }, - "fieldTypes": { - "address": "Adresa", - "array": "Array", - "foreign": "Foreign", - "duration": "Durata", - "password": "Parola", - "parsonName": "Numele Persoanei", - "autoincrement": "Auto-incrementare", - "bool": "Bool", - "currency": "Valuta", - "date": "Data", - "datetime": "DataTimp", - "email": "Email", - "enum": "Enum", - "enumInt": "Enum Integer", - "enumFloat": "Enum Float", - "float": "Float", - "int": "Int", - "link": "Link", - "linkMultiple": "Link Multiplu", - "linkParent": "Link Parinte", - "multienim": "Multienum", - "phone": "Telefon", - "text": "Text", - "url": "Url", - "varchar": "Varchar", - "file": "Fisier", - "image": "Imagine" - }, - "fields": { - "type": "Tip", - "name": "Nume", - "label": "Eticheta", - "required": "Obligatoriu", - "default": "Initial", - "maxLength": "Lungime Maxima", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Link", - "field": "Camp", - "min": "Min", - "max": "Max", - "translation": "Tranducere", - "previewSize": "Previzualizare Marime" - }, - "messages": { - "upgradeVersion": "Aplicatia se va actualiza la versiunea {version}. S-ar putea sa dureze putin...", - "upgradeDone": "Aplicatia a fost actualizata la versiunea {version}. Va rugam sa faceti Refresh.", - "upgradeBackup": "Va rugam sa faceti backup bazei de date si aplicatiei inainte de a face actualizarea.", - "thousandSeparatorEqualsDecimalMark": "Separatorul de mii nu poate fi acelasi cu separatorul de zecimale", - "userHasNoEmailAddress": "Utilizatorul nu are adresa de email.", - "selectEntityType": "Selectati tipul entitatii din meniul din stanga.", - "selectUpgradePackage": "Selectati packetul de actualizare", - "selectLayout": "Selectati aspectul dorit din meniul din stanga si editati-l." - }, - "descriptions": { - "settings": "Setarile de sistem ale aplicatiei.", - "scheduledJob": "Activitati care sunt executate de cron.", - "upgrade": "Actualizare aplicatie.", - "clearCache": "Stergeti tot cache-ul din backend.", - "rebuild": "Reconstruire backend si stergere cache.", - "users": "Management Utilizatori.", - "teams": "Management Echipe.", - "roles": "Management Roluri.", - "outboundEmails": "Setari SMTP pentru trimitere email-uri.", - "inboundEmails": "Grup conturi de email IMAP. Import email și email-la-caz.", - "emailTemplates": "Template-uri pentru email-urile trimise.", - "import": "Importare din fisier CSV.", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Creaza campuri noi, sau personalizeaza-le pe cele existente.", - "userInterface": "Configurare UI.", - "authTokens": "Sesiuni Auth Active. Adresa IP si data ultimei accesari.", - "authentication": "Authentication setttings." - }, - "options": { - "previewSize": { - "x-small": "X-Small", - "small": "Small", - "medium": "Medium", - "large": "Large" - } - } + "labels": { + "Enabled": "Activat", + "Disabled": "Dezactivat", + "System": "Sistem", + "Users": "Utilizatori", + "Email": "Email", + "Data": "Data", + "Customization": "Personalizare", + "Available Fields": "Campuri valabile", + "Layout": "Aspect", + "Enabled": "Activat", + "Disabled": "Dezactivat", + "Add Panel": "Adauga Panou", + "Add Field": "Adauga Camp", + "Settings": "Setari", + "Scheduled Jobs": "Activitati Planificate", + "Upgrade": "Actualizare", + "Clear Cache": "Sterge Cache", + "Rebuild": "Recontruire", + "Users": "Utilizatori", + "Teams": "Echipe", + "Roles": "Roluri", + "Outbound Emails": "Email-uri trimise", + "Inbound Emails": "Email-uri intrate", + "Email Templates": "Template-uri Email", + "Import": "Importare", + "Layout Manager": "Manager Aspect", + "Field Manager": "Manager Campuri", + "User Interface": "Interfata Utilizator", + "Auth Tokens": "Token-uri Autentificare", + "Authentication": "Authentication" + }, + "layouts": { + "list": "Lista", + "detail": "Detalii", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Filtre Cautare", + "massUpdate": "Actualizeaza tot", + "relationships": "Relatii" + }, + "fieldTypes": { + "address": "Adresa", + "array": "Array", + "foreign": "Foreign", + "duration": "Durata", + "password": "Parola", + "parsonName": "Numele Persoanei", + "autoincrement": "Auto-incrementare", + "bool": "Bool", + "currency": "Valuta", + "date": "Data", + "datetime": "DataTimp", + "email": "Email", + "enum": "Enum", + "enumInt": "Enum Integer", + "enumFloat": "Enum Float", + "float": "Float", + "int": "Int", + "link": "Link", + "linkMultiple": "Link Multiplu", + "linkParent": "Link Parinte", + "multienim": "Multienum", + "phone": "Telefon", + "text": "Text", + "url": "Url", + "varchar": "Varchar", + "file": "Fisier", + "image": "Imagine" + }, + "fields": { + "type": "Tip", + "name": "Nume", + "label": "Eticheta", + "required": "Obligatoriu", + "default": "Initial", + "maxLength": "Lungime Maxima", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Link", + "field": "Camp", + "min": "Min", + "max": "Max", + "translation": "Tranducere", + "previewSize": "Previzualizare Marime" + }, + "messages": { + "upgradeVersion": "Aplicatia se va actualiza la versiunea {version}. S-ar putea sa dureze putin...", + "upgradeDone": "Aplicatia a fost actualizata la versiunea {version}. Va rugam sa faceti Refresh.", + "upgradeBackup": "Va rugam sa faceti backup bazei de date si aplicatiei inainte de a face actualizarea.", + "thousandSeparatorEqualsDecimalMark": "Separatorul de mii nu poate fi acelasi cu separatorul de zecimale", + "userHasNoEmailAddress": "Utilizatorul nu are adresa de email.", + "selectEntityType": "Selectati tipul entitatii din meniul din stanga.", + "selectUpgradePackage": "Selectati packetul de actualizare", + "selectLayout": "Selectati aspectul dorit din meniul din stanga si editati-l." + }, + "descriptions": { + "settings": "Setarile de sistem ale aplicatiei.", + "scheduledJob": "Activitati care sunt executate de cron.", + "upgrade": "Actualizare aplicatie.", + "clearCache": "Stergeti tot cache-ul din backend.", + "rebuild": "Reconstruire backend si stergere cache.", + "users": "Management Utilizatori.", + "teams": "Management Echipe.", + "roles": "Management Roluri.", + "outboundEmails": "Setari SMTP pentru trimitere email-uri.", + "inboundEmails": "Grup conturi de email IMAP. Import email și email-la-caz.", + "emailTemplates": "Template-uri pentru email-urile trimise.", + "import": "Importare din fisier CSV.", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Creaza campuri noi, sau personalizeaza-le pe cele existente.", + "userInterface": "Configurare UI.", + "authTokens": "Sesiuni Auth Active. Adresa IP si data ultimei accesari.", + "authentication": "Authentication setttings." + }, + "options": { + "previewSize": { + "x-small": "X-Small", + "small": "Small", + "medium": "Medium", + "large": "Large" + } + } } diff --git a/application/Espo/Resources/i18n/ro_RO/AuthToken.json b/application/Espo/Resources/i18n/ro_RO/AuthToken.json index 52508c0c70..dec1e6bf8f 100644 --- a/application/Espo/Resources/i18n/ro_RO/AuthToken.json +++ b/application/Espo/Resources/i18n/ro_RO/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "Utilizator", - "ipAddress": "Adresa IP", - "lastAccess": "Data ultimei accesari", - "createdAt": "Data conectarii" + "fields": { + "user": "Utilizator", + "ipAddress": "Adresa IP", + "lastAccess": "Data ultimei accesari", + "createdAt": "Data conectarii" - } + } } diff --git a/application/Espo/Resources/i18n/ro_RO/Email.json b/application/Espo/Resources/i18n/ro_RO/Email.json index cac9e25f94..f8c6fef6b2 100644 --- a/application/Espo/Resources/i18n/ro_RO/Email.json +++ b/application/Espo/Resources/i18n/ro_RO/Email.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Subiect", - "parent": "Parinte", - "status": "Status", - "dateSent": "Data trimiterii", - "from": "De la", - "to": "Catre", - "cc": "CC", - "bcc": "BCC", - "isHtml": "In format Html", - "body": "Corp", - "subject": "Subiect", - "attachments": "Atasamente", - "selectTemplate": "Selecteaza Template", - "fromEmailAddress": "De la adresa", - "toEmailAddresses": "La adresa", - "emailAddress": "Adresa Email" - }, - "links": { - }, - "options": { - "Draft": "Ciorna", - "Sending": "Se trimite", - "Sent": "Trimis", - "Archived": "Arhivat" - }, - "labels": { - "Create Email": "Arhiveaza Email", - "Compose": "Compune" - }, - "presetFilters": { - "sent": "Trimis", - "archived": "Arhivat" - } + "fields": { + "name": "Subiect", + "parent": "Parinte", + "status": "Status", + "dateSent": "Data trimiterii", + "from": "De la", + "to": "Catre", + "cc": "CC", + "bcc": "BCC", + "isHtml": "In format Html", + "body": "Corp", + "subject": "Subiect", + "attachments": "Atasamente", + "selectTemplate": "Selecteaza Template", + "fromEmailAddress": "De la adresa", + "toEmailAddresses": "La adresa", + "emailAddress": "Adresa Email" + }, + "links": { + }, + "options": { + "Draft": "Ciorna", + "Sending": "Se trimite", + "Sent": "Trimis", + "Archived": "Arhivat" + }, + "labels": { + "Create Email": "Arhiveaza Email", + "Compose": "Compune" + }, + "presetFilters": { + "sent": "Trimis", + "archived": "Arhivat" + } } diff --git a/application/Espo/Resources/i18n/ro_RO/EmailAddress.json b/application/Espo/Resources/i18n/ro_RO/EmailAddress.json index 0cf110b713..8d55266d25 100644 --- a/application/Espo/Resources/i18n/ro_RO/EmailAddress.json +++ b/application/Espo/Resources/i18n/ro_RO/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Primar", - "Opted Out": "Optat", - "Invalid": "Invalid" - } + "labels": { + "Primary": "Primar", + "Opted Out": "Optat", + "Invalid": "Invalid" + } } diff --git a/application/Espo/Resources/i18n/ro_RO/EmailTemplate.json b/application/Espo/Resources/i18n/ro_RO/EmailTemplate.json index bd081bef11..3a20eef44b 100644 --- a/application/Espo/Resources/i18n/ro_RO/EmailTemplate.json +++ b/application/Espo/Resources/i18n/ro_RO/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Nume", - "status": "Status", - "isHtml": "In format Html", - "body": "Corp", - "subject": "Subiect", - "attachments": "Atasamente", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Creare Template Email" - } + "fields": { + "name": "Nume", + "status": "Status", + "isHtml": "In format Html", + "body": "Corp", + "subject": "Subiect", + "attachments": "Atasamente", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Creare Template Email" + } } diff --git a/application/Espo/Resources/i18n/ro_RO/Global.json b/application/Espo/Resources/i18n/ro_RO/Global.json index bd6b3e926e..10f9713889 100644 --- a/application/Espo/Resources/i18n/ro_RO/Global.json +++ b/application/Espo/Resources/i18n/ro_RO/Global.json @@ -1,412 +1,412 @@ { - "scopeNames": { - "Email": "Email", - "User": "Utilizator", - "Team": "Echipa", - "Role": "Rol", - "EmailTemplate": "Template Email", - "OutboundEmail": "Email iesit ", - "ScheduledJob": "Activitati programate" - }, - "scopeNamesPlural": { - "Email": "Email-uri", - "User": "Utilizatori", - "Team": "Echipe", - "Role": "Roluri", - "EmailTemplate": "Template-uri Email", - "OutboundEmail": "Email-uri trimise", - "ScheduledJob": "Activitati Planificate" - }, - "labels": { - "Misc": "Miscibil", - "Merge": "Imbina", - "None": "Nici unul", - "by": "de", - "Saved": "Salvat", - "Error": "Eroare", - "Select": "Selecteaza", - "Not valid": "Invalid", - "Please wait...": "Va rugam asteptati...", - "Please wait": "Va rugam asteptati", - "Loading...": "Se incarca...", - "Uploading...": "Se incarca...", - "Sending...": "Se trimite...", - "Removed": "Sters", - "Posted": "Publicat", - "Linked": "Conectat", - "Unlinked": "Deconectat", - "Access denied": "Acces refuzat", - "Access": "Acces", - "Are you sure?": "Are you sure?", - "Record has been removed": "Inregistrarea a fost stearsa", - "Wrong username/password": "Numele de utilizator, sau parola nu sunt corecte", - "Post cannot be empty": "Aticolul nu poate fi gol", - "Removing...": "Se sterge...", - "Unlinking...": "Se deconecteaza...", - "Posting...": "Se publica...", - "Username can not be empty!": "Numele de utilizator nu poate fi gol!", - "Cache is not enabled": "Cache-ul nu este activat", - "Cache has been cleared": "Cache-ul a fost sters", - "Rebuild has been done": "Reconstruit cu succes", - "Saving...": "Se salveaza...", - "Modified": "Modificat", - "Created": "Creat", - "Create": "Creaza", - "create": "creaza", - "Overview": "Prezentare generala", - "Details": "Detalii", - "Add Filter": "Adauga Filtru", - "Add Dashlet": "Adauga Dashlet", - "Add": "Adauga", - "Reset": "Reset", - "Menu": "Meniu", - "More": "More", - "Search": "Cautare", - "Only My": "Doar eu", - "Open": "Deschide", - "Admin": "Admin", - "About": "Despre", - "Refresh": "Reimprospatare", - "Remove": "Sterge", - "Options": "Optiuni", - "Username": "Nume Utilizator", - "Password": "Parola", - "Login": "Conectare", - "Log Out": "Deconectare", - "Preferences": "Preferinte", - "State": "Stat", - "Street": "Strada", - "Country": "Tara", - "City": "Oras", - "PostalCode": "Code Postal ", - "Followed": "Urmarit", - "Follow": "Urmareste", - "Clear Local Cache": "Stergere Cache Local", - "Actions": "Actiuni", - "Delete": "Sterge", - "Update": "Actualizare", - "Save": "Salveaza", - "Edit": "Editare", - "Cancel": "Renunta", - "Unlink": "Dezleaga", - "Mass Update": "Actualizeaza tot", - "Export": "Export", - "No Data": "Nu sunt date", - "All": "Toate", - "Active": "Activ", - "Inactive": "Inactiv", - "Write your comment here": "Scrie comentariul aici", - "Post": "Publica", - "Stream": "Curent", - "Show more": "Afiseaza mai mult", - "Dashlet Options": "Optiuni Dashlet", - "Full Form": "Forma intreaga", - "Insert": "Inserare", - "Person": "Persoana", - "First Name": "Prenume", - "Last Name": "Nume", - "Original": "Original", - "You": "Tu", - "you": "tu", - "change": "schimba", - "Primary": "Primar", - "Save Filters": "Save Filters", - "Administration": "Administration", - "Run Import": "Run Import", - "Duplicate": "Duplicat", - "Notifications": "Notifications" - }, - "messages": { - "notModified": "Nu ai modificat inregistrarea", - "duplicate": "Inregistrarea pe care o creezi pare sa fie duplicat", - "fieldIsRequired": "{field} este obligatoriu", - "fieldShouldBeEmail": "{field} trebuie sa fie o adresa de email valida", - "fieldShouldBeFloat": "{field} trebuie sa fie float valid", - "fieldShouldBeInt": "{field} trebuie sa fie intreg valid", - "fieldShouldBeDate": "{field} trebuie sa fie data valida", - "fieldShouldBeDatetime": "{field} trebuie sa fie data/timp valid", - "fieldShouldAfter": "{field} trebuie sa fie dupa {otherField}", - "fieldShouldBefore": "{field} trebuie sa fie inainte de {otherField}", - "fieldShouldBeBetween": "{field} trebuie sa fie intre {min} si {max}", - "fieldShouldBeLess": "{field} trebuie sa fie mai putin de {value}", - "fieldShouldBeGreater": "{field} trebuie sa fie mai mare de {value}", - "fieldBadPasswordConfirm": "{field} confirmat in mod necorespunzator" - }, - "boolFilters": { - "onlyMy": "Doar eu", - "open": "Deschide", - "active": "Activ" - }, - "fields": { - "name": "Nume", - "firstName": "Prenume", - "lastName": "Nume", - "salutationName": "Salut", - "assignedUser": "Utilizator alocat", - "emailAddress": "Email", - "assignedUserName": "Nume utilizator alocat", - "teams": "Echipe", - "createdAt": "Creat la", - "modifiedAt": "Modificat la", - "createdBy": "Creat de", - "modifiedBy": "Modificat de", - "title": "Titlu", - "dateFrom": "Data - de la", - "dateTo": "Data - pana la", - "autorefreshInterval": "Interval Auto-reinprospatare", - "displayRecords": "Afisare inregistrari" - }, - "links": { - "teams": "Echipe", - "users": "Utilizatori" - }, - "dashlets": { - "Stream": "Curent" - }, - "streamMessages": { - "create": "{user} creat {entityType} {entity}", - "createAssigned": "{user} creat {entityType} {entity} si alocat lui {assignee}", - "assign": "{user} alocat {entityType} {entity} lui {assignee}", - "post": "{user} publicat la {entityType} {entity}", - "attach": "{user} atasat la {entityType} {entity}", - "status": "{user} actualizat {field} pe {entityType} {entity}", - "update": "{user} actualizat {entityType} {entity}", - "createRelated": "{user} creat {relatedEntityType} {relatedEntity} si conectat cu {entityType} {entity}", - "emailReceived": "{entity} a fost primit pentru {entityType} {entity}", - - "createThis": "{user} a creat acest {entityType}", - "createAssignedThis": "{user} a creat acest {entityType} alocat lui {assignee}", - "assignThis": "{user} a alocat acest {entityType} lui {assignee}", - "postThis": "{user} publicat", - "attachThis": "{user} atasat", - "statusThis": "{user} a actualizat {field}", - "updateThis": "{user} a actualizat acest {entityType}", - "createRelatedThis": "{user} a creat {relatedEntityType} {relatedEntity} si l-a conectat cu {entityType}", - "emailReceivedThis": "{entity} a fost primit" - }, - "lists": { - "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] - }, - "options": { - "salutationName": { - "Mr.": "Dl.", - "Mrs.": "D-na.", - "Dr.": "Dr.", - "Drs.": "Dr." - }, - "language": { - "af_ZA": "Afrikaans", - "az_AZ": "Azerbaijani", - "be_BY": "Belarusian", - "bg_BG": "Bulgarian", - "bn_IN": "Bengali", - "bs_BA": "Bosnian", - "ca_ES": "Catalan", - "cs_CZ": "Czech", - "cy_GB": "Welsh", - "da_DK": "Danish", - "de_DE": "German", - "el_GR": "Greek", - "en_GB":"English (UK)", - "en_US":"English (US)", - "es_ES":"Spanish (Spain)", - "et_EE": "Estonian", - "eu_ES": "Basque", - "fa_IR": "Persian", - "fi_FI": "Finnish", - "fo_FO": "Faroese", - "fr_CA":"French (Canada)", - "fr_FR":"French (France)", - "ga_IE": "Irish", - "gl_ES": "Galician", - "gn_PY": "Guarani", - "he_IL": "Hebrew", - "hi_IN": "Hindi", - "hr_HR": "Croatian", - "hu_HU": "Hungarian", - "hy_AM": "Armenian", - "id_ID": "Indonesian", - "is_IS": "Icelandic", - "it_IT": "Italian", - "ja_JP": "Japanese", - "ka_GE": "Georgian", - "km_KH": "Khmer", - "ko_KR": "Korean", - "ku_TR": "Kurdish", - "lt_LT": "Lithuanian", - "lv_LV": "Latvian", - "mk_MK": "Macedonian", - "ml_IN": "Malayalam", - "ms_MY": "Malay", - "nb_NO":"Norwegian Bokmål", - "nn_NO": "Norwegian Nynorsk", - "ne_NP": "Nepali", - "nl_NL": "Dutch", - "pa_IN": "Punjabi", - "pl_PL": "Polish", - "ps_AF": "Pashto", - "pt_BR":"Portuguese (Brazil)", - "pt_PT":"Portuguese (Portugal)", - "ro_RO": "Romana", - "ru_RU": "Russian", - "sk_SK": "Slovak", - "sl_SI": "Slovene", - "sq_AL": "Albanian", - "sr_RS": "Serbian", - "sv_SE": "Swedish", - "sw_KE": "Swahili", - "ta_IN": "Tamil", - "te_IN": "Telugu", - "th_TH": "Thai", - "tl_PH": "Tagalog", - "tr_TR": "Turkish", - "uk_UA": "Ukrainian", - "ur_PK": "Urdu", - "vi_VN": "Vietnamese", - "zh_CN":"Simplified Chinese (China)", - "zh_HK":"Traditional Chinese (Hong Kong)", - "zh_TW":"Traditional Chinese (Taiwan)" - }, - "dateSearchRanges": { - "on": "Pornit", - "notOn": "Oprit", - "after": "Dupa", - "before": "Inainte", - "between": "Intre", - "today": "Astazi", - "past": "Past", - "future": "Future" - }, - "intSearchRanges": { - "equals": "Egal", - "notEquals": "Inegal", - "greaterThan": "Mai mare de", - "lessThan": "Mai mic de", - "greaterThanOrEquals": "Mai mare sau egal", - "lessThanOrEquals": "Mai mic sau egal", - "between": "Intre" - }, - "autorefreshInterval": { - "0": "Nici unul", - "0.5": "30 secunde", - "1": "1 minut", - "2": "2 minute", - "5": "5 minute", - "10": "10 minute" - }, - "phoneNumber": { - "Mobile": "Mobile", - "Office": "Office", - "Fax": "Fax", - "Home": "Home", - "Other": "Altele" - } - }, - "sets": { - "summernote": { - "NOTICE": "Puteti gasi traducerea aici: https://github.com/HackerWins/summernote/tree/master/lang", - "font":{ - "bold": "Bold", - "italic": "Italic", - "underline": "Subliniat", - "strike": "Strike", - "clear": "Sterge stil font", - "height": "Inaltime linie", - "name": "Familie Font ", - "size": "Marime Font" - }, - "image":{ - "image": "Imagine", - "insert": "Inserare Imagine", - "resizeFull": "Redimensionare completa", - "resizeHalf": "Redimensionare la jumatate", - "resizeQuarter": "Redimensionare la sfert", - "floatLeft": "Aliniere la stanga", - "floatRight": "Aliniere la dreapta", - "floatNone": "Fara aliniere", - "dragImageHere": "Trage imaginea aici", - "selectFromFiles": "Selecteaza din fisiere", - "url": "URL Imagine", - "remove": "Stergere imagine" - }, - "link":{ - "link": "Link", - "insert": "Inserare Link", - "unlink": "Dezleaga", - "edit": "Editare", - "textToDisplay": "Text de afisat", - "url":"To what URL should this link go?", - "openInNewWindow": "Deschidere in fereastra noua" - }, - "video":{ - "video": "Video", - "videoLink": "Link Video ", - "insert": "Inserare Video", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" - }, - "table":{ - "table": "Tabel" - }, - "hr":{ - "insert": "Inserare Linie Orizontala" - }, - "style":{ - "style": "Stil", - "normal": "Normal", - "blockquote": "Citat", - "pre": "Cod", - "h1": "Header 1", - "h2": "Header 2", - "h3": "Header 3", - "h4": "Header 4", - "h5": "Header 5", - "h6": "Header 6" - }, - "lists":{ - "unordered": "Lista neordonata", - "ordered": "Lista ordonata" - }, - "options":{ - "help": "Ajutor", - "fullscreen": "Ecran complet", - "codeview": "Vizualizare cod" - }, - "paragraph":{ - "paragraph": "Paragraf", - "outdent": "Neindentat", - "indent": "Indentat", - "left": "Aliniere stanga", - "center": "Aliniere centru", - "right": "Aliniere dreapta", - "justify": "Justify complet" - }, - "color":{ - "recent": "Culoarea recenta", - "more": "Mai multe culori", - "background": "Culoare fundal", - "foreground": "Culoare font", - "transparent": "Transparent", - "setTransparent": "Setare transparenta", - "reset": "Reset", - "resetToDefault": "Reinitializare setari" - }, - "shortcut":{ - "shortcuts": "Scurtaturi taste", - "close": "Inchide", - "textFormatting": "Formatare Text", - "action": "Actiune", - "paragraphFormatting": "Formatare Paragraf", - "documentStyle": "Stil Document " - }, - "history":{ - "undo": "Undo", - "redo": "Redo" - } - } - } + "scopeNames": { + "Email": "Email", + "User": "Utilizator", + "Team": "Echipa", + "Role": "Rol", + "EmailTemplate": "Template Email", + "OutboundEmail": "Email iesit ", + "ScheduledJob": "Activitati programate" + }, + "scopeNamesPlural": { + "Email": "Email-uri", + "User": "Utilizatori", + "Team": "Echipe", + "Role": "Roluri", + "EmailTemplate": "Template-uri Email", + "OutboundEmail": "Email-uri trimise", + "ScheduledJob": "Activitati Planificate" + }, + "labels": { + "Misc": "Miscibil", + "Merge": "Imbina", + "None": "Nici unul", + "by": "de", + "Saved": "Salvat", + "Error": "Eroare", + "Select": "Selecteaza", + "Not valid": "Invalid", + "Please wait...": "Va rugam asteptati...", + "Please wait": "Va rugam asteptati", + "Loading...": "Se incarca...", + "Uploading...": "Se incarca...", + "Sending...": "Se trimite...", + "Removed": "Sters", + "Posted": "Publicat", + "Linked": "Conectat", + "Unlinked": "Deconectat", + "Access denied": "Acces refuzat", + "Access": "Acces", + "Are you sure?": "Are you sure?", + "Record has been removed": "Inregistrarea a fost stearsa", + "Wrong username/password": "Numele de utilizator, sau parola nu sunt corecte", + "Post cannot be empty": "Aticolul nu poate fi gol", + "Removing...": "Se sterge...", + "Unlinking...": "Se deconecteaza...", + "Posting...": "Se publica...", + "Username can not be empty!": "Numele de utilizator nu poate fi gol!", + "Cache is not enabled": "Cache-ul nu este activat", + "Cache has been cleared": "Cache-ul a fost sters", + "Rebuild has been done": "Reconstruit cu succes", + "Saving...": "Se salveaza...", + "Modified": "Modificat", + "Created": "Creat", + "Create": "Creaza", + "create": "creaza", + "Overview": "Prezentare generala", + "Details": "Detalii", + "Add Filter": "Adauga Filtru", + "Add Dashlet": "Adauga Dashlet", + "Add": "Adauga", + "Reset": "Reset", + "Menu": "Meniu", + "More": "More", + "Search": "Cautare", + "Only My": "Doar eu", + "Open": "Deschide", + "Admin": "Admin", + "About": "Despre", + "Refresh": "Reimprospatare", + "Remove": "Sterge", + "Options": "Optiuni", + "Username": "Nume Utilizator", + "Password": "Parola", + "Login": "Conectare", + "Log Out": "Deconectare", + "Preferences": "Preferinte", + "State": "Stat", + "Street": "Strada", + "Country": "Tara", + "City": "Oras", + "PostalCode": "Code Postal ", + "Followed": "Urmarit", + "Follow": "Urmareste", + "Clear Local Cache": "Stergere Cache Local", + "Actions": "Actiuni", + "Delete": "Sterge", + "Update": "Actualizare", + "Save": "Salveaza", + "Edit": "Editare", + "Cancel": "Renunta", + "Unlink": "Dezleaga", + "Mass Update": "Actualizeaza tot", + "Export": "Export", + "No Data": "Nu sunt date", + "All": "Toate", + "Active": "Activ", + "Inactive": "Inactiv", + "Write your comment here": "Scrie comentariul aici", + "Post": "Publica", + "Stream": "Curent", + "Show more": "Afiseaza mai mult", + "Dashlet Options": "Optiuni Dashlet", + "Full Form": "Forma intreaga", + "Insert": "Inserare", + "Person": "Persoana", + "First Name": "Prenume", + "Last Name": "Nume", + "Original": "Original", + "You": "Tu", + "you": "tu", + "change": "schimba", + "Primary": "Primar", + "Save Filters": "Save Filters", + "Administration": "Administration", + "Run Import": "Run Import", + "Duplicate": "Duplicat", + "Notifications": "Notifications" + }, + "messages": { + "notModified": "Nu ai modificat inregistrarea", + "duplicate": "Inregistrarea pe care o creezi pare sa fie duplicat", + "fieldIsRequired": "{field} este obligatoriu", + "fieldShouldBeEmail": "{field} trebuie sa fie o adresa de email valida", + "fieldShouldBeFloat": "{field} trebuie sa fie float valid", + "fieldShouldBeInt": "{field} trebuie sa fie intreg valid", + "fieldShouldBeDate": "{field} trebuie sa fie data valida", + "fieldShouldBeDatetime": "{field} trebuie sa fie data/timp valid", + "fieldShouldAfter": "{field} trebuie sa fie dupa {otherField}", + "fieldShouldBefore": "{field} trebuie sa fie inainte de {otherField}", + "fieldShouldBeBetween": "{field} trebuie sa fie intre {min} si {max}", + "fieldShouldBeLess": "{field} trebuie sa fie mai putin de {value}", + "fieldShouldBeGreater": "{field} trebuie sa fie mai mare de {value}", + "fieldBadPasswordConfirm": "{field} confirmat in mod necorespunzator" + }, + "boolFilters": { + "onlyMy": "Doar eu", + "open": "Deschide", + "active": "Activ" + }, + "fields": { + "name": "Nume", + "firstName": "Prenume", + "lastName": "Nume", + "salutationName": "Salut", + "assignedUser": "Utilizator alocat", + "emailAddress": "Email", + "assignedUserName": "Nume utilizator alocat", + "teams": "Echipe", + "createdAt": "Creat la", + "modifiedAt": "Modificat la", + "createdBy": "Creat de", + "modifiedBy": "Modificat de", + "title": "Titlu", + "dateFrom": "Data - de la", + "dateTo": "Data - pana la", + "autorefreshInterval": "Interval Auto-reinprospatare", + "displayRecords": "Afisare inregistrari" + }, + "links": { + "teams": "Echipe", + "users": "Utilizatori" + }, + "dashlets": { + "Stream": "Curent" + }, + "streamMessages": { + "create": "{user} creat {entityType} {entity}", + "createAssigned": "{user} creat {entityType} {entity} si alocat lui {assignee}", + "assign": "{user} alocat {entityType} {entity} lui {assignee}", + "post": "{user} publicat la {entityType} {entity}", + "attach": "{user} atasat la {entityType} {entity}", + "status": "{user} actualizat {field} pe {entityType} {entity}", + "update": "{user} actualizat {entityType} {entity}", + "createRelated": "{user} creat {relatedEntityType} {relatedEntity} si conectat cu {entityType} {entity}", + "emailReceived": "{entity} a fost primit pentru {entityType} {entity}", + + "createThis": "{user} a creat acest {entityType}", + "createAssignedThis": "{user} a creat acest {entityType} alocat lui {assignee}", + "assignThis": "{user} a alocat acest {entityType} lui {assignee}", + "postThis": "{user} publicat", + "attachThis": "{user} atasat", + "statusThis": "{user} a actualizat {field}", + "updateThis": "{user} a actualizat acest {entityType}", + "createRelatedThis": "{user} a creat {relatedEntityType} {relatedEntity} si l-a conectat cu {entityType}", + "emailReceivedThis": "{entity} a fost primit" + }, + "lists": { + "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] + }, + "options": { + "salutationName": { + "Mr.": "Dl.", + "Mrs.": "D-na.", + "Dr.": "Dr.", + "Drs.": "Dr." + }, + "language": { + "af_ZA": "Afrikaans", + "az_AZ": "Azerbaijani", + "be_BY": "Belarusian", + "bg_BG": "Bulgarian", + "bn_IN": "Bengali", + "bs_BA": "Bosnian", + "ca_ES": "Catalan", + "cs_CZ": "Czech", + "cy_GB": "Welsh", + "da_DK": "Danish", + "de_DE": "German", + "el_GR": "Greek", + "en_GB":"English (UK)", + "en_US":"English (US)", + "es_ES":"Spanish (Spain)", + "et_EE": "Estonian", + "eu_ES": "Basque", + "fa_IR": "Persian", + "fi_FI": "Finnish", + "fo_FO": "Faroese", + "fr_CA":"French (Canada)", + "fr_FR":"French (France)", + "ga_IE": "Irish", + "gl_ES": "Galician", + "gn_PY": "Guarani", + "he_IL": "Hebrew", + "hi_IN": "Hindi", + "hr_HR": "Croatian", + "hu_HU": "Hungarian", + "hy_AM": "Armenian", + "id_ID": "Indonesian", + "is_IS": "Icelandic", + "it_IT": "Italian", + "ja_JP": "Japanese", + "ka_GE": "Georgian", + "km_KH": "Khmer", + "ko_KR": "Korean", + "ku_TR": "Kurdish", + "lt_LT": "Lithuanian", + "lv_LV": "Latvian", + "mk_MK": "Macedonian", + "ml_IN": "Malayalam", + "ms_MY": "Malay", + "nb_NO":"Norwegian Bokmål", + "nn_NO": "Norwegian Nynorsk", + "ne_NP": "Nepali", + "nl_NL": "Dutch", + "pa_IN": "Punjabi", + "pl_PL": "Polish", + "ps_AF": "Pashto", + "pt_BR":"Portuguese (Brazil)", + "pt_PT":"Portuguese (Portugal)", + "ro_RO": "Romana", + "ru_RU": "Russian", + "sk_SK": "Slovak", + "sl_SI": "Slovene", + "sq_AL": "Albanian", + "sr_RS": "Serbian", + "sv_SE": "Swedish", + "sw_KE": "Swahili", + "ta_IN": "Tamil", + "te_IN": "Telugu", + "th_TH": "Thai", + "tl_PH": "Tagalog", + "tr_TR": "Turkish", + "uk_UA": "Ukrainian", + "ur_PK": "Urdu", + "vi_VN": "Vietnamese", + "zh_CN":"Simplified Chinese (China)", + "zh_HK":"Traditional Chinese (Hong Kong)", + "zh_TW":"Traditional Chinese (Taiwan)" + }, + "dateSearchRanges": { + "on": "Pornit", + "notOn": "Oprit", + "after": "Dupa", + "before": "Inainte", + "between": "Intre", + "today": "Astazi", + "past": "Past", + "future": "Future" + }, + "intSearchRanges": { + "equals": "Egal", + "notEquals": "Inegal", + "greaterThan": "Mai mare de", + "lessThan": "Mai mic de", + "greaterThanOrEquals": "Mai mare sau egal", + "lessThanOrEquals": "Mai mic sau egal", + "between": "Intre" + }, + "autorefreshInterval": { + "0": "Nici unul", + "0.5": "30 secunde", + "1": "1 minut", + "2": "2 minute", + "5": "5 minute", + "10": "10 minute" + }, + "phoneNumber": { + "Mobile": "Mobile", + "Office": "Office", + "Fax": "Fax", + "Home": "Home", + "Other": "Altele" + } + }, + "sets": { + "summernote": { + "NOTICE": "Puteti gasi traducerea aici: https://github.com/HackerWins/summernote/tree/master/lang", + "font":{ + "bold": "Bold", + "italic": "Italic", + "underline": "Subliniat", + "strike": "Strike", + "clear": "Sterge stil font", + "height": "Inaltime linie", + "name": "Familie Font ", + "size": "Marime Font" + }, + "image":{ + "image": "Imagine", + "insert": "Inserare Imagine", + "resizeFull": "Redimensionare completa", + "resizeHalf": "Redimensionare la jumatate", + "resizeQuarter": "Redimensionare la sfert", + "floatLeft": "Aliniere la stanga", + "floatRight": "Aliniere la dreapta", + "floatNone": "Fara aliniere", + "dragImageHere": "Trage imaginea aici", + "selectFromFiles": "Selecteaza din fisiere", + "url": "URL Imagine", + "remove": "Stergere imagine" + }, + "link":{ + "link": "Link", + "insert": "Inserare Link", + "unlink": "Dezleaga", + "edit": "Editare", + "textToDisplay": "Text de afisat", + "url":"To what URL should this link go?", + "openInNewWindow": "Deschidere in fereastra noua" + }, + "video":{ + "video": "Video", + "videoLink": "Link Video ", + "insert": "Inserare Video", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" + }, + "table":{ + "table": "Tabel" + }, + "hr":{ + "insert": "Inserare Linie Orizontala" + }, + "style":{ + "style": "Stil", + "normal": "Normal", + "blockquote": "Citat", + "pre": "Cod", + "h1": "Header 1", + "h2": "Header 2", + "h3": "Header 3", + "h4": "Header 4", + "h5": "Header 5", + "h6": "Header 6" + }, + "lists":{ + "unordered": "Lista neordonata", + "ordered": "Lista ordonata" + }, + "options":{ + "help": "Ajutor", + "fullscreen": "Ecran complet", + "codeview": "Vizualizare cod" + }, + "paragraph":{ + "paragraph": "Paragraf", + "outdent": "Neindentat", + "indent": "Indentat", + "left": "Aliniere stanga", + "center": "Aliniere centru", + "right": "Aliniere dreapta", + "justify": "Justify complet" + }, + "color":{ + "recent": "Culoarea recenta", + "more": "Mai multe culori", + "background": "Culoare fundal", + "foreground": "Culoare font", + "transparent": "Transparent", + "setTransparent": "Setare transparenta", + "reset": "Reset", + "resetToDefault": "Reinitializare setari" + }, + "shortcut":{ + "shortcuts": "Scurtaturi taste", + "close": "Inchide", + "textFormatting": "Formatare Text", + "action": "Actiune", + "paragraphFormatting": "Formatare Paragraf", + "documentStyle": "Stil Document " + }, + "history":{ + "undo": "Undo", + "redo": "Redo" + } + } + } } diff --git a/application/Espo/Resources/i18n/ro_RO/Note.json b/application/Espo/Resources/i18n/ro_RO/Note.json index 984df158ad..d61a78c7c9 100644 --- a/application/Espo/Resources/i18n/ro_RO/Note.json +++ b/application/Espo/Resources/i18n/ro_RO/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Publica", - "attachments": "Atasamente" - } + "fields": { + "post": "Publica", + "attachments": "Atasamente" + } } diff --git a/application/Espo/Resources/i18n/ro_RO/Preferences.json b/application/Espo/Resources/i18n/ro_RO/Preferences.json index 110f8a8eca..d3131eb5ea 100644 --- a/application/Espo/Resources/i18n/ro_RO/Preferences.json +++ b/application/Espo/Resources/i18n/ro_RO/Preferences.json @@ -1,32 +1,32 @@ { - "fields": { - "dateFormat": "Format Data ", - "timeFormat": "Format Timp", - "timeZone": "Zone Timp", - "weekStart": "Prima zi a saptamanii", - "thousandSeparator": "Separator mii", - "decimalMark": "Semn zecimal", - "defaultCurrency": "Valuta initiala", - "currencyList": "Lista valute", - "language": "Limba", - - "smtpServer": "Server", - "smtpPort": "Port", - "smtpAuth": "Autorizare", - "smtpSecurity": "Securitate", - "smtpUsername": "Nume Utilizator", - "emailAddress": "Email", - "smtpPassword": "Parola", - "smtpEmailAddress": "Adresa Email", - - "exportDelimiter": "Delimitator Export" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Duminica", - "1": "Luni" - } - } + "fields": { + "dateFormat": "Format Data ", + "timeFormat": "Format Timp", + "timeZone": "Zone Timp", + "weekStart": "Prima zi a saptamanii", + "thousandSeparator": "Separator mii", + "decimalMark": "Semn zecimal", + "defaultCurrency": "Valuta initiala", + "currencyList": "Lista valute", + "language": "Limba", + + "smtpServer": "Server", + "smtpPort": "Port", + "smtpAuth": "Autorizare", + "smtpSecurity": "Securitate", + "smtpUsername": "Nume Utilizator", + "emailAddress": "Email", + "smtpPassword": "Parola", + "smtpEmailAddress": "Adresa Email", + + "exportDelimiter": "Delimitator Export" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Duminica", + "1": "Luni" + } + } } diff --git a/application/Espo/Resources/i18n/ro_RO/Role.json b/application/Espo/Resources/i18n/ro_RO/Role.json index 6d7896e5ee..8109e36022 100644 --- a/application/Espo/Resources/i18n/ro_RO/Role.json +++ b/application/Espo/Resources/i18n/ro_RO/Role.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Nume", - "roles": "Roluri" - }, - "links": { - "users": "Utilizatori", - "teams": "Echipe" - }, - "labels": { - "Access": "Acces", - "Create Role": "Creare Rol" - }, - "options": { - "accessList": { - "not-set": "ne setat", - "enabled": "activat", - "disabled": "dezactivat" - }, - "levelList": { - "all": "toate", - "team": "echipa", - "own": "personal", - "no": "nu" - } - }, - "actions": { - "read": "Citeste", - "edit": "Editare", - "delete": "Sterge" - } + "fields": { + "name": "Nume", + "roles": "Roluri" + }, + "links": { + "users": "Utilizatori", + "teams": "Echipe" + }, + "labels": { + "Access": "Acces", + "Create Role": "Creare Rol" + }, + "options": { + "accessList": { + "not-set": "ne setat", + "enabled": "activat", + "disabled": "dezactivat" + }, + "levelList": { + "all": "toate", + "team": "echipa", + "own": "personal", + "no": "nu" + } + }, + "actions": { + "read": "Citeste", + "edit": "Editare", + "delete": "Sterge" + } } diff --git a/application/Espo/Resources/i18n/ro_RO/ScheduledJob.json b/application/Espo/Resources/i18n/ro_RO/ScheduledJob.json index 0f15529c68..6a71931c20 100644 --- a/application/Espo/Resources/i18n/ro_RO/ScheduledJob.json +++ b/application/Espo/Resources/i18n/ro_RO/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Nume", - "status": "Status", - "job": "Activitate", - "scheduling": "Scheduling (crontab notation)" - }, - "links": { - "log": "Log" - }, - "labels": { - "Create ScheduledJob": "Creare activiate programata" - }, - "options": { - "job": { - "CheckInboundEmails": "Verificare Intrari Email", - "Cleanup": "Curatare" - }, - "cronSetup": { - "linux": "Nota: Adauga acesta linie in fisierul crontab pentru a rula Activitatile programate:", - "mac": "Nota: Adauga acesta linie in fisierul crontab pentru a rula Activitatile programate:", - "windows": "Nota: Creaza un fisier batch care sa contina urmatoarele comenzi pentru a rula Activitatile programate, folosind Windows Scheduled Tasks:", - "default": "Note: Add this command to Cron Job (Scheduled Task):" - }, - "status": { - "Active": "Activ", - "Inactive": "Inactiv" - } - } + "fields": { + "name": "Nume", + "status": "Status", + "job": "Activitate", + "scheduling": "Scheduling (crontab notation)" + }, + "links": { + "log": "Log" + }, + "labels": { + "Create ScheduledJob": "Creare activiate programata" + }, + "options": { + "job": { + "CheckInboundEmails": "Verificare Intrari Email", + "Cleanup": "Curatare" + }, + "cronSetup": { + "linux": "Nota: Adauga acesta linie in fisierul crontab pentru a rula Activitatile programate:", + "mac": "Nota: Adauga acesta linie in fisierul crontab pentru a rula Activitatile programate:", + "windows": "Nota: Creaza un fisier batch care sa contina urmatoarele comenzi pentru a rula Activitatile programate, folosind Windows Scheduled Tasks:", + "default": "Note: Add this command to Cron Job (Scheduled Task):" + }, + "status": { + "Active": "Activ", + "Inactive": "Inactiv" + } + } } diff --git a/application/Espo/Resources/i18n/ro_RO/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/ro_RO/ScheduledJobLogRecord.json index 3bd9a58ad6..3d5204c99d 100644 --- a/application/Espo/Resources/i18n/ro_RO/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/ro_RO/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Status", - "executionTime": "Timp Executie" - } + "fields": { + "status": "Status", + "executionTime": "Timp Executie" + } } diff --git a/application/Espo/Resources/i18n/ro_RO/Settings.json b/application/Espo/Resources/i18n/ro_RO/Settings.json index c4a3f0c237..3168ac0798 100644 --- a/application/Espo/Resources/i18n/ro_RO/Settings.json +++ b/application/Espo/Resources/i18n/ro_RO/Settings.json @@ -1,64 +1,64 @@ { - "fields": { - "useCache": "Foloseste Cache", - "dateFormat": "Format Data ", - "timeFormat": "Format Timp", - "timeZone": "Zone Timp", - "weekStart": "Prima zi a saptamanii", - "thousandSeparator": "Separator mii", - "decimalMark": "Semn zecimal", - "defaultCurrency": "Valuta initiala", - "currencyList": "Lista valute", - "language": "Limba", - - "companyLogo": "Logo Companie", - - "smtpServer": "Server", - "smtpPort": "Port", - "smtpAuth": "Autorizare", - "smtpSecurity": "Securitate", - "smtpUsername": "Nume Utilizator", - "emailAddress": "Email", - "smtpPassword": "Parola", - "outboundEmailFromName": "De la", - "outboundEmailFromAddress": "De la adresa", - "outboundEmailIsShared": "Este Partajat", - - "recordsPerPage": "Inregistrari pe pagina", - "recordsPerPageSmall": "Records Per Page (Small)", - "tabList": "Lista Tab-uri", - "quickCreateList": "Creare lista rapida", - - "exportDelimiter": "Delimitator Export", - - "authenticationMethod": "Authentication Method", - "ldapHost": "Gazda", - "ldapPort": "Port", - "ldapAuth": "Autorizare", - "ldapUsername": "Nume Utilizator", - "ldapPassword": "Parola", - "ldapBindRequiresDn": "Bind Requires Dn", - "ldapBaseDn": "Base Dn", - "ldapAccountCanonicalForm": "Account Canonical Form", - "ldapAccountDomainName": "Account Domain Name", - "ldapTryUsernameSplit": "Try Username Split", - "ldapCreateEspoUser": "Create User in EspoCRM", - "ldapSecurity": "Securitate", - "ldapUserLoginFilter": "User Login Filter", - "ldapAccountDomainNameShort": "Account Domain Name Short", - "ldapOptReferrals": "Opt Referrals", - "disableExport": "Disable Export (only admin is allowed)" - }, - "options": { - "weekStart": { - "0": "Duminica", - "1": "Luni" - } - }, - "labels": { - "System": "Sistem", - "Locale": "Localizare", - "SMTP": "SMTP", - "Configuration": "Configuratie" - } + "fields": { + "useCache": "Foloseste Cache", + "dateFormat": "Format Data ", + "timeFormat": "Format Timp", + "timeZone": "Zone Timp", + "weekStart": "Prima zi a saptamanii", + "thousandSeparator": "Separator mii", + "decimalMark": "Semn zecimal", + "defaultCurrency": "Valuta initiala", + "currencyList": "Lista valute", + "language": "Limba", + + "companyLogo": "Logo Companie", + + "smtpServer": "Server", + "smtpPort": "Port", + "smtpAuth": "Autorizare", + "smtpSecurity": "Securitate", + "smtpUsername": "Nume Utilizator", + "emailAddress": "Email", + "smtpPassword": "Parola", + "outboundEmailFromName": "De la", + "outboundEmailFromAddress": "De la adresa", + "outboundEmailIsShared": "Este Partajat", + + "recordsPerPage": "Inregistrari pe pagina", + "recordsPerPageSmall": "Records Per Page (Small)", + "tabList": "Lista Tab-uri", + "quickCreateList": "Creare lista rapida", + + "exportDelimiter": "Delimitator Export", + + "authenticationMethod": "Authentication Method", + "ldapHost": "Gazda", + "ldapPort": "Port", + "ldapAuth": "Autorizare", + "ldapUsername": "Nume Utilizator", + "ldapPassword": "Parola", + "ldapBindRequiresDn": "Bind Requires Dn", + "ldapBaseDn": "Base Dn", + "ldapAccountCanonicalForm": "Account Canonical Form", + "ldapAccountDomainName": "Account Domain Name", + "ldapTryUsernameSplit": "Try Username Split", + "ldapCreateEspoUser": "Create User in EspoCRM", + "ldapSecurity": "Securitate", + "ldapUserLoginFilter": "User Login Filter", + "ldapAccountDomainNameShort": "Account Domain Name Short", + "ldapOptReferrals": "Opt Referrals", + "disableExport": "Disable Export (only admin is allowed)" + }, + "options": { + "weekStart": { + "0": "Duminica", + "1": "Luni" + } + }, + "labels": { + "System": "Sistem", + "Locale": "Localizare", + "SMTP": "SMTP", + "Configuration": "Configuratie" + } } diff --git a/application/Espo/Resources/i18n/ro_RO/Team.json b/application/Espo/Resources/i18n/ro_RO/Team.json index 163c71b687..d2175de24b 100644 --- a/application/Espo/Resources/i18n/ro_RO/Team.json +++ b/application/Espo/Resources/i18n/ro_RO/Team.json @@ -1,12 +1,12 @@ { - "fields": { - "name": "Nume", - "roles": "Roluri" - }, - "links": { - "users": "Utilizatori" - }, - "labels": { - "Create Team": "Creare Echipa" - } + "fields": { + "name": "Nume", + "roles": "Roluri" + }, + "links": { + "users": "Utilizatori" + }, + "labels": { + "Create Team": "Creare Echipa" + } } diff --git a/application/Espo/Resources/i18n/ro_RO/User.json b/application/Espo/Resources/i18n/ro_RO/User.json index d056952a9a..7bf87d1d7d 100644 --- a/application/Espo/Resources/i18n/ro_RO/User.json +++ b/application/Espo/Resources/i18n/ro_RO/User.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Nume", - "userName": "Nume Utilizator", - "title": "Titlu", - "isAdmin": "Este Admin", - "defaultTeam": "Echipa Initiala", - "emailAddress": "Email", - "phoneNumber": "Telefon", - "roles": "Roluri", - "password": "Parola", - "passwordConfirm": "Confirmare Parola", - "newPassword": "Parola Noua" - }, - "links": { - "teams": "Echipe", - "roles": "Roluri" - }, - "labels": { - "Create User": "Creare Utilizator", - "Generate": "Generare", - "Access": "Acces", - "Preferences": "Preferinte", - "Change Password": "Schimbare Parola" - }, - "messages": { - "passwordWillBeSent": "Parola va fi trimisa in email-ul utilizatorului.", - "accountInfoEmailSubject": "Informatii cont", - "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", - "passwordChanged": "Parola a fost schimbata" - } + "fields": { + "name": "Nume", + "userName": "Nume Utilizator", + "title": "Titlu", + "isAdmin": "Este Admin", + "defaultTeam": "Echipa Initiala", + "emailAddress": "Email", + "phoneNumber": "Telefon", + "roles": "Roluri", + "password": "Parola", + "passwordConfirm": "Confirmare Parola", + "newPassword": "Parola Noua" + }, + "links": { + "teams": "Echipe", + "roles": "Roluri" + }, + "labels": { + "Create User": "Creare Utilizator", + "Generate": "Generare", + "Access": "Acces", + "Preferences": "Preferinte", + "Change Password": "Schimbare Parola" + }, + "messages": { + "passwordWillBeSent": "Parola va fi trimisa in email-ul utilizatorului.", + "accountInfoEmailSubject": "Informatii cont", + "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", + "passwordChanged": "Parola a fost schimbata" + } } diff --git a/application/Espo/Resources/i18n/ru_RU/Admin.json b/application/Espo/Resources/i18n/ru_RU/Admin.json index 2e0e205d9a..93d749555a 100644 --- a/application/Espo/Resources/i18n/ru_RU/Admin.json +++ b/application/Espo/Resources/i18n/ru_RU/Admin.json @@ -1,128 +1,128 @@ { - "labels": { - "Enabled": "Enabled", - "Disabled": "Disabled", - "System": "System", - "Users": "Users", - "Email": "Email", - "Data": "Data", - "Customization": "Customization", - "Available Fields": "Available Fields", - "Layout": "Layout", - "Enabled": "Enabled", - "Disabled": "Disabled", - "Add Panel": "Add Panel", - "Add Field": "Add Field", - "Settings": "Settings", - "Scheduled Jobs": "Scheduled Jobs", - "Upgrade": "Upgrade", - "Clear Cache": "Clear Cache", - "Rebuild": "Rebuild", - "Users": "Users", - "Teams": "Teams", - "Roles": "Roles", - "Outbound Emails": "Outbound Emails", - "Inbound Emails": "Inbound Emails", - "Email Templates": "Email Templates", - "Import": "Import", - "Layout Manager": "Layout Manager", - "Field Manager": "Field Manager", - "User Interface": "User Interface", - "Auth Tokens": "Auth Tokens", - "Authentication": "Authentication", - "Currency": "Currency" - }, - "layouts": { - "list": "List", - "detail": "Detail", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Search Filters", - "massUpdate": "Mass Update", - "relationships": "Relationships" - }, - "fieldTypes": { - "address": "Address", - "array": "Array", - "foreign": "Foreign", - "duration": "Duration", - "password": "Password", - "parsonName": "Person Name", - "autoincrement": "Auto-increment", - "bool": "Bool", - "currency": "Currency", - "date": "Date", - "datetime": "DateTime", - "email": "Email", - "enum": "Enum", - "enumInt": "Enum Integer", - "enumFloat": "Enum Float", - "float": "Float", - "int": "Int", - "link": "Link", - "linkMultiple": "Link Multiple", - "linkParent": "Link Parent", - "multienim": "Multienum", - "phone": "Phone", - "text": "Text", - "url": "Url", - "varchar": "Varchar", - "file": "File", - "image": "Image" - }, - "fields": { - "type": "Type", - "name": "Name", - "label": "Label", - "required": "Required", - "default": "Default", - "maxLength": "Max Length", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Link", - "field": "Field", - "min": "Min", - "max": "Max", - "translation": "Translation", - "previewSize": "Preview Size" - }, - "messages": { - "upgradeVersion": "Your EspoCRM will be upgraded to version {version}. This can take some time.", - "upgradeDone": "Your EspoCRM has been upgraded to version {version}. Refresh your browser window.", - "upgradeBackup": "We recommend you to make backup of your EspoCRM files and data before upgrade.", - "thousandSeparatorEqualsDecimalMark": "Thousand separator can not be same as decimal mark", - "userHasNoEmailAddress": "User has not email address.", - "selectEntityType": "Select entity type in the left menu.", - "selectUpgradePackage": "Select uprade package", - "selectLayout": "Select needed layout in the left menu and edit it." - }, - "descriptions": { - "settings": "System settings of application.", - "scheduledJob": "Jobs which are executed by cron.", - "upgrade": "Upgrade EspoCRM.", - "clearCache": "Clear all backend cache.", - "rebuild": "Rebuild backend and clear cache.", - "users": "Users management.", - "teams": "Teams management.", - "roles": "Roles management.", - "outboundEmails": "SMTP settings for outgoing emails.", - "inboundEmails": "Group IMAP email accouts. Email import and Email-to-Case.", - "emailTemplates": "Templates for outbound emails.", - "import": "Import data from CSV file.", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Create new fields or customize existing ones.", - "userInterface": "Configure UI.", - "authTokens": "Active auth sessions. IP address and last access date.", - "authentication": "Authentication settings.", - "currency": "Currency settings and rates." - }, - "options": { - "previewSize": { - "x-small": "X-Small", - "small": "Small", - "medium": "Medium", - "large": "Large" - } - } + "labels": { + "Enabled": "Enabled", + "Disabled": "Disabled", + "System": "System", + "Users": "Users", + "Email": "Email", + "Data": "Data", + "Customization": "Customization", + "Available Fields": "Available Fields", + "Layout": "Layout", + "Enabled": "Enabled", + "Disabled": "Disabled", + "Add Panel": "Add Panel", + "Add Field": "Add Field", + "Settings": "Settings", + "Scheduled Jobs": "Scheduled Jobs", + "Upgrade": "Upgrade", + "Clear Cache": "Clear Cache", + "Rebuild": "Rebuild", + "Users": "Users", + "Teams": "Teams", + "Roles": "Roles", + "Outbound Emails": "Outbound Emails", + "Inbound Emails": "Inbound Emails", + "Email Templates": "Email Templates", + "Import": "Import", + "Layout Manager": "Layout Manager", + "Field Manager": "Field Manager", + "User Interface": "User Interface", + "Auth Tokens": "Auth Tokens", + "Authentication": "Authentication", + "Currency": "Currency" + }, + "layouts": { + "list": "List", + "detail": "Detail", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Search Filters", + "massUpdate": "Mass Update", + "relationships": "Relationships" + }, + "fieldTypes": { + "address": "Address", + "array": "Array", + "foreign": "Foreign", + "duration": "Duration", + "password": "Password", + "parsonName": "Person Name", + "autoincrement": "Auto-increment", + "bool": "Bool", + "currency": "Currency", + "date": "Date", + "datetime": "DateTime", + "email": "Email", + "enum": "Enum", + "enumInt": "Enum Integer", + "enumFloat": "Enum Float", + "float": "Float", + "int": "Int", + "link": "Link", + "linkMultiple": "Link Multiple", + "linkParent": "Link Parent", + "multienim": "Multienum", + "phone": "Phone", + "text": "Text", + "url": "Url", + "varchar": "Varchar", + "file": "File", + "image": "Image" + }, + "fields": { + "type": "Type", + "name": "Name", + "label": "Label", + "required": "Required", + "default": "Default", + "maxLength": "Max Length", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Link", + "field": "Field", + "min": "Min", + "max": "Max", + "translation": "Translation", + "previewSize": "Preview Size" + }, + "messages": { + "upgradeVersion": "Your EspoCRM will be upgraded to version {version}. This can take some time.", + "upgradeDone": "Your EspoCRM has been upgraded to version {version}. Refresh your browser window.", + "upgradeBackup": "We recommend you to make backup of your EspoCRM files and data before upgrade.", + "thousandSeparatorEqualsDecimalMark": "Thousand separator can not be same as decimal mark", + "userHasNoEmailAddress": "User has not email address.", + "selectEntityType": "Select entity type in the left menu.", + "selectUpgradePackage": "Select uprade package", + "selectLayout": "Select needed layout in the left menu and edit it." + }, + "descriptions": { + "settings": "System settings of application.", + "scheduledJob": "Jobs which are executed by cron.", + "upgrade": "Upgrade EspoCRM.", + "clearCache": "Clear all backend cache.", + "rebuild": "Rebuild backend and clear cache.", + "users": "Users management.", + "teams": "Teams management.", + "roles": "Roles management.", + "outboundEmails": "SMTP settings for outgoing emails.", + "inboundEmails": "Group IMAP email accouts. Email import and Email-to-Case.", + "emailTemplates": "Templates for outbound emails.", + "import": "Import data from CSV file.", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Create new fields or customize existing ones.", + "userInterface": "Configure UI.", + "authTokens": "Active auth sessions. IP address and last access date.", + "authentication": "Authentication settings.", + "currency": "Currency settings and rates." + }, + "options": { + "previewSize": { + "x-small": "X-Small", + "small": "Small", + "medium": "Medium", + "large": "Large" + } + } } diff --git a/application/Espo/Resources/i18n/ru_RU/AuthToken.json b/application/Espo/Resources/i18n/ru_RU/AuthToken.json index 7dbbd53cf7..15bc98d145 100644 --- a/application/Espo/Resources/i18n/ru_RU/AuthToken.json +++ b/application/Espo/Resources/i18n/ru_RU/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "Пользователь", - "ipAddress": "IP -адрес", - "lastAccess": "Дата последнего подключения", - "createdAt": "Дата входа" + "fields": { + "user": "Пользователь", + "ipAddress": "IP -адрес", + "lastAccess": "Дата последнего подключения", + "createdAt": "Дата входа" - } + } } diff --git a/application/Espo/Resources/i18n/ru_RU/Email.json b/application/Espo/Resources/i18n/ru_RU/Email.json index 39b0f3b030..ad173690a3 100644 --- a/application/Espo/Resources/i18n/ru_RU/Email.json +++ b/application/Espo/Resources/i18n/ru_RU/Email.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Тема/субъект", - "parent": "Источник", - "status": "статус", - "dateSent": "Дата отправки", - "from": "От", - "to": "К", - "cc": "CC", - "bcc": "BCC", - "isHtml": "Is Html", - "body": "Тело", - "subject": "Тема", - "attachments": "Вложения", - "selectTemplate": "Выбрать шаблон", - "fromEmailAddress": "С адреса", - "toEmailAddresses": "На андрес", - "emailAddress": "E-mail адрес" - }, - "links": { - }, - "options": { - "Draft": "Черновик", - "Sending": "Отправляется", - "Sent": "Отправлено", - "Archived": "В архиве" - }, - "labels": { - "Create Email": "Отправить письмо в архив", - "Compose": "Новое сообщение" - }, - "presetFilters": { - "sent": "Отправлено", - "archived": "В архиве" - } + "fields": { + "name": "Тема/субъект", + "parent": "Источник", + "status": "статус", + "dateSent": "Дата отправки", + "from": "От", + "to": "К", + "cc": "CC", + "bcc": "BCC", + "isHtml": "Is Html", + "body": "Тело", + "subject": "Тема", + "attachments": "Вложения", + "selectTemplate": "Выбрать шаблон", + "fromEmailAddress": "С адреса", + "toEmailAddresses": "На андрес", + "emailAddress": "E-mail адрес" + }, + "links": { + }, + "options": { + "Draft": "Черновик", + "Sending": "Отправляется", + "Sent": "Отправлено", + "Archived": "В архиве" + }, + "labels": { + "Create Email": "Отправить письмо в архив", + "Compose": "Новое сообщение" + }, + "presetFilters": { + "sent": "Отправлено", + "archived": "В архиве" + } } diff --git a/application/Espo/Resources/i18n/ru_RU/EmailAddress.json b/application/Espo/Resources/i18n/ru_RU/EmailAddress.json index ed1ab64ad4..66cb46e433 100644 --- a/application/Espo/Resources/i18n/ru_RU/EmailAddress.json +++ b/application/Espo/Resources/i18n/ru_RU/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Главные", - "Opted Out": "Отписка", - "Invalid": "Неверный адрес" - } + "labels": { + "Primary": "Главные", + "Opted Out": "Отписка", + "Invalid": "Неверный адрес" + } } diff --git a/application/Espo/Resources/i18n/ru_RU/EmailTemplate.json b/application/Espo/Resources/i18n/ru_RU/EmailTemplate.json index 378dfcd6f5..37cfbcfb73 100644 --- a/application/Espo/Resources/i18n/ru_RU/EmailTemplate.json +++ b/application/Espo/Resources/i18n/ru_RU/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Имя", - "status": "Статус", - "isHtml": "Html", - "body": "Основная часть", - "subject": "Тема", - "attachments": "Вложения", - "insertField": "Вставить поле" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Создать шаблон письма" - } + "fields": { + "name": "Имя", + "status": "Статус", + "isHtml": "Html", + "body": "Основная часть", + "subject": "Тема", + "attachments": "Вложения", + "insertField": "Вставить поле" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Создать шаблон письма" + } } diff --git a/application/Espo/Resources/i18n/ru_RU/Global.json b/application/Espo/Resources/i18n/ru_RU/Global.json index f693948c1f..a22914893e 100644 --- a/application/Espo/Resources/i18n/ru_RU/Global.json +++ b/application/Espo/Resources/i18n/ru_RU/Global.json @@ -1,335 +1,335 @@ { - "scopeNames": { - "Email": "Письмо", - "User": "Пользователь", - "Team": "Группа", - "Role": "Роль", - "EmailTemplate": "Шаблон письма", - "OutboundEmail": "Исходящее письмо", - "ScheduledJob": "Запланированная работа" - }, - "scopeNamesPlural": { - "Email": "Письма", - "User": "Пользователи", - "Team": "Группы", - "Role": "Роль", - "EmailTemplate": "Шаблоны писем", - "OutboundEmail": "Исходящие письма", - "ScheduledJob": "Запланированные задачи" - }, - "labels": {"Misc": "Разное", - "Merge": "Объединить", - "None": "Нет", - "by": "по", - "Saved": "Сохранено", - "Error": "Ошибка", - "Select": "Выбрать", - "Not valid": "Неправильный", - "Please wait...": "Пожалуйста, подождите...", - "Please wait": "Пожалуйста, подождите", - "Loading...": "Загрузка...", - "Uploading...": "Загружается...", - "Sending...": "Отправляется...", - "Removed": "Удалено", - "Posted": "Добавлено", - "Linked": "Ссылка добавлена", - "Unlinked": "Ссылка удалена", - "Access denied": "В доступе отказано", - "Access": "Доступ", - "Are you sure?": "Вы уверены?", - "Record has been removed": "Запись удалена", - "Wrong username/password": "Неверное имя пользователя/пароль", - "Post cannot be empty": "Сообщение не может быть пустым", - "Removing...": "Удаляется...", - "Unlinking...": "Ссылка удаляется...", - "Posting...": "Размещается...", - "Username can not be empty!": "Имя пользователя не может быть пустым!", - "Cache is not enabled": "Кэш не подключен", - "Cache has been cleared": "Кэш очищен", - "Rebuild has been done": "Восстановление выполнено", - "Saving...": "Сохраняется...", - "Modified": "Изменено", - "Created": "Создано", - "Create": "Создать", - "create": "создать", - "Overview": "Обзор", - "Details": "Описание", - "Add Filter": "Добавить фильтр", - "Add Dashlet": "Добавить панель", - "Add": "Добавить", - "Reset": "Сбросить", - "Menu": "Меню", - "More": "Больше", - "Search": "Искать", - "Only My": "Тлько мои", - "Open": "Открыть", - "Admin": "Администратор", - "About": "О программе", - "Refresh": "Обновить", - "Remove": "Удалить", - "Options": "Настройки", - "Username": "Имя пользователя", - "Password": "Пароль", - "Login": "Войти", - "Log Out": "Выйти", - "Preferences": "Настройки", - "State": "Регион", - "Street": "Улица", - "Country": "Страна", - "City": "Город", - "PostalCode": "Почтовый индекс", - "Followed": "Отслеживаемый", - "Follow": "Перейти", - "Clear Local Cache": "Очистить локальный кэш", - "Actions": "Действия", - "Delete": "Удалить", - "Update": "Обновить", - "Save": "Сохранить", - "Edit": "Редактировать", - "Cancel": "Отменить", - "Unlink": "Убрать ссылку", - "Mass Update": "Глобальное редактирование", - "Export": "Экспортировать", - "No Data": "Нет данных", - "All": "Все", - "Active": "Активный", - "Inactive": "Неактивный", - "Write your comment here": "Оставьте свою заметку здесь", - "Post": "Разместить", - "Stream": "Лента", - "Show more": "Загрузить еще", - "Dashlet Options": "Настройки панели", - "Full Form": "Раширенная форма", - "Insert": "Вставить", - "Person": "Личность", - "First Name": "Имя", - "Last Name": "Фамилия", - "Original": "Оригинальный", - "You": "Вы", - "you": "вы", - "change": "изменить", - "Primary": "Главная", - "Save Filters": "Сохранить фильтры", - "Administration": "Администрирование", - "Run Import": "Импортировать", - "Duplicate": "Копия", - "Notifications": "Оповещения", - "Mark all read": "Пометить все как прочитанное", - "See more": "Подробнее" - }, - "messages": { - "notModified": "Вы не внесли изменения в запись", - "duplicate": "Созданная вами запись дублировалась", - "fieldIsRequired": "{field} необходимы", - "fieldShouldBeEmail": "{field} должно быть правильным e-mail", - "fieldShouldBeFloat": "{field} должно быть верное дробное число", - "fieldShouldBeInt": "{field} должно быть верное целое число", - "fieldShouldBeDate": "{field} должна быть верная дата", - "fieldShouldBeDatetime": "{field} должна быть верная дата/время", - "fieldShouldAfter": "{field} должно быть после {otherField}", - "fieldShouldBefore": "{field} должно быть до {otherField}", - "fieldShouldBeBetween": "{field} должно быть между {min} и {max}", - "fieldShouldBeLess": "{field} должно быть меньше чем {value}", - "fieldShouldBeGreater": "{field} должно быть больше чем {value}", - "fieldBadPasswordConfirm": "{field} подтверждено неверно", - "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", - "assignmentEmailNotificationBody": "{assignerUserName} назначил {entityType} '{Entity.name}' на вас\n\n{recordUrl}", - "confirmation": "Вы уверены?", - "removeRecordConfirmation": "Удалить запись?", - "unlinkRecordConfirmation": "Убрать связь?", - "removeSelectedRecordsConfirmation": "Удалить выбранные записи?" - }, - "boolFilters": { - "onlyMy": "Только мои", - "open": "Открыть", - "active": "Активный" - }, - "fields": { - "name": "Полное имя", - "firstName": "Имя", - "lastName": "Фамилия", - "salutationName": "Пол", - "assignedUser": "Выбранный пользователь", - "emailAddress": "E-mail адрес", - "assignedUserName": "Имя выбранного пользователя", - "teams": "Группы", - "createdAt": "Создан в", - "modifiedAt": "Изменен в", - "createdBy": "Создан (кем)", - "modifiedBy": "Изменен (кем)", - "title": "Название", - "dateFrom": "Дата от", - "dateTo": "Дата к", - "autorefreshInterval": "Интервал авто-обновления", - "displayRecords": "Отобразить записи" - }, - "links": { - "teams": "Группы", - "users": "Пользователи" - }, - "dashlets": { - "Stream": "Лента" - }, - "streamMessages": { - "create": "{user} создал {entityType} {entity}", - "createAssigned": "{user} создал {entityType} {entity} присвоен {assignee}", - "assign": "{user} присвоено {entityType} {entity} к {assignee}", - "post": "{user} опубликован на {entityType} {entity}", - "attach": "{user} прикреплен {entityType} {entity}", - "status": "{user} обновлен {field} на {entityType} {entity}", - "update": "{user} обновлен {entityType} {entity}", - "createRelated": "{user} создан {relatedEntityType} {relatedEntity} привязан к {entityType} {entity}", - "emailReceived": "{entity} было получено для {entityType} {entity}", - - "createThis": "{user} создал это {entityType}", - "createAssignedThis": "{user} создал это {entityType} присвоен {assignee}", - "assignThis": "{user} присвоено это {entityType} к {assignee}", - "postThis": "{user} добавил", - "attachThis": "{user} добавил", - "statusThis": "{user} обновил {field}", - "updateThis": "{user} обновил это {entityType}", - "createRelatedThis": "{user} создал {relatedEntityType} {relatedEntity} привязал к этому {entityType}", - "emailReceivedThis": "{entity} было получено" - }, - "lists": { - "monthNames": ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"], - "monthNamesShort": ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"], - "dayNames": ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], - "dayNamesShort": ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"], - "dayNamesMin": ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] - }, - "options": { - "salutationName": { - "Mr.": "Г-н.", - "Mrs.": "Г-жа.", - "Dr.": "Д-р.", - "Drs.": "Д-р.", - "male": "Муж. ", - "female": "Жен. " - }, - "language": { - "af_ZA":"Африкаанс", - "az_AZ":"Азербайджанский", - "be_BY":"Белорусский", - "bg_BG":"Болгарский", - "bn_IN":"Бенгальский", - "bs_BA":"Боснийский", - "ca_ES":"Каталонский", - "cs_CZ":"Чешский", - "cy_GB":"Валлийский", - "da_DK":"Датский", - "de_DE":"Немецкий", - "el_GR":"Греческий", - "en_GB":"Английский (UK)", - "en_US":"Английский (US)", - "es_ES":"Испанский (Испания)", - "et_EE":"Эстонский", - "eu_ES":"Баскский", - "fa_IR":"Персидский", - "fi_FI":"Финский", - "fo_FO":"Фарерский", - "fr_CA":"Французский (Канада)", - "fr_FR":"Французский (Франция)", - "ga_IE":"Ирландский", - "gl_ES":"Галицкий", - "gn_PY":"Гуарани", - "he_IL":"Иврит", - "hi_IN":"Хинди", - "hr_HR":"Хорватский", - "hu_HU":"Венгерский", - "hy_AM":"Армянский", - "id_ID":"Индонезийский", - "is_IS":"Исландский", - "it_IT":"Итальянский", - "ja_JP":"Японский", - "ka_GE":"Грузинский", - "km_KH":"Кхмерийский", - "ko_KR":"Корейский", - "ku_TR":"Курдский", - "lt_LT":"Литовский", - "lv_LV":"Латвийский", - "mk_MK":"Македонский", - "ml_IN":"Малайялам", - "ms_MY":"Малайский", - "nb_NO":"Норвежский букмол", - "nn_NO":"Норвежский нюнорск", - "ne_NP":"Непальский", - "nl_NL":"Нидерландский", - "pa_IN":"Панджабский", - "pl_PL":"Польский", - "ps_AF":"Пушту", - "pt_BR":"Португальский (Бразилия)", - "pt_PT":"Португальский (Португалия)", - "ro_RO":"Румынский", - "ru_RU":"Русский", - "sk_SK":"Словацкий", - "sl_SI":"Словенский", - "sq_AL":"Албанский", - "sr_RS":"Сербский", - "sv_SE":"Шведский", - "sw_KE":"Суахили", - "ta_IN":"Тамильский", - "te_IN":"Телугу", - "th_TH":"Тайский", - "tl_PH":"Тагальский", - "tr_TR":"Турецкий", - "uk_UA":"Украинский", - "ur_PK":"Урду", - "vi_VN":"Вьетнамский", - "zh_CN":"Упрощенный китайский (Китай)", - "zh_HK":"Традиционный китайский (Гонконг)", - "zh_TW":"Традиционный китайский (Тайвань)" - }, - "dateSearchRanges": { - "on": "На", - "notOn": "Не на", - "after": "После", - "before": "До", - "between": "Между", - "today": "Сегодня", - "past": "Прошлое", - "future": "Будущее" - }, - "intSearchRanges": { - "equals": "Равняется", - "notEquals": "Не равняется", - "greaterThan": "Больше чем", - "lessThan": "Меньше чем", - "greaterThanOrEquals": "Больше чем или равняется", - "lessThanOrEquals": "Меньше чем или равняется", - "between": "Между" - }, - "autorefreshInterval": { - "0": "Нет", - "0.5": "30 секунд", - "1": "1 минута", - "2": "2 минуты", - "5": "5 минут", - "10": "10 минут" - }, - "phoneNumber": { - "Mobile": "Мобильный", - "Office": "Офисный", - "Fax": "Факс", - "Home": "Домашний", - "Other": "Дополнительно" - } - }, - "sets": { - "summernote": { - "NOTICE": "You can find translation here: https://github.com/HackerWins/summernote/tree/master/lang", - "font":{ - "bold": "Полужирный", + "scopeNames": { + "Email": "Письмо", + "User": "Пользователь", + "Team": "Группа", + "Role": "Роль", + "EmailTemplate": "Шаблон письма", + "OutboundEmail": "Исходящее письмо", + "ScheduledJob": "Запланированная работа" + }, + "scopeNamesPlural": { + "Email": "Письма", + "User": "Пользователи", + "Team": "Группы", + "Role": "Роль", + "EmailTemplate": "Шаблоны писем", + "OutboundEmail": "Исходящие письма", + "ScheduledJob": "Запланированные задачи" + }, + "labels": {"Misc": "Разное", + "Merge": "Объединить", + "None": "Нет", + "by": "по", + "Saved": "Сохранено", + "Error": "Ошибка", + "Select": "Выбрать", + "Not valid": "Неправильный", + "Please wait...": "Пожалуйста, подождите...", + "Please wait": "Пожалуйста, подождите", + "Loading...": "Загрузка...", + "Uploading...": "Загружается...", + "Sending...": "Отправляется...", + "Removed": "Удалено", + "Posted": "Добавлено", + "Linked": "Ссылка добавлена", + "Unlinked": "Ссылка удалена", + "Access denied": "В доступе отказано", + "Access": "Доступ", + "Are you sure?": "Вы уверены?", + "Record has been removed": "Запись удалена", + "Wrong username/password": "Неверное имя пользователя/пароль", + "Post cannot be empty": "Сообщение не может быть пустым", + "Removing...": "Удаляется...", + "Unlinking...": "Ссылка удаляется...", + "Posting...": "Размещается...", + "Username can not be empty!": "Имя пользователя не может быть пустым!", + "Cache is not enabled": "Кэш не подключен", + "Cache has been cleared": "Кэш очищен", + "Rebuild has been done": "Восстановление выполнено", + "Saving...": "Сохраняется...", + "Modified": "Изменено", + "Created": "Создано", + "Create": "Создать", + "create": "создать", + "Overview": "Обзор", + "Details": "Описание", + "Add Filter": "Добавить фильтр", + "Add Dashlet": "Добавить панель", + "Add": "Добавить", + "Reset": "Сбросить", + "Menu": "Меню", + "More": "Больше", + "Search": "Искать", + "Only My": "Тлько мои", + "Open": "Открыть", + "Admin": "Администратор", + "About": "О программе", + "Refresh": "Обновить", + "Remove": "Удалить", + "Options": "Настройки", + "Username": "Имя пользователя", + "Password": "Пароль", + "Login": "Войти", + "Log Out": "Выйти", + "Preferences": "Настройки", + "State": "Регион", + "Street": "Улица", + "Country": "Страна", + "City": "Город", + "PostalCode": "Почтовый индекс", + "Followed": "Отслеживаемый", + "Follow": "Перейти", + "Clear Local Cache": "Очистить локальный кэш", + "Actions": "Действия", + "Delete": "Удалить", + "Update": "Обновить", + "Save": "Сохранить", + "Edit": "Редактировать", + "Cancel": "Отменить", + "Unlink": "Убрать ссылку", + "Mass Update": "Глобальное редактирование", + "Export": "Экспортировать", + "No Data": "Нет данных", + "All": "Все", + "Active": "Активный", + "Inactive": "Неактивный", + "Write your comment here": "Оставьте свою заметку здесь", + "Post": "Разместить", + "Stream": "Лента", + "Show more": "Загрузить еще", + "Dashlet Options": "Настройки панели", + "Full Form": "Раширенная форма", + "Insert": "Вставить", + "Person": "Личность", + "First Name": "Имя", + "Last Name": "Фамилия", + "Original": "Оригинальный", + "You": "Вы", + "you": "вы", + "change": "изменить", + "Primary": "Главная", + "Save Filters": "Сохранить фильтры", + "Administration": "Администрирование", + "Run Import": "Импортировать", + "Duplicate": "Копия", + "Notifications": "Оповещения", + "Mark all read": "Пометить все как прочитанное", + "See more": "Подробнее" + }, + "messages": { + "notModified": "Вы не внесли изменения в запись", + "duplicate": "Созданная вами запись дублировалась", + "fieldIsRequired": "{field} необходимы", + "fieldShouldBeEmail": "{field} должно быть правильным e-mail", + "fieldShouldBeFloat": "{field} должно быть верное дробное число", + "fieldShouldBeInt": "{field} должно быть верное целое число", + "fieldShouldBeDate": "{field} должна быть верная дата", + "fieldShouldBeDatetime": "{field} должна быть верная дата/время", + "fieldShouldAfter": "{field} должно быть после {otherField}", + "fieldShouldBefore": "{field} должно быть до {otherField}", + "fieldShouldBeBetween": "{field} должно быть между {min} и {max}", + "fieldShouldBeLess": "{field} должно быть меньше чем {value}", + "fieldShouldBeGreater": "{field} должно быть больше чем {value}", + "fieldBadPasswordConfirm": "{field} подтверждено неверно", + "assignmentEmailNotificationSubject": "EspoCRM {entityType}: {Entity.name}", + "assignmentEmailNotificationBody": "{assignerUserName} назначил {entityType} '{Entity.name}' на вас\n\n{recordUrl}", + "confirmation": "Вы уверены?", + "removeRecordConfirmation": "Удалить запись?", + "unlinkRecordConfirmation": "Убрать связь?", + "removeSelectedRecordsConfirmation": "Удалить выбранные записи?" + }, + "boolFilters": { + "onlyMy": "Только мои", + "open": "Открыть", + "active": "Активный" + }, + "fields": { + "name": "Полное имя", + "firstName": "Имя", + "lastName": "Фамилия", + "salutationName": "Пол", + "assignedUser": "Выбранный пользователь", + "emailAddress": "E-mail адрес", + "assignedUserName": "Имя выбранного пользователя", + "teams": "Группы", + "createdAt": "Создан в", + "modifiedAt": "Изменен в", + "createdBy": "Создан (кем)", + "modifiedBy": "Изменен (кем)", + "title": "Название", + "dateFrom": "Дата от", + "dateTo": "Дата к", + "autorefreshInterval": "Интервал авто-обновления", + "displayRecords": "Отобразить записи" + }, + "links": { + "teams": "Группы", + "users": "Пользователи" + }, + "dashlets": { + "Stream": "Лента" + }, + "streamMessages": { + "create": "{user} создал {entityType} {entity}", + "createAssigned": "{user} создал {entityType} {entity} присвоен {assignee}", + "assign": "{user} присвоено {entityType} {entity} к {assignee}", + "post": "{user} опубликован на {entityType} {entity}", + "attach": "{user} прикреплен {entityType} {entity}", + "status": "{user} обновлен {field} на {entityType} {entity}", + "update": "{user} обновлен {entityType} {entity}", + "createRelated": "{user} создан {relatedEntityType} {relatedEntity} привязан к {entityType} {entity}", + "emailReceived": "{entity} было получено для {entityType} {entity}", + + "createThis": "{user} создал это {entityType}", + "createAssignedThis": "{user} создал это {entityType} присвоен {assignee}", + "assignThis": "{user} присвоено это {entityType} к {assignee}", + "postThis": "{user} добавил", + "attachThis": "{user} добавил", + "statusThis": "{user} обновил {field}", + "updateThis": "{user} обновил это {entityType}", + "createRelatedThis": "{user} создал {relatedEntityType} {relatedEntity} привязал к этому {entityType}", + "emailReceivedThis": "{entity} было получено" + }, + "lists": { + "monthNames": ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"], + "monthNamesShort": ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"], + "dayNames": ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], + "dayNamesShort": ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"], + "dayNamesMin": ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] + }, + "options": { + "salutationName": { + "Mr.": "Г-н.", + "Mrs.": "Г-жа.", + "Dr.": "Д-р.", + "Drs.": "Д-р.", + "male": "Муж. ", + "female": "Жен. " + }, + "language": { + "af_ZA":"Африкаанс", + "az_AZ":"Азербайджанский", + "be_BY":"Белорусский", + "bg_BG":"Болгарский", + "bn_IN":"Бенгальский", + "bs_BA":"Боснийский", + "ca_ES":"Каталонский", + "cs_CZ":"Чешский", + "cy_GB":"Валлийский", + "da_DK":"Датский", + "de_DE":"Немецкий", + "el_GR":"Греческий", + "en_GB":"Английский (UK)", + "en_US":"Английский (US)", + "es_ES":"Испанский (Испания)", + "et_EE":"Эстонский", + "eu_ES":"Баскский", + "fa_IR":"Персидский", + "fi_FI":"Финский", + "fo_FO":"Фарерский", + "fr_CA":"Французский (Канада)", + "fr_FR":"Французский (Франция)", + "ga_IE":"Ирландский", + "gl_ES":"Галицкий", + "gn_PY":"Гуарани", + "he_IL":"Иврит", + "hi_IN":"Хинди", + "hr_HR":"Хорватский", + "hu_HU":"Венгерский", + "hy_AM":"Армянский", + "id_ID":"Индонезийский", + "is_IS":"Исландский", + "it_IT":"Итальянский", + "ja_JP":"Японский", + "ka_GE":"Грузинский", + "km_KH":"Кхмерийский", + "ko_KR":"Корейский", + "ku_TR":"Курдский", + "lt_LT":"Литовский", + "lv_LV":"Латвийский", + "mk_MK":"Македонский", + "ml_IN":"Малайялам", + "ms_MY":"Малайский", + "nb_NO":"Норвежский букмол", + "nn_NO":"Норвежский нюнорск", + "ne_NP":"Непальский", + "nl_NL":"Нидерландский", + "pa_IN":"Панджабский", + "pl_PL":"Польский", + "ps_AF":"Пушту", + "pt_BR":"Португальский (Бразилия)", + "pt_PT":"Португальский (Португалия)", + "ro_RO":"Румынский", + "ru_RU":"Русский", + "sk_SK":"Словацкий", + "sl_SI":"Словенский", + "sq_AL":"Албанский", + "sr_RS":"Сербский", + "sv_SE":"Шведский", + "sw_KE":"Суахили", + "ta_IN":"Тамильский", + "te_IN":"Телугу", + "th_TH":"Тайский", + "tl_PH":"Тагальский", + "tr_TR":"Турецкий", + "uk_UA":"Украинский", + "ur_PK":"Урду", + "vi_VN":"Вьетнамский", + "zh_CN":"Упрощенный китайский (Китай)", + "zh_HK":"Традиционный китайский (Гонконг)", + "zh_TW":"Традиционный китайский (Тайвань)" + }, + "dateSearchRanges": { + "on": "На", + "notOn": "Не на", + "after": "После", + "before": "До", + "between": "Между", + "today": "Сегодня", + "past": "Прошлое", + "future": "Будущее" + }, + "intSearchRanges": { + "equals": "Равняется", + "notEquals": "Не равняется", + "greaterThan": "Больше чем", + "lessThan": "Меньше чем", + "greaterThanOrEquals": "Больше чем или равняется", + "lessThanOrEquals": "Меньше чем или равняется", + "between": "Между" + }, + "autorefreshInterval": { + "0": "Нет", + "0.5": "30 секунд", + "1": "1 минута", + "2": "2 минуты", + "5": "5 минут", + "10": "10 минут" + }, + "phoneNumber": { + "Mobile": "Мобильный", + "Office": "Офисный", + "Fax": "Факс", + "Home": "Домашний", + "Other": "Дополнительно" + } + }, + "sets": { + "summernote": { + "NOTICE": "You can find translation here: https://github.com/HackerWins/summernote/tree/master/lang", + "font":{ + "bold": "Полужирный", "italic": "Курсив", "underline": "Подчёркнутый", "strike": "Зачеркнутый", - "clear": "Убрать стили шрифта", + "clear": "Убрать стили шрифта", "height": "Высота линии", "name": "Название шрифта", "size": "Размер шрифта" - }, - "image":{ - "image": "Изображение", + }, + "image":{ + "image": "Изображение", "insert": "Вставить изображение", "resizeFull": "Восстановить размер", "resizeHalf": "Уменьшить до 50%", @@ -341,61 +341,61 @@ "selectFromFiles": "Выбрать из файлов", "url": "URL изображения", "remove": "Удалить изображение" - }, - "link":{ - "link": "Ссылка", + }, + "link":{ + "link": "Ссылка", "insert": "Вставить ссылку", "unlink": "Убрать ссылку", "edit": "Редактировать", "textToDisplay": "Отображаемый текст", "url": "URL для перехода", "openInNewWindow": "Открывать в новом окне" - }, - "video":{ - "video": "Видео", + }, + "video":{ + "video": "Видео", "videoLink": "Ссылка на видео", "insert": "Вставить видео", "url": "URL видео", "providers": "(YouTube, Vimeo, Vine, Instagram или DailyMotion)" - }, - "table":{ - "table":"Таблица" - }, - "hr":{ - "insert":"Вставить горизонтальную линию" - }, - "style":{ - "style":"Стиль", - "normal":"Нормальный", - "blockquote":"Цитата", - "pre":"Код", - "h1":"Заголовок 1", - "h2":"Заголовок 2", - "h3":"Заголовок 3", - "h4":"Заголовок 4", - "h5":"Заголовок 5", - "h6":"Заголовок 6" - }, - "lists":{ - "unordered":"Маркированный список", - "ordered":"Нумерованный список" - }, - "options":{ - "help":"Помощь", - "fullscreen":"На весь экран", - "codeview":"Исходный код" - }, - "paragraph":{ - "paragraph": "Параграф", + }, + "table":{ + "table":"Таблица" + }, + "hr":{ + "insert":"Вставить горизонтальную линию" + }, + "style":{ + "style":"Стиль", + "normal":"Нормальный", + "blockquote":"Цитата", + "pre":"Код", + "h1":"Заголовок 1", + "h2":"Заголовок 2", + "h3":"Заголовок 3", + "h4":"Заголовок 4", + "h5":"Заголовок 5", + "h6":"Заголовок 6" + }, + "lists":{ + "unordered":"Маркированный список", + "ordered":"Нумерованный список" + }, + "options":{ + "help":"Помощь", + "fullscreen":"На весь экран", + "codeview":"Исходный код" + }, + "paragraph":{ + "paragraph": "Параграф", "outdent": "Уменьшить отступ", "indent": "Увеличить отступ", "left": "Выровнять по левому краю", "center": "Выровнять по центру", "right": "Выровнять по правому краю", "justify": "Растянуть по ширине" - }, - "color":{ - "recent": "Последний цвет", + }, + "color":{ + "recent": "Последний цвет", "more": "Еще цвета", "background": "Цвет фона", "foreground": "Цвет шрифта", @@ -403,20 +403,20 @@ "setTransparent": "Сделать прозрачным", "reset": "Сброс", "resetToDefault": "Восстановить умолчания" - }, - "shortcut":{ - "shortcuts": "Сочетания клавиш", + }, + "shortcut":{ + "shortcuts": "Сочетания клавиш", "close": "Закрыть", "textFormatting": "Форматирование текста", "action": "Действие", "paragraphFormatting": "Форматирование параграфа", "documentStyle": "Стиль документа", "extraKeys": "Дополнительные комбинации" - }, - "history":{ - "undo":"Отменить", - "redo":"Повтор" - } - } - } + }, + "history":{ + "undo":"Отменить", + "redo":"Повтор" + } + } + } } diff --git a/application/Espo/Resources/i18n/ru_RU/Note.json b/application/Espo/Resources/i18n/ru_RU/Note.json index 80a1a57a97..6201d38d7c 100644 --- a/application/Espo/Resources/i18n/ru_RU/Note.json +++ b/application/Espo/Resources/i18n/ru_RU/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Сообщение", - "attachments": "Вложения" - } + "fields": { + "post": "Сообщение", + "attachments": "Вложения" + } } diff --git a/application/Espo/Resources/i18n/ru_RU/Preferences.json b/application/Espo/Resources/i18n/ru_RU/Preferences.json index 6f9b33a1bf..b8288e3ae8 100644 --- a/application/Espo/Resources/i18n/ru_RU/Preferences.json +++ b/application/Espo/Resources/i18n/ru_RU/Preferences.json @@ -1,34 +1,34 @@ { - "fields": { - "dateFormat": "Формат даты", - "timeFormat": "Формат времени", - "timeZone": "Часовой пояс", - "weekStart": "Первый день недели", - "thousandSeparator": "Разделитель разрядов(тысячные)", - "decimalMark": "Десятичный знак", - "defaultCurrency": "Валюта по умолчанию", - "currencyList": "Список валют", - "language": "Язык", - - "smtpServer": "Сервер", - "smtpPort": "Порт", - "smtpAuth": "Авторизация", - "smtpSecurity": "Безопасность", - "smtpUsername": "Имя пользователя", - "emailAddress": "E-mail", - "smtpPassword": "Пароль", - "smtpEmailAddress": "Адрес e-mail", - - "exportDelimiter": "Разделитель (Перемещение)", - - "receiveAssignmentEmailNotifications": "Получать уведомления при назначении" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Воскресенье", - "1": "Понедельник" - } - } + "fields": { + "dateFormat": "Формат даты", + "timeFormat": "Формат времени", + "timeZone": "Часовой пояс", + "weekStart": "Первый день недели", + "thousandSeparator": "Разделитель разрядов(тысячные)", + "decimalMark": "Десятичный знак", + "defaultCurrency": "Валюта по умолчанию", + "currencyList": "Список валют", + "language": "Язык", + + "smtpServer": "Сервер", + "smtpPort": "Порт", + "smtpAuth": "Авторизация", + "smtpSecurity": "Безопасность", + "smtpUsername": "Имя пользователя", + "emailAddress": "E-mail", + "smtpPassword": "Пароль", + "smtpEmailAddress": "Адрес e-mail", + + "exportDelimiter": "Разделитель (Перемещение)", + + "receiveAssignmentEmailNotifications": "Получать уведомления при назначении" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Воскресенье", + "1": "Понедельник" + } + } } diff --git a/application/Espo/Resources/i18n/ru_RU/Role.json b/application/Espo/Resources/i18n/ru_RU/Role.json index 159d026c77..d7f6849fa7 100644 --- a/application/Espo/Resources/i18n/ru_RU/Role.json +++ b/application/Espo/Resources/i18n/ru_RU/Role.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Имя", - "roles": "Функции" - }, - "links": { - "users": "Пользователи", - "teams": "Группы" - }, - "labels": { - "Access": "Доступ", - "Create Role": "Создать роль" - }, - "options": { - "accessList": { - "not-set": "не установлен", - "enabled": "включен", - "disabled": "отключен" - }, - "levelList": { - "all": "все", - "team": "группа", - "own": "принадлежит", - "no": "нет" - } - }, - "actions": { - "read": "Чтение", - "edit": "Редактирование", - "delete": "Удаление" - }, - "messages": { - "changesAfterClearCache": "Все изменения применятся только после очистки кэша." - } + "fields": { + "name": "Имя", + "roles": "Функции" + }, + "links": { + "users": "Пользователи", + "teams": "Группы" + }, + "labels": { + "Access": "Доступ", + "Create Role": "Создать роль" + }, + "options": { + "accessList": { + "not-set": "не установлен", + "enabled": "включен", + "disabled": "отключен" + }, + "levelList": { + "all": "все", + "team": "группа", + "own": "принадлежит", + "no": "нет" + } + }, + "actions": { + "read": "Чтение", + "edit": "Редактирование", + "delete": "Удаление" + }, + "messages": { + "changesAfterClearCache": "Все изменения применятся только после очистки кэша." + } } diff --git a/application/Espo/Resources/i18n/ru_RU/ScheduledJob.json b/application/Espo/Resources/i18n/ru_RU/ScheduledJob.json index ccb69230f8..363c83c52d 100644 --- a/application/Espo/Resources/i18n/ru_RU/ScheduledJob.json +++ b/application/Espo/Resources/i18n/ru_RU/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Имя", - "status": "Статус", - "job": "Работа", - "scheduling": "Планирование (crontab notation)" - }, - "links": { - "log": "Лог" - }, - "labels": { - "Create ScheduledJob": "Создать периодическую работу" - }, - "options": { - "job": { - "CheckInboundEmails": "Проверить входящую почту", - "Cleanup": "Очистить" - }, - "cronSetup": { - "linux": "Заметка: Добавьте эту строку в crontab - файл для запуска Планировщика Работ Espo:", - "mac": "Заметка: Добавьте эту строку в crontab - файл для запуска Планировщика Работ Espo:", - "windows": "Заметка: Создайте пакетный файл со следующими командами для запуска Планировщика Работ Espo, используя Планировщик задач Windows:", - "default": "Заметка: Добавьте эту команду в Cron-Работа (Планировщик задач):" - }, - "status": { - "Active": "Активный", - "Inactive": "Неактивный" - } - } + "fields": { + "name": "Имя", + "status": "Статус", + "job": "Работа", + "scheduling": "Планирование (crontab notation)" + }, + "links": { + "log": "Лог" + }, + "labels": { + "Create ScheduledJob": "Создать периодическую работу" + }, + "options": { + "job": { + "CheckInboundEmails": "Проверить входящую почту", + "Cleanup": "Очистить" + }, + "cronSetup": { + "linux": "Заметка: Добавьте эту строку в crontab - файл для запуска Планировщика Работ Espo:", + "mac": "Заметка: Добавьте эту строку в crontab - файл для запуска Планировщика Работ Espo:", + "windows": "Заметка: Создайте пакетный файл со следующими командами для запуска Планировщика Работ Espo, используя Планировщик задач Windows:", + "default": "Заметка: Добавьте эту команду в Cron-Работа (Планировщик задач):" + }, + "status": { + "Active": "Активный", + "Inactive": "Неактивный" + } + } } diff --git a/application/Espo/Resources/i18n/ru_RU/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/ru_RU/ScheduledJobLogRecord.json index 4a63acaba3..63c01a91d2 100644 --- a/application/Espo/Resources/i18n/ru_RU/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/ru_RU/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Статус", - "executionTime": "Время запуска" - } + "fields": { + "status": "Статус", + "executionTime": "Время запуска" + } } diff --git a/application/Espo/Resources/i18n/ru_RU/Settings.json b/application/Espo/Resources/i18n/ru_RU/Settings.json index 0be82c0b03..8bedea3f2a 100644 --- a/application/Espo/Resources/i18n/ru_RU/Settings.json +++ b/application/Espo/Resources/i18n/ru_RU/Settings.json @@ -1,76 +1,76 @@ { - "fields": { - "useCache": "Использовать кэш", - "dateFormat": "Формат даты", - "timeFormat": "Формат времени", - "timeZone": "Часовой пояс", - "weekStart": "Первый день недели", - "thousandSeparator": "Разделитель разрядов(тысячные)", - "decimalMark": "Десятичный знак", - "defaultCurrency": "Валюта по умолчанию", - "baseCurrency": "Базовая валюта", - "baseCurrency": "Базовая валюта", - "currencyRates": "Курсы обмена", - - "currencyList": "Список валют", - "language": "Язык", - - "companyLogo": "Логотип компании", - - "smtpServer": "Сервер", - "smtpPort": "Порт", - "smtpAuth": "Авторизация", - "smtpSecurity": "Безопасность", - "smtpUsername": "Имя пользователя", - "emailAddress": "E-mail", - "smtpPassword": "Пароль", - "outboundEmailFromName": "От имени", - "outboundEmailFromAddress": "От адреса", - "outboundEmailIsShared": "Может использоваться всеми пользователями", - - "recordsPerPage": "Показывать по страницам", - "recordsPerPageSmall": "Показывать по страницам (Мелкий)", - "tabList": "Вкладки", - "quickCreateList": "Быстрое создание списка", - - "exportDelimiter": "Экспортировать разделитель", - - "authenticationMethod": "Метод аутентификации", - "ldapHost": "Хост", - "ldapPort": "Порт", - "ldapAuth": "Авторизация", - "ldapUsername": "Имя пользователя", - "ldapPassword": "Пароль", - "ldapBindRequiresDn": "Привязка по домену", - "ldapBaseDn": "Базовый домен", - "ldapAccountCanonicalForm": "Стандартная форма учетной записи", - "ldapAccountDomainName": "Доменное имя учетной записи", - "ldapTryUsernameSplit": "Попробовать имя пользователя Split", - "ldapCreateEspoUser": "Создать пользователя в EspoCRM", - "ldapSecurity": "Безопасность", - "ldapUserLoginFilter": "Фильтер пользовательской авторизации", - "ldapAccountDomainNameShort": "Краткая учетная запись домена", - "ldapOptReferrals": "Opt Referrals", - "disableExport": "Отмена экпортирования (доступно только администратору)", - "assignmentEmailNotifications": "Оповещать по email при назначении", - "assignmentEmailNotificationsEntityList": "Список вещей для оповещения" - }, - "options": { - "weekStart": { - "0": "Воскресенье", - "1": "Понедельник" - } - }, - "tooltips": { - "recordsPerPageSmall": "Число записей в панелях связей." - }, - "labels": { - "System": "Система", - "Locale": "Локальные настройки", - "SMTP": "SMTP", - "Configuration": "Конфигурация", - "Notifications": "Оповещения", - "Currency Settings": "Настройки валюты", - "Currency Rtes": "Курсы обмена валюты" - } + "fields": { + "useCache": "Использовать кэш", + "dateFormat": "Формат даты", + "timeFormat": "Формат времени", + "timeZone": "Часовой пояс", + "weekStart": "Первый день недели", + "thousandSeparator": "Разделитель разрядов(тысячные)", + "decimalMark": "Десятичный знак", + "defaultCurrency": "Валюта по умолчанию", + "baseCurrency": "Базовая валюта", + "baseCurrency": "Базовая валюта", + "currencyRates": "Курсы обмена", + + "currencyList": "Список валют", + "language": "Язык", + + "companyLogo": "Логотип компании", + + "smtpServer": "Сервер", + "smtpPort": "Порт", + "smtpAuth": "Авторизация", + "smtpSecurity": "Безопасность", + "smtpUsername": "Имя пользователя", + "emailAddress": "E-mail", + "smtpPassword": "Пароль", + "outboundEmailFromName": "От имени", + "outboundEmailFromAddress": "От адреса", + "outboundEmailIsShared": "Может использоваться всеми пользователями", + + "recordsPerPage": "Показывать по страницам", + "recordsPerPageSmall": "Показывать по страницам (Мелкий)", + "tabList": "Вкладки", + "quickCreateList": "Быстрое создание списка", + + "exportDelimiter": "Экспортировать разделитель", + + "authenticationMethod": "Метод аутентификации", + "ldapHost": "Хост", + "ldapPort": "Порт", + "ldapAuth": "Авторизация", + "ldapUsername": "Имя пользователя", + "ldapPassword": "Пароль", + "ldapBindRequiresDn": "Привязка по домену", + "ldapBaseDn": "Базовый домен", + "ldapAccountCanonicalForm": "Стандартная форма учетной записи", + "ldapAccountDomainName": "Доменное имя учетной записи", + "ldapTryUsernameSplit": "Попробовать имя пользователя Split", + "ldapCreateEspoUser": "Создать пользователя в EspoCRM", + "ldapSecurity": "Безопасность", + "ldapUserLoginFilter": "Фильтер пользовательской авторизации", + "ldapAccountDomainNameShort": "Краткая учетная запись домена", + "ldapOptReferrals": "Opt Referrals", + "disableExport": "Отмена экпортирования (доступно только администратору)", + "assignmentEmailNotifications": "Оповещать по email при назначении", + "assignmentEmailNotificationsEntityList": "Список вещей для оповещения" + }, + "options": { + "weekStart": { + "0": "Воскресенье", + "1": "Понедельник" + } + }, + "tooltips": { + "recordsPerPageSmall": "Число записей в панелях связей." + }, + "labels": { + "System": "Система", + "Locale": "Локальные настройки", + "SMTP": "SMTP", + "Configuration": "Конфигурация", + "Notifications": "Оповещения", + "Currency Settings": "Настройки валюты", + "Currency Rtes": "Курсы обмена валюты" + } } diff --git a/application/Espo/Resources/i18n/ru_RU/Team.json b/application/Espo/Resources/i18n/ru_RU/Team.json index 92695035bc..62e84880ba 100644 --- a/application/Espo/Resources/i18n/ru_RU/Team.json +++ b/application/Espo/Resources/i18n/ru_RU/Team.json @@ -1,15 +1,15 @@ { - "fields": { - "name": "Имя", - "roles": "Роли" - }, - "links": { - "users": "Пользователи" - }, - "tooltips": { - "roles": "Все пользователи этой команды получат настройки доступа из выбранных ролей." - }, - "labels": { - "Create Team": "Создать группу" - } + "fields": { + "name": "Имя", + "roles": "Роли" + }, + "links": { + "users": "Пользователи" + }, + "tooltips": { + "roles": "Все пользователи этой команды получат настройки доступа из выбранных ролей." + }, + "labels": { + "Create Team": "Создать группу" + } } diff --git a/application/Espo/Resources/i18n/ru_RU/User.json b/application/Espo/Resources/i18n/ru_RU/User.json index ece2697562..2685a3811f 100644 --- a/application/Espo/Resources/i18n/ru_RU/User.json +++ b/application/Espo/Resources/i18n/ru_RU/User.json @@ -1,35 +1,35 @@ { - "fields": { - "name": "Имя", - "userName": "Имя пользователя", - "title": "Название", - "isAdmin": "Администратор", - "defaultTeam": "Группа по умолчанию", - "emailAddress": "E-mail", - "phoneNumber": "Телефон", - "roles": "Роли", - "password": "Пароль", - "passwordConfirm": "Подтвердите пароль", - "newPassword": "Новый пароль" - }, - "links": { - "teams": "Группы", - "roles": "Роли" - }, - "labels": { - "Create User": "Создать пользователя", - "Generate": "Сгенерировать", - "Access": "Доступ", - "Preferences": "Преимущества", - "Change Password": "Изменить пароль" - }, - "tooltips": { - "defaultTeam": "Все записи, созданные этим пользователем, по умолчанию будут относиться к этой команде." - }, - "messages": { - "passwordWillBeSent": "Пароль будет выслан на почтовый адрес пользователя", - "accountInfoEmailSubject": "Информация об учетной записи", - "accountInfoEmailBody": "Информация о Вашей учетной записи:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", - "passwordChanged": "Пароль изменен" - } + "fields": { + "name": "Имя", + "userName": "Имя пользователя", + "title": "Название", + "isAdmin": "Администратор", + "defaultTeam": "Группа по умолчанию", + "emailAddress": "E-mail", + "phoneNumber": "Телефон", + "roles": "Роли", + "password": "Пароль", + "passwordConfirm": "Подтвердите пароль", + "newPassword": "Новый пароль" + }, + "links": { + "teams": "Группы", + "roles": "Роли" + }, + "labels": { + "Create User": "Создать пользователя", + "Generate": "Сгенерировать", + "Access": "Доступ", + "Preferences": "Преимущества", + "Change Password": "Изменить пароль" + }, + "tooltips": { + "defaultTeam": "Все записи, созданные этим пользователем, по умолчанию будут относиться к этой команде." + }, + "messages": { + "passwordWillBeSent": "Пароль будет выслан на почтовый адрес пользователя", + "accountInfoEmailSubject": "Информация об учетной записи", + "accountInfoEmailBody": "Информация о Вашей учетной записи:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", + "passwordChanged": "Пароль изменен" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/Admin.json b/application/Espo/Resources/i18n/tr_TR/Admin.json index 40b3cf6aab..8927492b1a 100644 --- a/application/Espo/Resources/i18n/tr_TR/Admin.json +++ b/application/Espo/Resources/i18n/tr_TR/Admin.json @@ -1,122 +1,122 @@ { - "labels": { - "Enabled": "Etkin", - "Disabled": "Devre Dışı", - "System": "Sistem", - "Users": "Kullanıcılar", - "Email": "Eposta", - "Data": "Veri", - "Customization": "Özelleştirme", - "Available Fields": "Uygun Alanlar", - "Layout": "Yerleşim", - "Enabled": "Etkin", - "Disabled": "Devre Dışı", - "Add Panel": "Pano Ekle", - "Add Field": "Alan Ekle", - "Settings": "Ayarlar", - "Scheduled Jobs": "Planlanmış İşler", - "Upgrade": "Yükselt", - "Clear Cache": "Önbelleği Temizle", - "Rebuild": "Onar", - "Users": "Kullanıcılar", - "Teams": "Takımlar", - "Roles": "Görevler", - "Outbound Emails": "Giden Epostalar", - "Inbound Emails": "Gelen Epostalar", - "Email Templates": "Eposta Şablonları", - "Import": "İçeri Aktar", - "Layout Manager": "Yerleşim Yönetimi", - "Field Manager": "Alan Yönetimi", - "User Interface": "Kullanıcı Arayüzü" - }, - "layouts": { - "list": "Liste", - "detail": "Detay", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Arama Filtreleri", - "massUpdate": "Çoklu Güncelleme", - "relationships": "İlişkiler" - }, - "fieldTypes": { - "address": "Adres", - "array": "Sıralama", - "foreign": "Yabancı", - "duration": "Süre", - "password": "Şifre", - "parsonName": "Kişi Adı", - "autoincrement": "Otomatik Arttırım", - "bool": "XXXX", - "currency": "Para Birimi", - "date": "Tarih", - "datetime": "TarihSaat", - "email": "Eposta", - "enum": "Sıralama", - "enumInt": "Tamsayı Sıralama", - "enumFloat": "XXXX Sıralama", - "float": "Hizalama", - "int": "Int", - "link": "Bağlantı", - "linkMultiple": "Çoklu Bağlantı", - "linkParent": "Üst Bağlantı", - "multienim": "Çoklu Sıralama", - "phone": "Telefon", - "text": "Metin", - "url": "Url", - "varchar": "Değişken Karakter", - "file": "Dosya", - "image": "Resim" - }, - "fields": { - "type": "Tür", - "name": "İsim", - "label": "Etiket", - "required": "Gerekli", - "default": "Varsayılan", - "maxLength": "Maks Uzunluk", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Bağlantı", - "field": "Alan", - "min": "Min", - "max": "Maks", - "translation": "Çeviri", - "previewSize": "Önizlme Boyutu" - }, - "messages": { - "upgradeVersion": "EspoCRM yazılımınız {version} sürümüne yükseltilecektir. Bu işlem birkaç dakika sürebilir.", - "upgradeDone": "EspoCRM yazılımınız {version} sürümüne yükseltilmiştir. Tarayıcı pencerenizi lütfen yenileyin..", - "upgradeBackup": "Yükseltmeden önce EspoCRM dosya ve verilerinizi yedeklemenizi öneririz.", - "thousandSeparatorEqualsDecimalMark": "Binlik ayraç ondalık ayraç ile aynı olamaz.", - "userHasNoEmailAddress": "Kullanıcı eposta adresi tanımlamamıştır.", - "selectEntityType": "Soldaki menüden birim türünü seçin.", - "selectUpgradePackage": "Yükseltme paketini seçin.", - "selectLayout": "Gerekli yerleşim düzenini sol menüden seçin ve düzenleyin." - }, - "descriptions": { - "settings": "Uygulamanın sistem ayarları.", - "scheduledJob": "Cron tarafından gerçekleştirilmiş işler.", - "upgrade": "EspoCRM i yükselt.", - "clearCache": "Tüm sunucu önbelleğini temizle.", - "rebuild": "Sunucuyu onar ve önbelleği temizle.", - "users": "Kullanıcı Yönetimi.", - "teams": "Takım Yönetimi.", - "roles": "Görev Yönetimi.", - "outboundEmails": "Giden epostalar için SMTP ayarları.", - "inboundEmails": "IMAP eposta hesaplarını grupla. Eposta içe aktarımı ve dizinleme", - "emailTemplates": "Giden eposta şablonları.", - "import": "CSV dosyasından veri aktar.", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Yeni alan ekle yada varolanı düzenle.", - "userInterface": "Kullanıcı Arayğzünü ayarla." - }, - "options": { - "previewSize": { - "x-small": "Çok Küçük", - "small": "Küçük", - "medium": "Orta", - "large": "Büyük" - } - } + "labels": { + "Enabled": "Etkin", + "Disabled": "Devre Dışı", + "System": "Sistem", + "Users": "Kullanıcılar", + "Email": "Eposta", + "Data": "Veri", + "Customization": "Özelleştirme", + "Available Fields": "Uygun Alanlar", + "Layout": "Yerleşim", + "Enabled": "Etkin", + "Disabled": "Devre Dışı", + "Add Panel": "Pano Ekle", + "Add Field": "Alan Ekle", + "Settings": "Ayarlar", + "Scheduled Jobs": "Planlanmış İşler", + "Upgrade": "Yükselt", + "Clear Cache": "Önbelleği Temizle", + "Rebuild": "Onar", + "Users": "Kullanıcılar", + "Teams": "Takımlar", + "Roles": "Görevler", + "Outbound Emails": "Giden Epostalar", + "Inbound Emails": "Gelen Epostalar", + "Email Templates": "Eposta Şablonları", + "Import": "İçeri Aktar", + "Layout Manager": "Yerleşim Yönetimi", + "Field Manager": "Alan Yönetimi", + "User Interface": "Kullanıcı Arayüzü" + }, + "layouts": { + "list": "Liste", + "detail": "Detay", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Arama Filtreleri", + "massUpdate": "Çoklu Güncelleme", + "relationships": "İlişkiler" + }, + "fieldTypes": { + "address": "Adres", + "array": "Sıralama", + "foreign": "Yabancı", + "duration": "Süre", + "password": "Şifre", + "parsonName": "Kişi Adı", + "autoincrement": "Otomatik Arttırım", + "bool": "XXXX", + "currency": "Para Birimi", + "date": "Tarih", + "datetime": "TarihSaat", + "email": "Eposta", + "enum": "Sıralama", + "enumInt": "Tamsayı Sıralama", + "enumFloat": "XXXX Sıralama", + "float": "Hizalama", + "int": "Int", + "link": "Bağlantı", + "linkMultiple": "Çoklu Bağlantı", + "linkParent": "Üst Bağlantı", + "multienim": "Çoklu Sıralama", + "phone": "Telefon", + "text": "Metin", + "url": "Url", + "varchar": "Değişken Karakter", + "file": "Dosya", + "image": "Resim" + }, + "fields": { + "type": "Tür", + "name": "İsim", + "label": "Etiket", + "required": "Gerekli", + "default": "Varsayılan", + "maxLength": "Maks Uzunluk", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Bağlantı", + "field": "Alan", + "min": "Min", + "max": "Maks", + "translation": "Çeviri", + "previewSize": "Önizlme Boyutu" + }, + "messages": { + "upgradeVersion": "EspoCRM yazılımınız {version} sürümüne yükseltilecektir. Bu işlem birkaç dakika sürebilir.", + "upgradeDone": "EspoCRM yazılımınız {version} sürümüne yükseltilmiştir. Tarayıcı pencerenizi lütfen yenileyin..", + "upgradeBackup": "Yükseltmeden önce EspoCRM dosya ve verilerinizi yedeklemenizi öneririz.", + "thousandSeparatorEqualsDecimalMark": "Binlik ayraç ondalık ayraç ile aynı olamaz.", + "userHasNoEmailAddress": "Kullanıcı eposta adresi tanımlamamıştır.", + "selectEntityType": "Soldaki menüden birim türünü seçin.", + "selectUpgradePackage": "Yükseltme paketini seçin.", + "selectLayout": "Gerekli yerleşim düzenini sol menüden seçin ve düzenleyin." + }, + "descriptions": { + "settings": "Uygulamanın sistem ayarları.", + "scheduledJob": "Cron tarafından gerçekleştirilmiş işler.", + "upgrade": "EspoCRM i yükselt.", + "clearCache": "Tüm sunucu önbelleğini temizle.", + "rebuild": "Sunucuyu onar ve önbelleği temizle.", + "users": "Kullanıcı Yönetimi.", + "teams": "Takım Yönetimi.", + "roles": "Görev Yönetimi.", + "outboundEmails": "Giden epostalar için SMTP ayarları.", + "inboundEmails": "IMAP eposta hesaplarını grupla. Eposta içe aktarımı ve dizinleme", + "emailTemplates": "Giden eposta şablonları.", + "import": "CSV dosyasından veri aktar.", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Yeni alan ekle yada varolanı düzenle.", + "userInterface": "Kullanıcı Arayğzünü ayarla." + }, + "options": { + "previewSize": { + "x-small": "Çok Küçük", + "small": "Küçük", + "medium": "Orta", + "large": "Büyük" + } + } } diff --git a/application/Espo/Resources/i18n/tr_TR/Email.json b/application/Espo/Resources/i18n/tr_TR/Email.json index 1c75797782..1bca0ce0b0 100644 --- a/application/Espo/Resources/i18n/tr_TR/Email.json +++ b/application/Espo/Resources/i18n/tr_TR/Email.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Konu", - "parent": "Üst Seçenek", - "status": "Durum", - "dateSent": "Gönderilen Tariht", - "from": "Kimden", - "to": "Kime", - "cc": "CC", - "bcc": "BCC", - "isHtml": "Html olarak gönder", - "body": "Mesaj", - "subject": "Konu", - "attachments": "Dosya Ekle", - "selectTemplate": "Şablonu Seçin", - "fromEmailAddress": "Gönderen Adresi", - "toEmailAddresses": "Alıcı Adresi", - "emailAddress": "Eposta Adresi" - }, - "links": { - }, - "options": { - "Draft": "Taslak", - "Sending": "Gönderiyor", - "Sent": "Gönderildi", - "Archived": "Arşivlendi" - }, - "labels": { - "Create Email": "Epostayı Arşivle", - "Compose": "Yeni Eposta" - } + "fields": { + "name": "Konu", + "parent": "Üst Seçenek", + "status": "Durum", + "dateSent": "Gönderilen Tariht", + "from": "Kimden", + "to": "Kime", + "cc": "CC", + "bcc": "BCC", + "isHtml": "Html olarak gönder", + "body": "Mesaj", + "subject": "Konu", + "attachments": "Dosya Ekle", + "selectTemplate": "Şablonu Seçin", + "fromEmailAddress": "Gönderen Adresi", + "toEmailAddresses": "Alıcı Adresi", + "emailAddress": "Eposta Adresi" + }, + "links": { + }, + "options": { + "Draft": "Taslak", + "Sending": "Gönderiyor", + "Sent": "Gönderildi", + "Archived": "Arşivlendi" + }, + "labels": { + "Create Email": "Epostayı Arşivle", + "Compose": "Yeni Eposta" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/EmailAddress.json b/application/Espo/Resources/i18n/tr_TR/EmailAddress.json index 5b5d1254e8..4cab670c31 100644 --- a/application/Espo/Resources/i18n/tr_TR/EmailAddress.json +++ b/application/Espo/Resources/i18n/tr_TR/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Öncelikli", - "Opted Out": "SeçildiXXX", - "Invalid": "Geçersiz" - } + "labels": { + "Primary": "Öncelikli", + "Opted Out": "SeçildiXXX", + "Invalid": "Geçersiz" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/EmailTemplate.json b/application/Espo/Resources/i18n/tr_TR/EmailTemplate.json index 65907d775a..1f61a29f94 100644 --- a/application/Espo/Resources/i18n/tr_TR/EmailTemplate.json +++ b/application/Espo/Resources/i18n/tr_TR/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "İsim", - "status": "Durum", - "isHtml": "Html olarak gönder", - "body": "Mesaj", - "subject": "Konu", - "attachments": "Dosya Ekle", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Eposta Şablonu Oluştur" - } + "fields": { + "name": "İsim", + "status": "Durum", + "isHtml": "Html olarak gönder", + "body": "Mesaj", + "subject": "Konu", + "attachments": "Dosya Ekle", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Eposta Şablonu Oluştur" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/Global.json b/application/Espo/Resources/i18n/tr_TR/Global.json index 980aead1e0..5c4c8e5378 100644 --- a/application/Espo/Resources/i18n/tr_TR/Global.json +++ b/application/Espo/Resources/i18n/tr_TR/Global.json @@ -1,395 +1,395 @@ { - "scopeNames": { - "Email": "Eposta", - "User": "Kullanıcı", - "Team": "Takım", - "Role": "Görev", - "EmailTemplate": "Eposta Şablonu", - "OutboundEmail": "Giden Eposta", - "ScheduledJob": "Zamanlanmış İşler" - }, - "scopeNamesPlural": { - "Email": "Epostalar", - "User": "Kullanıcılar", - "Team": "Takımlar", - "Role": "Görevler", - "EmailTemplate": "Eposta Şablonları", - "OutboundEmail": "Giden Epostalar", - "ScheduledJob": "Planlanmış İşler" - }, - "labels": { - "Misc": "Misc", - "Merge": "Birleştir", - "None": "Hiç", - "by": "tarafından", - "Saved": "Kaydedildi", - "Error": "hata", - "Select": "Seç", - "Not valid": "Geçerli Değil", - "Please wait...": "Lütfen bekleyin...", - "Please wait": "Lütfen bekleyin", - "Loading...": "Yükleniyor...", - "Uploading...": "Yükleniyor...", - "Sending...": "Gönderiliyor...", - "Posted": "Yayınlandı", - "Linked": "Bağlantı Kuruldu", - "Unlinked": "Bağlantı Kesildi", - "Access denied": "Erişim engellendi", - "Access": "Giriş", - "Are you sure?": "Are you sure?", - "Record has been removed": "Kayıt silindi", - "Wrong username/password": "Yanlış kullanıcı adı/şifre", - "Post cannot be empty": "Yorum alanı boş bırakılamaz", - "Removing...": "Kaldırılıyor...", - "Unlinking...": "Bağlantı kesiliyor...", - "Posting...": "Yayınlanıyor...", - "Username can not be empty!": "Kullanıcı adı boş bırakılamaz!", - "Cache is not enabled": "Önbelleğe erişilemiyor", - "Cache has been cleared": "Önbellek temizlendi", - "Rebuild has been done": "Onarım tamamlandı", - "Saving...": "Kaydediliyor...", - "Modified": "Değişiklik uygulandı", - "Created": "Oluşturuldu", - "Create": "Oluştur", - "create": "oluştur", - "Overview": "Genel Bakış", - "Details": "Detaylar", - "Add Filter": "Filtre Ekle", - "Add Dashlet": "Önizleme Alanı Ekle", - "Add": "Ekle", - "Reset": "Sıfırla", - "Menu": "Menü", - "More": "Daha Fazla", - "Search": "Arama", - "Only My": "Sadece Ben", - "Open": "Aç", - "Admin": "Yönetici", - "About": "Hakkında", - "Refresh": "Yenile", - "Remove": "Kaldır", - "Options": "Seçenekler", - "Username": "Kullanıcı Adı", - "Password": "Şifre", - "Login": "Giriş", - "Log Out": "Çıkış", - "Preferences": "Seçenekler", - "State": "Semt", - "Street": "Sokak", - "Country": "Ülke", - "City": "Şehir", - "PostalCode": "Posta Kodu", - "Followed": "Takip Ediliyor", - "Follow": "Takip Et", - "Clear Local Cache": "Önbelleği Temizle", - "Actions": "Hareketler", - "Delete": "Sil", - "Update": "Güncelle", - "Save": "Kaydet", - "Edit": "Düzenle", - "Cancel": "İptal Et", - "Unlink": "Bağlantıyı Kes", - "Mass Update": "Çoklu Güncelleme", - "Export": "Dışa Aktar", - "No Data": "Veri Yok", - "All": "Tümü", - "Active": "Aktif", - "Inactive": "Pasif", - "Write your comment here": "Yorumlarınızı buraya yazın", - "Post": "Yayınla", - "Stream": "Hareket", - "Show more": "Daha fazla göster", - "Dashlet Options": "Önizleme Alanı Seçenekleri", - "Full Form": "Tam Form", - "Insert": "Ekle", - "Person": "Kişi", - "First Name": "isim", - "Last Name": "Soyisim", - "Original": "Orjinal", - "You": "Siz", - "you": "Sen", - "change": "Değiştir" - }, - "messages": { - "notModified": "Kayıdı değiştirmediniz", - "duplicate": "Oluşturmaya çalıştığınız kaydın benzer bir kopyası var", - "fieldIsRequired": "{field} gerekli", - "fieldShouldBeEmail": "{field} geçerli bir eposta adresi olmalı", - "fieldShouldBeFloat": "{field} geçerli bir FLOAT olmalı", - "fieldShouldBeInt": "{field} geçerli bir tamsayı olmalı", - "fieldShouldBeDate": "{field} geçerli bir tarih olmalı", - "fieldShouldBeDatetime": "{field} geçerli bir tarih/saat olmalı", - "fieldShouldAfter": "{field} şu değerden sonra gelmeli: {otherField}", - "fieldShouldBefore": "{field} şu değerden önce gelmeli: {otherField}", - "fieldShouldBeBetween": "{field} şu iki değer arasında olmalı: {min} ve {max}", - "fieldShouldBeLess": "{field} şu değerden daha az olmalı: {value}", - "fieldShouldBeGreater": "{field} şu değerden daha büyük olmalı: {value}", - "fieldBadPasswordConfirm": "{field} hatalı olarak onaylandı" - }, - "boolFilters": { - "onlyMy": "Sadece Ben", - "open": "Aç", - "active": "Aktif" - }, - "fields": { - "name": "İsim", - "firstName": "isim", - "lastName": "Soyisim", - "salutationName": "Hitap", - "assignedUser": "Atanan Kişi", - "emailAddress": "Eposta", - "assignedUserName": "Atanan Kişi Kullanıcı Adı", - "teams": "Takımlar", - "createdAt": "Oluşturuldu:", - "modifiedAt": "Değiştirildi:", - "createdBy": "Tarafından Oluşturuldu", - "modifiedBy": "tarafından Değiştirildi:", - "title": "Başlık", - "dateFrom": "Başlangıç Tarihi", - "dateTo": "Bitiş Tarihi", - "autorefreshInterval": "Otomatik Yenileme Süresi", - "displayRecords": "Kayıtları Göster" - }, - "links": { - "teams": "Takımlar", - "users": "Kullanıcılar" - }, - "dashlets": { - "Stream": "Hareket" - }, - "streamMessages": { - "create": "{user} oluşturdu: {entityType} {entity}", - "createAssigned": "{user} oluşturdu: {entityType} {entity} ve şuna atandı: {assignee}", - "assign": "{user} şunu: {entityType} {entity} şuna ataadı: {assignee}", - "post": "{user} {entityType} {entity} yayınladı.", - "attach": "{user} {entityType} {entity} yi ekledi.", - "status": "{user} {field} {entityType} {entity} yi güncelledi", - "update": "{user} {entityType} {entity} güncelledi.", - "createRelated": "{user} şunu oluşturdu: {relatedEntityType} {relatedEntity} ve şuna bağladı: {entityType} {entity}", - "emailReceived": "{entity} şunun için alındı: {entityType} {entity}", - - "createThis": "{user} oluşturdu: {entityType}", - "createAssignedThis": "{user} oluşturdu: {entityType} ve şuna atandı: {assignee}", - "assignThis": "{user} şunu: {entityType} şuna atadı: {assignee}", - "postThis": "{user} yayınladı", - "attachThis": "{user} ekledi", - "statusThis": "{user} güncelledi: {field}", - "updateThis": "{user} güncelledi: {entityType}", - "createRelatedThis": "{user} şunu oluşturdu: {relatedEntityType} {relatedEntity} ve şuna bağladı: {entityType}", - "emailReceivedThis": "{entity} alındı" - }, - "lists": { - "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] - }, - "options": { - "salutationName": { - "Mr.": "Bay.", - "Mrs.": "Bayan.", - "Dr.": "Dr.", - "Drs.": "Drs." - }, - "language": { - "af_ZA": "Afrikaca", - "az_AZ": "Azeri Türkçesi", - "be_BY": "Rusça", - "bg_BG": "Bulgarca", - "bn_IN": "Bengalcw", - "bs_BA": "Boşnakça", - "ca_ES": "Katalanca", - "cs_CZ": "Çekce", - "cy_GB": "Galce", - "da_DK": "Danca", - "de_DE": "Almanca", - "el_GR": "Yunanca", - "en_GB":"English (UK)", - "en_US":"English (US)", - "es_ES":"Spanish (Spain)", - "et_EE": "Estonca", - "eu_ES": "Baskça", - "fa_IR": "Farsça", - "fi_FI": "Fince", - "fo_FO": "Faroese", - "fr_CA":"French (Canada)", - "fr_FR":"French (France)", - "ga_IE": "İrlandaca", - "gl_ES": "Galce", - "gn_PY": "Guarani", - "he_IL": "İbranice", - "hi_IN": "Hintçe", - "hr_HR": "Hırvatça", - "hu_HU": "Macarca", - "hy_AM": "Ermenice", - "id_ID": "Indonesian", - "is_IS": "İzlandaca", - "it_IT": "İtalyanca", - "ja_JP": "Japonca", - "ka_GE": "Gürcüce", - "km_KH": "Khmer", - "ko_KR": "Korece", - "ku_TR": "Kürtçe", - "lt_LT": "Litvanca", - "lv_LV": "Letonca", - "mk_MK": "Makedonca", - "ml_IN": "Malay", - "ms_MY": "Malay", - "nb_NO": "Norveç Bokmål", - "nn_NO": "Norwegian Nynorsk", - "ne_NP": "Nepalce", - "nl_NL": "Flemenkçe", - "pa_IN": "Punjabi", - "pl_PL": "Polca", - "ps_AF": "Pashto", - "pt_BR":"Portuguese (Brazil)", - "pt_PT":"Portuguese (Portugal)", - "ro_RO": "Rumence", - "ru_RU": "Rusça", - "sk_SK": "Slovakça", - "sl_SI": "Slovence", - "sq_AL": "Arnavutça", - "sr_RS": "Sırpça", - "sv_SE": "İsveççe", - "sw_KE": "Swahili", - "ta_IN": "Tamil", - "te_IN": "Telugu", - "th_TH": "Taicei", - "tl_PH": "Tagalog", - "tr_TR": "Türkçe", - "uk_UA": "Ukraynaca", - "ur_PK": "Urdu", - "vi_VN": "Vietnamca", - "zh_CN":"Simplified Chinese (China)", - "zh_HK":"Traditional Chinese (Hong Kong)", - "zh_TW":"Traditional Chinese (Taiwan)" - }, - "dateSearchRanges": { - "on": "Da", - "notOn": "NOT ON", - "after": "Sonra", - "before": "Önce", - "between": "Arasında" - }, - "intSearchRanges": { - "equals": "Eşit", - "notEquals": "Eşit Değil", - "greaterThan": "den Büyük", - "lessThan": "den Küçük", - "greaterThanOrEquals": "den Büyük ya da Eşit", - "lessThanOrEquals": "den Küçük ya da Eşit", - "between": "Arasında" - }, - "autorefreshInterval": { - "0": "Hiç", - "0.5": "30 saniye", - "1": "1 dakika", - "2": "2 dakika", - "5": "5 dakika", - "10": "10 dakika" - } - }, - "sets": { - "summernote": { - "NOTICE": "Çeviriyi bu adreste bulabilirsiniz: https://github.com/HackerWins/summernote/tree/master/lang", - "font":{ - "bold": "Kalın", - "italic": "İtalik", - "underline": "Altı Çizili", - "strike": "Üstü Çizili", - "clear": "Yazı Karakterini Kaldır", - "height": "Satır Yüksekliği", - "name": "Yazı Karakteri", - "size": "YazıKarakteri Boyutu" - }, - "image":{ - "image": "Resim", - "insert": "Resim Ekle", - "resizeFull": "Orjinal Boyut", - "resizeHalf": "1/2 Boyut", - "resizeQuarter": "1/4 Boyut", - "floatLeft": "Sola Hizala", - "floatRight": "Sağa Hizala", - "floatNone": "Hizalamayı Kaldır", - "dragImageHere": "Resmi buraya sürükle", - "selectFromFiles": "Dosya seç", - "url": "Resim URL", - "remove": "Resmi Kaldır" - }, - "link":{ - "link": "Bağlantı", - "insert": "Bağlantı Ekle", - "unlink": "Bağlantıyı Kes", - "edit": "Düzenle", - "textToDisplay": "Gösterilecek Metin", - "url":"To what URL should this link go?", - "openInNewWindow": "Yeni Pencerede Aç" - }, - "video":{ - "video": "Video", - "videoLink": "Video Bağlantısı", - "insert": "Video Ekle", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" - }, - "table":{ - "table": "Tablo" - }, - "hr":{ - "insert": "Yatay Cetvel Ekle" - }, - "style":{ - "style": "Stil", - "normal": "Normal", - "blockquote": "QUOTE", - "pre": "Kod", - "h1": "Başlık 1", - "h2": "Başlık 2", - "h3": "Başlık 3", - "h4": "Başlık 4", - "h5": "Başlık 5", - "h6": "Başlık 6" - }, - "lists":{ - "unordered": "Düzenlenmemiş Liste", - "ordered": "Düzenlenmiş Liste" - }, - "options":{ - "help": "Yardım", - "fullscreen": "Tam Ekran", - "codeview": "Kod Görünümü" - }, - "paragraph":{ - "paragraph": "Paragraf", - "outdent": "Girintiyi arttır", - "indent": "Girintiyi azalt", - "left": "Sola hizala", - "center": "Ortaya hizala", - "right": "Sağa hizala", - "justify": "Tam Yasla" - }, - "color":{ - "recent": "Son Kullanılan Renk", - "more": "Daha Fazla Renk", - "background": "Arkaplan Rengi", - "foreground": "Yazı Karakteri Rengi", - "transparent": "Şeffaflık", - "setTransparent": "Şeffaflığı Ayarla", - "reset": "Sıfırla", - "resetToDefault": "Varsayılana Sıfırla" - }, - "shortcut":{ - "shortcuts": "Klavye Kısayolları", - "close": "Kapat", - "textFormatting": "Metin Biçimlendirme", - "action": "Eylem", - "paragraphFormatting": "Paragraf Biçimlendirme", - "documentStyle": "Döküman Stili" - }, - "history":{ - "undo": "Geri Al", - "redo": "Tekrrar Yap" - } - } - } + "scopeNames": { + "Email": "Eposta", + "User": "Kullanıcı", + "Team": "Takım", + "Role": "Görev", + "EmailTemplate": "Eposta Şablonu", + "OutboundEmail": "Giden Eposta", + "ScheduledJob": "Zamanlanmış İşler" + }, + "scopeNamesPlural": { + "Email": "Epostalar", + "User": "Kullanıcılar", + "Team": "Takımlar", + "Role": "Görevler", + "EmailTemplate": "Eposta Şablonları", + "OutboundEmail": "Giden Epostalar", + "ScheduledJob": "Planlanmış İşler" + }, + "labels": { + "Misc": "Misc", + "Merge": "Birleştir", + "None": "Hiç", + "by": "tarafından", + "Saved": "Kaydedildi", + "Error": "hata", + "Select": "Seç", + "Not valid": "Geçerli Değil", + "Please wait...": "Lütfen bekleyin...", + "Please wait": "Lütfen bekleyin", + "Loading...": "Yükleniyor...", + "Uploading...": "Yükleniyor...", + "Sending...": "Gönderiliyor...", + "Posted": "Yayınlandı", + "Linked": "Bağlantı Kuruldu", + "Unlinked": "Bağlantı Kesildi", + "Access denied": "Erişim engellendi", + "Access": "Giriş", + "Are you sure?": "Are you sure?", + "Record has been removed": "Kayıt silindi", + "Wrong username/password": "Yanlış kullanıcı adı/şifre", + "Post cannot be empty": "Yorum alanı boş bırakılamaz", + "Removing...": "Kaldırılıyor...", + "Unlinking...": "Bağlantı kesiliyor...", + "Posting...": "Yayınlanıyor...", + "Username can not be empty!": "Kullanıcı adı boş bırakılamaz!", + "Cache is not enabled": "Önbelleğe erişilemiyor", + "Cache has been cleared": "Önbellek temizlendi", + "Rebuild has been done": "Onarım tamamlandı", + "Saving...": "Kaydediliyor...", + "Modified": "Değişiklik uygulandı", + "Created": "Oluşturuldu", + "Create": "Oluştur", + "create": "oluştur", + "Overview": "Genel Bakış", + "Details": "Detaylar", + "Add Filter": "Filtre Ekle", + "Add Dashlet": "Önizleme Alanı Ekle", + "Add": "Ekle", + "Reset": "Sıfırla", + "Menu": "Menü", + "More": "Daha Fazla", + "Search": "Arama", + "Only My": "Sadece Ben", + "Open": "Aç", + "Admin": "Yönetici", + "About": "Hakkında", + "Refresh": "Yenile", + "Remove": "Kaldır", + "Options": "Seçenekler", + "Username": "Kullanıcı Adı", + "Password": "Şifre", + "Login": "Giriş", + "Log Out": "Çıkış", + "Preferences": "Seçenekler", + "State": "Semt", + "Street": "Sokak", + "Country": "Ülke", + "City": "Şehir", + "PostalCode": "Posta Kodu", + "Followed": "Takip Ediliyor", + "Follow": "Takip Et", + "Clear Local Cache": "Önbelleği Temizle", + "Actions": "Hareketler", + "Delete": "Sil", + "Update": "Güncelle", + "Save": "Kaydet", + "Edit": "Düzenle", + "Cancel": "İptal Et", + "Unlink": "Bağlantıyı Kes", + "Mass Update": "Çoklu Güncelleme", + "Export": "Dışa Aktar", + "No Data": "Veri Yok", + "All": "Tümü", + "Active": "Aktif", + "Inactive": "Pasif", + "Write your comment here": "Yorumlarınızı buraya yazın", + "Post": "Yayınla", + "Stream": "Hareket", + "Show more": "Daha fazla göster", + "Dashlet Options": "Önizleme Alanı Seçenekleri", + "Full Form": "Tam Form", + "Insert": "Ekle", + "Person": "Kişi", + "First Name": "isim", + "Last Name": "Soyisim", + "Original": "Orjinal", + "You": "Siz", + "you": "Sen", + "change": "Değiştir" + }, + "messages": { + "notModified": "Kayıdı değiştirmediniz", + "duplicate": "Oluşturmaya çalıştığınız kaydın benzer bir kopyası var", + "fieldIsRequired": "{field} gerekli", + "fieldShouldBeEmail": "{field} geçerli bir eposta adresi olmalı", + "fieldShouldBeFloat": "{field} geçerli bir FLOAT olmalı", + "fieldShouldBeInt": "{field} geçerli bir tamsayı olmalı", + "fieldShouldBeDate": "{field} geçerli bir tarih olmalı", + "fieldShouldBeDatetime": "{field} geçerli bir tarih/saat olmalı", + "fieldShouldAfter": "{field} şu değerden sonra gelmeli: {otherField}", + "fieldShouldBefore": "{field} şu değerden önce gelmeli: {otherField}", + "fieldShouldBeBetween": "{field} şu iki değer arasında olmalı: {min} ve {max}", + "fieldShouldBeLess": "{field} şu değerden daha az olmalı: {value}", + "fieldShouldBeGreater": "{field} şu değerden daha büyük olmalı: {value}", + "fieldBadPasswordConfirm": "{field} hatalı olarak onaylandı" + }, + "boolFilters": { + "onlyMy": "Sadece Ben", + "open": "Aç", + "active": "Aktif" + }, + "fields": { + "name": "İsim", + "firstName": "isim", + "lastName": "Soyisim", + "salutationName": "Hitap", + "assignedUser": "Atanan Kişi", + "emailAddress": "Eposta", + "assignedUserName": "Atanan Kişi Kullanıcı Adı", + "teams": "Takımlar", + "createdAt": "Oluşturuldu:", + "modifiedAt": "Değiştirildi:", + "createdBy": "Tarafından Oluşturuldu", + "modifiedBy": "tarafından Değiştirildi:", + "title": "Başlık", + "dateFrom": "Başlangıç Tarihi", + "dateTo": "Bitiş Tarihi", + "autorefreshInterval": "Otomatik Yenileme Süresi", + "displayRecords": "Kayıtları Göster" + }, + "links": { + "teams": "Takımlar", + "users": "Kullanıcılar" + }, + "dashlets": { + "Stream": "Hareket" + }, + "streamMessages": { + "create": "{user} oluşturdu: {entityType} {entity}", + "createAssigned": "{user} oluşturdu: {entityType} {entity} ve şuna atandı: {assignee}", + "assign": "{user} şunu: {entityType} {entity} şuna ataadı: {assignee}", + "post": "{user} {entityType} {entity} yayınladı.", + "attach": "{user} {entityType} {entity} yi ekledi.", + "status": "{user} {field} {entityType} {entity} yi güncelledi", + "update": "{user} {entityType} {entity} güncelledi.", + "createRelated": "{user} şunu oluşturdu: {relatedEntityType} {relatedEntity} ve şuna bağladı: {entityType} {entity}", + "emailReceived": "{entity} şunun için alındı: {entityType} {entity}", + + "createThis": "{user} oluşturdu: {entityType}", + "createAssignedThis": "{user} oluşturdu: {entityType} ve şuna atandı: {assignee}", + "assignThis": "{user} şunu: {entityType} şuna atadı: {assignee}", + "postThis": "{user} yayınladı", + "attachThis": "{user} ekledi", + "statusThis": "{user} güncelledi: {field}", + "updateThis": "{user} güncelledi: {entityType}", + "createRelatedThis": "{user} şunu oluşturdu: {relatedEntityType} {relatedEntity} ve şuna bağladı: {entityType}", + "emailReceivedThis": "{entity} alındı" + }, + "lists": { + "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] + }, + "options": { + "salutationName": { + "Mr.": "Bay.", + "Mrs.": "Bayan.", + "Dr.": "Dr.", + "Drs.": "Drs." + }, + "language": { + "af_ZA": "Afrikaca", + "az_AZ": "Azeri Türkçesi", + "be_BY": "Rusça", + "bg_BG": "Bulgarca", + "bn_IN": "Bengalcw", + "bs_BA": "Boşnakça", + "ca_ES": "Katalanca", + "cs_CZ": "Çekce", + "cy_GB": "Galce", + "da_DK": "Danca", + "de_DE": "Almanca", + "el_GR": "Yunanca", + "en_GB":"English (UK)", + "en_US":"English (US)", + "es_ES":"Spanish (Spain)", + "et_EE": "Estonca", + "eu_ES": "Baskça", + "fa_IR": "Farsça", + "fi_FI": "Fince", + "fo_FO": "Faroese", + "fr_CA":"French (Canada)", + "fr_FR":"French (France)", + "ga_IE": "İrlandaca", + "gl_ES": "Galce", + "gn_PY": "Guarani", + "he_IL": "İbranice", + "hi_IN": "Hintçe", + "hr_HR": "Hırvatça", + "hu_HU": "Macarca", + "hy_AM": "Ermenice", + "id_ID": "Indonesian", + "is_IS": "İzlandaca", + "it_IT": "İtalyanca", + "ja_JP": "Japonca", + "ka_GE": "Gürcüce", + "km_KH": "Khmer", + "ko_KR": "Korece", + "ku_TR": "Kürtçe", + "lt_LT": "Litvanca", + "lv_LV": "Letonca", + "mk_MK": "Makedonca", + "ml_IN": "Malay", + "ms_MY": "Malay", + "nb_NO": "Norveç Bokmål", + "nn_NO": "Norwegian Nynorsk", + "ne_NP": "Nepalce", + "nl_NL": "Flemenkçe", + "pa_IN": "Punjabi", + "pl_PL": "Polca", + "ps_AF": "Pashto", + "pt_BR":"Portuguese (Brazil)", + "pt_PT":"Portuguese (Portugal)", + "ro_RO": "Rumence", + "ru_RU": "Rusça", + "sk_SK": "Slovakça", + "sl_SI": "Slovence", + "sq_AL": "Arnavutça", + "sr_RS": "Sırpça", + "sv_SE": "İsveççe", + "sw_KE": "Swahili", + "ta_IN": "Tamil", + "te_IN": "Telugu", + "th_TH": "Taicei", + "tl_PH": "Tagalog", + "tr_TR": "Türkçe", + "uk_UA": "Ukraynaca", + "ur_PK": "Urdu", + "vi_VN": "Vietnamca", + "zh_CN":"Simplified Chinese (China)", + "zh_HK":"Traditional Chinese (Hong Kong)", + "zh_TW":"Traditional Chinese (Taiwan)" + }, + "dateSearchRanges": { + "on": "Da", + "notOn": "NOT ON", + "after": "Sonra", + "before": "Önce", + "between": "Arasında" + }, + "intSearchRanges": { + "equals": "Eşit", + "notEquals": "Eşit Değil", + "greaterThan": "den Büyük", + "lessThan": "den Küçük", + "greaterThanOrEquals": "den Büyük ya da Eşit", + "lessThanOrEquals": "den Küçük ya da Eşit", + "between": "Arasında" + }, + "autorefreshInterval": { + "0": "Hiç", + "0.5": "30 saniye", + "1": "1 dakika", + "2": "2 dakika", + "5": "5 dakika", + "10": "10 dakika" + } + }, + "sets": { + "summernote": { + "NOTICE": "Çeviriyi bu adreste bulabilirsiniz: https://github.com/HackerWins/summernote/tree/master/lang", + "font":{ + "bold": "Kalın", + "italic": "İtalik", + "underline": "Altı Çizili", + "strike": "Üstü Çizili", + "clear": "Yazı Karakterini Kaldır", + "height": "Satır Yüksekliği", + "name": "Yazı Karakteri", + "size": "YazıKarakteri Boyutu" + }, + "image":{ + "image": "Resim", + "insert": "Resim Ekle", + "resizeFull": "Orjinal Boyut", + "resizeHalf": "1/2 Boyut", + "resizeQuarter": "1/4 Boyut", + "floatLeft": "Sola Hizala", + "floatRight": "Sağa Hizala", + "floatNone": "Hizalamayı Kaldır", + "dragImageHere": "Resmi buraya sürükle", + "selectFromFiles": "Dosya seç", + "url": "Resim URL", + "remove": "Resmi Kaldır" + }, + "link":{ + "link": "Bağlantı", + "insert": "Bağlantı Ekle", + "unlink": "Bağlantıyı Kes", + "edit": "Düzenle", + "textToDisplay": "Gösterilecek Metin", + "url":"To what URL should this link go?", + "openInNewWindow": "Yeni Pencerede Aç" + }, + "video":{ + "video": "Video", + "videoLink": "Video Bağlantısı", + "insert": "Video Ekle", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" + }, + "table":{ + "table": "Tablo" + }, + "hr":{ + "insert": "Yatay Cetvel Ekle" + }, + "style":{ + "style": "Stil", + "normal": "Normal", + "blockquote": "QUOTE", + "pre": "Kod", + "h1": "Başlık 1", + "h2": "Başlık 2", + "h3": "Başlık 3", + "h4": "Başlık 4", + "h5": "Başlık 5", + "h6": "Başlık 6" + }, + "lists":{ + "unordered": "Düzenlenmemiş Liste", + "ordered": "Düzenlenmiş Liste" + }, + "options":{ + "help": "Yardım", + "fullscreen": "Tam Ekran", + "codeview": "Kod Görünümü" + }, + "paragraph":{ + "paragraph": "Paragraf", + "outdent": "Girintiyi arttır", + "indent": "Girintiyi azalt", + "left": "Sola hizala", + "center": "Ortaya hizala", + "right": "Sağa hizala", + "justify": "Tam Yasla" + }, + "color":{ + "recent": "Son Kullanılan Renk", + "more": "Daha Fazla Renk", + "background": "Arkaplan Rengi", + "foreground": "Yazı Karakteri Rengi", + "transparent": "Şeffaflık", + "setTransparent": "Şeffaflığı Ayarla", + "reset": "Sıfırla", + "resetToDefault": "Varsayılana Sıfırla" + }, + "shortcut":{ + "shortcuts": "Klavye Kısayolları", + "close": "Kapat", + "textFormatting": "Metin Biçimlendirme", + "action": "Eylem", + "paragraphFormatting": "Paragraf Biçimlendirme", + "documentStyle": "Döküman Stili" + }, + "history":{ + "undo": "Geri Al", + "redo": "Tekrrar Yap" + } + } + } } diff --git a/application/Espo/Resources/i18n/tr_TR/Note.json b/application/Espo/Resources/i18n/tr_TR/Note.json index 4c86ff95d3..cb3b7bc876 100644 --- a/application/Espo/Resources/i18n/tr_TR/Note.json +++ b/application/Espo/Resources/i18n/tr_TR/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Yayınla", - "attachments": "Dosya Ekle" - } + "fields": { + "post": "Yayınla", + "attachments": "Dosya Ekle" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/Preferences.json b/application/Espo/Resources/i18n/tr_TR/Preferences.json index a8e619c88e..9fc423649a 100644 --- a/application/Espo/Resources/i18n/tr_TR/Preferences.json +++ b/application/Espo/Resources/i18n/tr_TR/Preferences.json @@ -1,32 +1,32 @@ { - "fields": { - "dateFormat": "Tarih Biçimi", - "timeFormat": "Saat Biçimi", - "timeZone": "Zaman Dilimi", - "weekStart": "Hafta Başlangıç Günü", - "thousandSeparator": "Binlik Ayraç", - "decimalMark": "Ondalık Ayraç", - "defaultCurrency": "Varsayılan Para Birimi", - "currencyList": "para Birimi Listesi", - "language": "Dil", - - "smtpServer": "Sunucu", - "smtpPort": "Bağlantı Noktası", - "smtpAuth": "Auth", - "smtpSecurity": "Güvenlik", - "smtpUsername": "Kullanıcı Adı", - "emailAddress": "Eposta", - "smtpPassword": "Şifre", - "smtpEmailAddress": "Eposta Adresi", - - "exportDelimiter": "Export Delimiter" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Pazar", - "1": "Pazartesi" - } - } + "fields": { + "dateFormat": "Tarih Biçimi", + "timeFormat": "Saat Biçimi", + "timeZone": "Zaman Dilimi", + "weekStart": "Hafta Başlangıç Günü", + "thousandSeparator": "Binlik Ayraç", + "decimalMark": "Ondalık Ayraç", + "defaultCurrency": "Varsayılan Para Birimi", + "currencyList": "para Birimi Listesi", + "language": "Dil", + + "smtpServer": "Sunucu", + "smtpPort": "Bağlantı Noktası", + "smtpAuth": "Auth", + "smtpSecurity": "Güvenlik", + "smtpUsername": "Kullanıcı Adı", + "emailAddress": "Eposta", + "smtpPassword": "Şifre", + "smtpEmailAddress": "Eposta Adresi", + + "exportDelimiter": "Export Delimiter" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Pazar", + "1": "Pazartesi" + } + } } diff --git a/application/Espo/Resources/i18n/tr_TR/Role.json b/application/Espo/Resources/i18n/tr_TR/Role.json index 2985b643d5..186b8ad452 100644 --- a/application/Espo/Resources/i18n/tr_TR/Role.json +++ b/application/Espo/Resources/i18n/tr_TR/Role.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "İsim", - "roles": "Görevler" - }, - "links": { - "users": "Kullanıcılar", - "teams": "Takımlar" - }, - "labels": { - "Access": "Giriş", - "Create Role": "Görev Oluştur" - }, - "options": { - "accessList": { - "not-set": "ayarlanmadı", - "enabled": "etkinleştirildi", - "disabled": "devre dışı bırakıldı" - }, - "levelList": { - "all": "tümü", - "team": "takım", - "own": "kendi", - "no": "NO" - } - }, - "actions": { - "read": "Oku", - "edit": "Düzenle", - "delete": "Sil" - } + "fields": { + "name": "İsim", + "roles": "Görevler" + }, + "links": { + "users": "Kullanıcılar", + "teams": "Takımlar" + }, + "labels": { + "Access": "Giriş", + "Create Role": "Görev Oluştur" + }, + "options": { + "accessList": { + "not-set": "ayarlanmadı", + "enabled": "etkinleştirildi", + "disabled": "devre dışı bırakıldı" + }, + "levelList": { + "all": "tümü", + "team": "takım", + "own": "kendi", + "no": "NO" + } + }, + "actions": { + "read": "Oku", + "edit": "Düzenle", + "delete": "Sil" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/ScheduledJob.json b/application/Espo/Resources/i18n/tr_TR/ScheduledJob.json index 3ce984eda2..2cf6258c94 100644 --- a/application/Espo/Resources/i18n/tr_TR/ScheduledJob.json +++ b/application/Espo/Resources/i18n/tr_TR/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "İsim", - "status": "Durum", - "job": "İş", - "scheduling": "Scheduling (crontab notation)" - }, - "links": { - "log": "Kayıt" - }, - "labels": { - "Create ScheduledJob": "Create Scheduled Job" - }, - "options": { - "job": { - "CheckInboundEmails": "Gelen Epostaları Kontrol T", - "Cleanup": "Temizle" - }, - "cronSetup": { - "linux": "Not: Espo Planlanmış İşleri çalıştırabilmek için şu kodları crontab dosyasına ekleyin:", - "mac": "Not: Espo Planlanmış İşleri çalıştırabilmek için şu kodları crontab dosyasına ekleyin:", - "windows": "Not: Espo Planlanmış İşleri Windows Scheduled Task ile kullanabilmek için şu kodlarla bir BATCH dosyası oluşturun: ", - "default": "Note: Add this command to Cron Job (Scheduled Task):" - }, - "status": { - "Active": "Aktif", - "Inactive": "Pasif" - } - } + "fields": { + "name": "İsim", + "status": "Durum", + "job": "İş", + "scheduling": "Scheduling (crontab notation)" + }, + "links": { + "log": "Kayıt" + }, + "labels": { + "Create ScheduledJob": "Create Scheduled Job" + }, + "options": { + "job": { + "CheckInboundEmails": "Gelen Epostaları Kontrol T", + "Cleanup": "Temizle" + }, + "cronSetup": { + "linux": "Not: Espo Planlanmış İşleri çalıştırabilmek için şu kodları crontab dosyasına ekleyin:", + "mac": "Not: Espo Planlanmış İşleri çalıştırabilmek için şu kodları crontab dosyasına ekleyin:", + "windows": "Not: Espo Planlanmış İşleri Windows Scheduled Task ile kullanabilmek için şu kodlarla bir BATCH dosyası oluşturun: ", + "default": "Note: Add this command to Cron Job (Scheduled Task):" + }, + "status": { + "Active": "Aktif", + "Inactive": "Pasif" + } + } } diff --git a/application/Espo/Resources/i18n/tr_TR/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/tr_TR/ScheduledJobLogRecord.json index 9421c2c2e0..2a79802fce 100644 --- a/application/Espo/Resources/i18n/tr_TR/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/tr_TR/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Durum", - "executionTime": "Çalışma Süresi" - } + "fields": { + "status": "Durum", + "executionTime": "Çalışma Süresi" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/Settings.json b/application/Espo/Resources/i18n/tr_TR/Settings.json index e9fa0d2c9f..08926ad04b 100644 --- a/application/Espo/Resources/i18n/tr_TR/Settings.json +++ b/application/Espo/Resources/i18n/tr_TR/Settings.json @@ -1,46 +1,46 @@ { - "fields": { - "useCache": "Önbelleği Kullan", - "dateFormat": "Tarih Biçimi", - "timeFormat": "Saat Biçimi", - "timeZone": "Zaman Dilimi", - "weekStart": "Hafta Başlangıç Günü", - "thousandSeparator": "Binlik Ayraç", - "decimalMark": "Ondalık Ayraç", - "defaultCurrency": "Varsayılan Para Birimi", - "currencyList": "para Birimi Listesi", - "language": "Dil", - - "companyLogo": "Company Logo", - - "smtpServer": "Sunucu", - "smtpPort": "Bağlantı Noktası", - "smtpAuth": "Auth", - "smtpSecurity": "Güvenlik", - "smtpUsername": "Kullanıcı Adı", - "emailAddress": "Eposta", - "smtpPassword": "Şifre", - "outboundEmailFromName": "Kimden", - "outboundEmailFromAddress": "Gönderen Adresi", - "outboundEmailIsShared": "Paylaşıldı", - - "recordsPerPage": "Sayfa Başına Kayıtlar", - "recordsPerPageSmall": "Records Per Page (Small)", - "tabList": "Sekme Listesi", - "quickCreateList": "Çabuk Oluşturma Listesi", - - "exportDelimiter": "Export Delimiter" - }, - "options": { - "weekStart": { - "0": "Pazar", - "1": "Pazartesi" - } - }, - "labels": { - "System": "Sistem", - "Locale": "Yerel", - "SMTP": "SMTP", - "Configuration": "Yapılandırma" - } + "fields": { + "useCache": "Önbelleği Kullan", + "dateFormat": "Tarih Biçimi", + "timeFormat": "Saat Biçimi", + "timeZone": "Zaman Dilimi", + "weekStart": "Hafta Başlangıç Günü", + "thousandSeparator": "Binlik Ayraç", + "decimalMark": "Ondalık Ayraç", + "defaultCurrency": "Varsayılan Para Birimi", + "currencyList": "para Birimi Listesi", + "language": "Dil", + + "companyLogo": "Company Logo", + + "smtpServer": "Sunucu", + "smtpPort": "Bağlantı Noktası", + "smtpAuth": "Auth", + "smtpSecurity": "Güvenlik", + "smtpUsername": "Kullanıcı Adı", + "emailAddress": "Eposta", + "smtpPassword": "Şifre", + "outboundEmailFromName": "Kimden", + "outboundEmailFromAddress": "Gönderen Adresi", + "outboundEmailIsShared": "Paylaşıldı", + + "recordsPerPage": "Sayfa Başına Kayıtlar", + "recordsPerPageSmall": "Records Per Page (Small)", + "tabList": "Sekme Listesi", + "quickCreateList": "Çabuk Oluşturma Listesi", + + "exportDelimiter": "Export Delimiter" + }, + "options": { + "weekStart": { + "0": "Pazar", + "1": "Pazartesi" + } + }, + "labels": { + "System": "Sistem", + "Locale": "Yerel", + "SMTP": "SMTP", + "Configuration": "Yapılandırma" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/Team.json b/application/Espo/Resources/i18n/tr_TR/Team.json index 9dafc99f9d..61eb1de415 100644 --- a/application/Espo/Resources/i18n/tr_TR/Team.json +++ b/application/Espo/Resources/i18n/tr_TR/Team.json @@ -1,12 +1,12 @@ { - "fields": { - "name": "İsim", - "roles": "Görevler" - }, - "links": { - "users": "Kullanıcılar" - }, - "labels": { - "Create Team": "Takım Oluştur" - } + "fields": { + "name": "İsim", + "roles": "Görevler" + }, + "links": { + "users": "Kullanıcılar" + }, + "labels": { + "Create Team": "Takım Oluştur" + } } diff --git a/application/Espo/Resources/i18n/tr_TR/User.json b/application/Espo/Resources/i18n/tr_TR/User.json index b292eb1421..5a8f592d7f 100644 --- a/application/Espo/Resources/i18n/tr_TR/User.json +++ b/application/Espo/Resources/i18n/tr_TR/User.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "İsim", - "userName": "Kullanıcı Adı", - "title": "Başlık", - "isAdmin": "Yönetici", - "defaultTeam": "Varsayılan Takım", - "emailAddress": "Eposta", - "phone": "Telefon", - "roles": "Görevler", - "password": "Şifre", - "passwordConfirm": "Şifreyi Doğrulayın", - "newPassword": "New Password" - }, - "links": { - "teams": "Takımlar", - "roles": "Görevler" - }, - "labels": { - "Create User": "Kullanıcı Oluştur", - "Generate": "Generate", - "Access": "Giriş", - "Preferences": "Seçenekler", - "Change Password": "Change Password" - }, - "messages": { - "passwordWillBeSent": "Password will be sent to user's email address.", - "accountInfoEmailSubject": "Account info", - "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", - "passwordChanged": "Password has been changed" - } + "fields": { + "name": "İsim", + "userName": "Kullanıcı Adı", + "title": "Başlık", + "isAdmin": "Yönetici", + "defaultTeam": "Varsayılan Takım", + "emailAddress": "Eposta", + "phone": "Telefon", + "roles": "Görevler", + "password": "Şifre", + "passwordConfirm": "Şifreyi Doğrulayın", + "newPassword": "New Password" + }, + "links": { + "teams": "Takımlar", + "roles": "Görevler" + }, + "labels": { + "Create User": "Kullanıcı Oluştur", + "Generate": "Generate", + "Access": "Giriş", + "Preferences": "Seçenekler", + "Change Password": "Change Password" + }, + "messages": { + "passwordWillBeSent": "Password will be sent to user's email address.", + "accountInfoEmailSubject": "Account info", + "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", + "passwordChanged": "Password has been changed" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/Admin.json b/application/Espo/Resources/i18n/vi_VN/Admin.json index 218e1fd134..e5fe2df8c2 100644 --- a/application/Espo/Resources/i18n/vi_VN/Admin.json +++ b/application/Espo/Resources/i18n/vi_VN/Admin.json @@ -1,126 +1,126 @@ { - "labels": { - "Enabled": "Bật", - "Disabled": "Tắt", - "System": "Hệ thống", - "Users": "Người dùng", - "Email": "Email", - "Data": "Dữ liệu", - "Customization": "Tùy chỉnh", - "Available Fields": "Trường hiện có", - "Layout": "Giao diện", - "Enabled": "Bật", - "Disabled": "Tắt", - "Add Panel": "Thêm bảng điều khiển", - "Add Field": "Thêm trường", - "Settings": "Cái đặt", - "Scheduled Jobs": "Công việc đã lên lịch", - "Upgrade": "Nâng cấp", - "Clear Cache": "Xóa Cache", - "Rebuild": "Dựng lại", - "Users": "Người dùng", - "Teams": "Nhóm", - "Roles": "Vai trò", - "Outbound Emails": "Email đã gửi", - "Inbound Emails": "Email đã nhận", - "Email Templates": "Mẫu email", - "Import": "Nhập", - "Layout Manager": "Quản lý giao diện", - "Field Manager": "Quản lý trường", - "User Interface": "Giao diện người dùng", - "Auth Tokens": "Auth Tokens", - "Authentication": "Xác thực" - }, - "layouts": { - "list": "Đanh sách", - "detail": "Chi tiết", - "listSmall": "List (Small)", - "detailSmall": "Detail (Small)", - "filters": "Bộ lọc tìm kiếm", - "massUpdate": "Cập nhật", - "relationships": "Quan hệ" - }, - "fieldTypes": { - "address": "Địa chỉ", - "array": "Mảng", - "foreign": "Nước ngoài", - "duration": "Thời gian", - "password": "Mật khẩu", - "parsonName": "Tên", - "autoincrement": "Tự động tăng", - "bool": "Bool", - "currency": "Tiền tệ", - "date": "Thời gian", - "datetime": "Thời gian", - "email": "Email", - "enum": "Enum", - "enumInt": "Enum Integer", - "enumFloat": "Enum Float", - "float": "Float", - "int": "Int", - "link": "Đường dẫn", - "linkMultiple": "Đa đường dẫn", - "linkParent": "Đường dẫn gốc", - "multienim": "Multienum", - "phone": "Điện thoại", - "text": "Text", - "url": "Đường dẫn", - "varchar": "Varchar", - "file": "File", - "image": "Ảnh" - }, - "fields": { - "type": "Loại", - "name": "Tên", - "label": "Thẻ", - "required": "Yêu cầu", - "default": "Mặc định", - "maxLength": "Chiều dài tối đa", - "options": "Options (raw values, not translated)", - "after": "After (field)", - "before": "Before (field)", - "link": "Đường dẫn", - "field": "Trường", - "min": "Tối thiểu", - "max": "Tối đa", - "translation": "Dịch", - "previewSize": "Kích thước cũ" - }, - "messages": { - "upgradeVersion": "Your EspoCRM will be upgraded to version {version}. This can take some time.", - "upgradeDone": "Your EspoCRM has been upgraded to version {version}. Refresh your browser window.", - "upgradeBackup": "We recommend you to make backup of your EspoCRM files and data before upgrade.", - "thousandSeparatorEqualsDecimalMark": "Dấu phân cách không thể giống nhau", - "userHasNoEmailAddress": "Người dùng chưa có địa chỉ email", - "selectEntityType": "Chọn loại ở menu bên trái", - "selectUpgradePackage": "Chọn gói nâng cấp", - "selectLayout": "Chọn giao diện cần sửa bên trái" - }, - "descriptions": { - "settings": "System settings of application.", - "scheduledJob": "Công việc tự động tiến hành", - "upgrade": "Nâng cấp hệ thống EspoCRM", - "clearCache": "Xóa dữ liệu cache.", - "rebuild": "Xóa dữ liệu và tải lại hệ thống", - "users": "Quản lý người dùng.", - "teams": "Quản lý nhóm.", - "roles": "Quản lý vai trò.", - "outboundEmails": "Tùy chỉnh SMTP để gửi email.", - "inboundEmails": "Nhóm tài khoản email IMAP. Nhập email và Email-to-Case.", - "emailTemplates": "Mẫu email gửi đi", - "import": "Nhập dữ liệu từ tệp CSV", - "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", - "fieldManager": "Tạo trường mới hoặc sửa trường đã tồn tại", - "userInterface": "Chỉnh sửa giao diện.", - "authTokens": "Kích hoạt quản lý phiên làm việc. Địa chỉ IP và ngày truy cập.", - "authentication": "Cài đặt xác thực truy cập" - }, - "options": { - "previewSize": { - "x-small": "Cực nhỏ", - "small": "Nhỏ", - "medium": "Trung bình", - "large": "Lớn" - } - } + "labels": { + "Enabled": "Bật", + "Disabled": "Tắt", + "System": "Hệ thống", + "Users": "Người dùng", + "Email": "Email", + "Data": "Dữ liệu", + "Customization": "Tùy chỉnh", + "Available Fields": "Trường hiện có", + "Layout": "Giao diện", + "Enabled": "Bật", + "Disabled": "Tắt", + "Add Panel": "Thêm bảng điều khiển", + "Add Field": "Thêm trường", + "Settings": "Cái đặt", + "Scheduled Jobs": "Công việc đã lên lịch", + "Upgrade": "Nâng cấp", + "Clear Cache": "Xóa Cache", + "Rebuild": "Dựng lại", + "Users": "Người dùng", + "Teams": "Nhóm", + "Roles": "Vai trò", + "Outbound Emails": "Email đã gửi", + "Inbound Emails": "Email đã nhận", + "Email Templates": "Mẫu email", + "Import": "Nhập", + "Layout Manager": "Quản lý giao diện", + "Field Manager": "Quản lý trường", + "User Interface": "Giao diện người dùng", + "Auth Tokens": "Auth Tokens", + "Authentication": "Xác thực" + }, + "layouts": { + "list": "Đanh sách", + "detail": "Chi tiết", + "listSmall": "List (Small)", + "detailSmall": "Detail (Small)", + "filters": "Bộ lọc tìm kiếm", + "massUpdate": "Cập nhật", + "relationships": "Quan hệ" + }, + "fieldTypes": { + "address": "Địa chỉ", + "array": "Mảng", + "foreign": "Nước ngoài", + "duration": "Thời gian", + "password": "Mật khẩu", + "parsonName": "Tên", + "autoincrement": "Tự động tăng", + "bool": "Bool", + "currency": "Tiền tệ", + "date": "Thời gian", + "datetime": "Thời gian", + "email": "Email", + "enum": "Enum", + "enumInt": "Enum Integer", + "enumFloat": "Enum Float", + "float": "Float", + "int": "Int", + "link": "Đường dẫn", + "linkMultiple": "Đa đường dẫn", + "linkParent": "Đường dẫn gốc", + "multienim": "Multienum", + "phone": "Điện thoại", + "text": "Text", + "url": "Đường dẫn", + "varchar": "Varchar", + "file": "File", + "image": "Ảnh" + }, + "fields": { + "type": "Loại", + "name": "Tên", + "label": "Thẻ", + "required": "Yêu cầu", + "default": "Mặc định", + "maxLength": "Chiều dài tối đa", + "options": "Options (raw values, not translated)", + "after": "After (field)", + "before": "Before (field)", + "link": "Đường dẫn", + "field": "Trường", + "min": "Tối thiểu", + "max": "Tối đa", + "translation": "Dịch", + "previewSize": "Kích thước cũ" + }, + "messages": { + "upgradeVersion": "Your EspoCRM will be upgraded to version {version}. This can take some time.", + "upgradeDone": "Your EspoCRM has been upgraded to version {version}. Refresh your browser window.", + "upgradeBackup": "We recommend you to make backup of your EspoCRM files and data before upgrade.", + "thousandSeparatorEqualsDecimalMark": "Dấu phân cách không thể giống nhau", + "userHasNoEmailAddress": "Người dùng chưa có địa chỉ email", + "selectEntityType": "Chọn loại ở menu bên trái", + "selectUpgradePackage": "Chọn gói nâng cấp", + "selectLayout": "Chọn giao diện cần sửa bên trái" + }, + "descriptions": { + "settings": "System settings of application.", + "scheduledJob": "Công việc tự động tiến hành", + "upgrade": "Nâng cấp hệ thống EspoCRM", + "clearCache": "Xóa dữ liệu cache.", + "rebuild": "Xóa dữ liệu và tải lại hệ thống", + "users": "Quản lý người dùng.", + "teams": "Quản lý nhóm.", + "roles": "Quản lý vai trò.", + "outboundEmails": "Tùy chỉnh SMTP để gửi email.", + "inboundEmails": "Nhóm tài khoản email IMAP. Nhập email và Email-to-Case.", + "emailTemplates": "Mẫu email gửi đi", + "import": "Nhập dữ liệu từ tệp CSV", + "layoutManager": "Customize layouts (list, detail, edit, search, mass update).", + "fieldManager": "Tạo trường mới hoặc sửa trường đã tồn tại", + "userInterface": "Chỉnh sửa giao diện.", + "authTokens": "Kích hoạt quản lý phiên làm việc. Địa chỉ IP và ngày truy cập.", + "authentication": "Cài đặt xác thực truy cập" + }, + "options": { + "previewSize": { + "x-small": "Cực nhỏ", + "small": "Nhỏ", + "medium": "Trung bình", + "large": "Lớn" + } + } } diff --git a/application/Espo/Resources/i18n/vi_VN/AuthToken.json b/application/Espo/Resources/i18n/vi_VN/AuthToken.json index f197c4336f..b1a00a830b 100644 --- a/application/Espo/Resources/i18n/vi_VN/AuthToken.json +++ b/application/Espo/Resources/i18n/vi_VN/AuthToken.json @@ -1,9 +1,9 @@ { - "fields": { - "user": "Người dùng", - "ipAddress": "Địa chỉ IP", - "lastAccess": "Thời gian truy cập cuối", - "createdAt": "Thời gian đăng nhập" + "fields": { + "user": "Người dùng", + "ipAddress": "Địa chỉ IP", + "lastAccess": "Thời gian truy cập cuối", + "createdAt": "Thời gian đăng nhập" - } + } } diff --git a/application/Espo/Resources/i18n/vi_VN/Email.json b/application/Espo/Resources/i18n/vi_VN/Email.json index e0af04c89b..00b987318d 100644 --- a/application/Espo/Resources/i18n/vi_VN/Email.json +++ b/application/Espo/Resources/i18n/vi_VN/Email.json @@ -1,36 +1,36 @@ { - "fields": { - "name": "Chủ đề", - "parent": "Chủ", - "status": "Trạng thái", - "dateSent": "Ngày gửi", - "from": "Từ", - "to": "Tới", - "cc": "CC", - "bcc": "BCC", - "isHtml": "Chỉ Html", - "body": "Nội dung", - "subject": "Chủ đề", - "attachments": "Đính kèm", - "selectTemplate": "Chọn mẫu", - "fromEmailAddress": "Địa chỉ gửi", - "toEmailAddresses": "Địa chỉ nhận", - "emailAddress": "Địa chỉ email" - }, - "links": { - }, - "options": { - "Draft": "Nháp", - "Sending": "Đang gửi", - "Sent": "Đã gửi", - "Archived": "Lưu trữ" - }, - "labels": { - "Create Email": "Email lưu trữ", - "Compose": "Soạn" - }, - "presetFilters": { - "sent": "Đã gửi", - "archived": "Lưu trữ" - } + "fields": { + "name": "Chủ đề", + "parent": "Chủ", + "status": "Trạng thái", + "dateSent": "Ngày gửi", + "from": "Từ", + "to": "Tới", + "cc": "CC", + "bcc": "BCC", + "isHtml": "Chỉ Html", + "body": "Nội dung", + "subject": "Chủ đề", + "attachments": "Đính kèm", + "selectTemplate": "Chọn mẫu", + "fromEmailAddress": "Địa chỉ gửi", + "toEmailAddresses": "Địa chỉ nhận", + "emailAddress": "Địa chỉ email" + }, + "links": { + }, + "options": { + "Draft": "Nháp", + "Sending": "Đang gửi", + "Sent": "Đã gửi", + "Archived": "Lưu trữ" + }, + "labels": { + "Create Email": "Email lưu trữ", + "Compose": "Soạn" + }, + "presetFilters": { + "sent": "Đã gửi", + "archived": "Lưu trữ" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/EmailAddress.json b/application/Espo/Resources/i18n/vi_VN/EmailAddress.json index 10bbc55179..16a448b8b7 100644 --- a/application/Espo/Resources/i18n/vi_VN/EmailAddress.json +++ b/application/Espo/Resources/i18n/vi_VN/EmailAddress.json @@ -1,7 +1,7 @@ { - "labels": { - "Primary": "Chính", - "Opted Out": "Chọn ra", - "Invalid": "Không hợp lệ" - } + "labels": { + "Primary": "Chính", + "Opted Out": "Chọn ra", + "Invalid": "Không hợp lệ" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/EmailTemplate.json b/application/Espo/Resources/i18n/vi_VN/EmailTemplate.json index aaa472515d..014f71ae2d 100644 --- a/application/Espo/Resources/i18n/vi_VN/EmailTemplate.json +++ b/application/Espo/Resources/i18n/vi_VN/EmailTemplate.json @@ -1,16 +1,16 @@ { - "fields": { - "name": "Tên", - "status": "Trạng thái", - "isHtml": "Chỉ Html", - "body": "Nội dung", - "subject": "Chủ đề", - "attachments": "Đính kèm", - "insertField": "" - }, - "links": { - }, - "labels": { - "Create EmailTemplate": "Tạo mẫu email" - } + "fields": { + "name": "Tên", + "status": "Trạng thái", + "isHtml": "Chỉ Html", + "body": "Nội dung", + "subject": "Chủ đề", + "attachments": "Đính kèm", + "insertField": "" + }, + "links": { + }, + "labels": { + "Create EmailTemplate": "Tạo mẫu email" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/Global.json b/application/Espo/Resources/i18n/vi_VN/Global.json index 77ec510af2..520bf35810 100644 --- a/application/Espo/Resources/i18n/vi_VN/Global.json +++ b/application/Espo/Resources/i18n/vi_VN/Global.json @@ -1,412 +1,412 @@ { - "scopeNames": { - "Email": "Email", - "User": "Người dùng", - "Team": "Nhóm", - "Role": "Vai trò", - "EmailTemplate": "Mẫu email", - "OutboundEmail": "Email đã gửi", - "ScheduledJob": "Công việc đã lên lịch" - }, - "scopeNamesPlural": { - "Email": "Địa chỉ email", - "User": "Người dùng", - "Team": "Nhóm", - "Role": "Vai trò", - "EmailTemplate": "Mẫu email", - "OutboundEmail": "Email đã gửi", - "ScheduledJob": "Công việc đã lên lịch" - }, - "labels": { - "Misc": "Khác", - "Merge": "Gộp", - "None": "Trống", - "by": "bởi", - "Saved": "Đã lưu", - "Error": "Lỗi", - "Select": "Chọn", - "Not valid": "Không phù hợp", - "Please wait...": "Vui lòng đợi...", - "Please wait": "Vui lòng đợi", - "Loading...": "Đang tải...", - "Uploading...": "Đang tải lên...", - "Sending...": "Đang gửi...", - "Removed": "Đã xóa", - "Posted": "Đã đăng", - "Linked": "Đã liên kết", - "Unlinked": "Đã bỏ liên kết", - "Access denied": "Từ chối truy cập", - "Access": "Truy cập", - "Are you sure?": "Are you sure?", - "Record has been removed": "bản ghi đã được xóa", - "Wrong username/password": "Sai tên truy cập và mật khẩu", - "Post cannot be empty": "Nội dung không được để trống", - "Removing...": "Đang xóa...", - "Unlinking...": "Đang bỏ liên kết...", - "Posting...": "Đang gửi...", - "Username can not be empty!": "Tên đăng nhập không được để trống!", - "Cache is not enabled": "Cache không được bật", - "Cache has been cleared": "Cache đã được xóa", - "Rebuild has been done": "Tải lại thành công", - "Saving...": "Đang lưu...", - "Modified": "Đã sửa", - "Created": "Đã tạo", - "Create": "Tạo", - "create": "tạo", - "Overview": "Sơ lược", - "Details": "Chi tiết", - "Add Filter": "Thêm bộ lọc", - "Add Dashlet": "Thêm module", - "Add": "Thêm", - "Reset": "Reset", - "Menu": "Menu", - "More": "Thêm nữa", - "Search": "Tìm kiếm", - "Only My": "Chỉ", - "Open": "Mở", - "Admin": "Admin", - "About": "Thông tin", - "Refresh": "Tải lại", - "Remove": "Xóa", - "Options": "Tùy chọn", - "Username": "Tên đăng nhập", - "Password": "Mật khẩu", - "Login": "Đăng nhập", - "Log Out": "Đăng xuất", - "Preferences": "Tùy chỉnh", - "State": "Thành phố", - "Street": "Đường", - "Country": "Quốc gia", - "City": "Quận - huyện", - "PostalCode": "Mã bưu điện", - "Followed": "Đã theo dõi", - "Follow": "Theo dõi", - "Clear Local Cache": "Clear Local Cache", - "Actions": "Hoạt động", - "Delete": "Xóa", - "Update": "Cập nhật", - "Save": "Lưu", - "Edit": "Sửa", - "Cancel": "Bỏ qua", - "Unlink": "Xóa liên kết", - "Mass Update": "Cập nhật", - "Export": "Xuất", - "No Data": "Không có dữ liệu", - "All": "Tất cả", - "Active": "Đang hoạt động", - "Inactive": "Chưa hoạt động", - "Write your comment here": "Viết lời nhắn tại đây", - "Post": "Gửi", - "Stream": "Luồng", - "Show more": "Xem thêm", - "Dashlet Options": "Tùy chọn module", - "Full Form": "Đầy đủ", - "Insert": "Chèn", - "Person": "Cá nhân", - "First Name": "Tên", - "Last Name": "Họ", - "Original": "Gốc", - "You": "Bạn", - "you": "bạn", - "change": "thay đổi", - "Primary": "Chính", - "Save Filters": "Lưu bộ lọc", - "Administration": "Administration", - "Run Import": "Bắt đầu nhập", - "Duplicate": "Trùng", - "Notifications": "Thông báo" - }, - "messages": { - "notModified": "Bạn chưa sửa bản ghi", - "duplicate": "Bản ghi được tạo bị trùng", - "fieldIsRequired": "{field} là bắt buộc", - "fieldShouldBeEmail": "Kiểm tra lại {field}", - "fieldShouldBeFloat": "Kiểm tra lại {field}", - "fieldShouldBeInt": "Kiểm tra lại {field}", - "fieldShouldBeDate": "Kiểm tra lại {field}", - "fieldShouldBeDatetime": "Kiểm tra lại {field}", - "fieldShouldAfter": "{field} cần đặt sau {otherField}", - "fieldShouldBefore": "{field} cần đặt trước {otherField}", - "fieldShouldBeBetween": "{field} cần đặt giữa {min} và {max}", - "fieldShouldBeLess": "{field} cần nhỏ hơn {value}", - "fieldShouldBeGreater": "{field} cần lớn hơn {value}", - "fieldBadPasswordConfirm": "{field} không hợp lệ" - }, - "boolFilters": { - "onlyMy": "Chỉ", - "open": "Mở", - "active": "Đang hoạt động" - }, - "fields": { - "name": "Tên", - "firstName": "Tên", - "lastName": "Họ", - "salutationName": "Chào đón", - "assignedUser": "Phân công", - "emailAddress": "Email", - "assignedUserName": "Thành viên được phân công", - "teams": "Nhóm", - "createdAt": "Tạo lúc", - "modifiedAt": "Sửa lúc", - "createdBy": "Tạo bởi", - "modifiedBy": "Sửa bởi", - "title": "Tiêu đề", - "dateFrom": "Từ ngày", - "dateTo": "Tới ngày", - "autorefreshInterval": "Tự động tải lại sau", - "displayRecords": "Xem bản ghi" - }, - "links": { - "teams": "Nhóm", - "users": "Người dùng" - }, - "dashlets": { - "Stream": "Luồng" - }, - "streamMessages": { - "create": "{user} tạo {entityType} {entity}", - "createAssigned": "{user} tạo {entityType} {entity} phân công cho {assignee}", - "assign": "{user} phân công {entityType} {entity} cho {assignee}", - "post": "{user} đăng {entityType} {entity}", - "attach": "{user} đính kèm ở {entityType} {entity}", - "status": "{user} cập nhật {field} ở {entityType} {entity}", - "update": "{user} cập nhật {entityType} {entity}", - "createRelated": "{user} created {relatedEntityType} {relatedEntity} linked to {entityType} {entity}", - "emailReceived": "{entity} đã được nhận bởi {entityType} {entity}", - - "createThis": "{user} tạo {entityType}", - "createAssignedThis": "{user} tạo {entityType} phân công cho {assignee}", - "assignThis": "{user} phân công {entityType} cho {assignee}", - "postThis": "{user} đã đăng", - "attachThis": "{user} đã đính kèm", - "statusThis": "{user} đã cập nhật {field}", - "updateThis": "{user} cập nhật {entityType}", - "createRelatedThis": "{user} created {relatedEntityType} {relatedEntity} linked to this {entityType}", - "emailReceivedThis": "{entity} đã được nhận" - }, - "lists": { - "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] - }, - "options": { - "salutationName": { - "Mr.": "Ông.", - "Mrs.": "Bà.", - "Dr.": "Ông.", - "Drs.": "Bà." - }, - "language": { - "af_ZA": "Afrikaans", - "az_AZ": "Azerbaijani", - "be_BY": "Belarusian", - "bg_BG": "Bulgarian", - "bn_IN": "Bengali", - "bs_BA": "Bosnian", - "ca_ES": "Catalan", - "cs_CZ": "Czech", - "cy_GB": "Welsh", - "da_DK": "Danish", - "de_DE": "German", - "el_GR": "Greek", - "en_GB":"English (UK)", - "en_US":"English (US)", - "es_ES":"Spanish (Spain)", - "et_EE": "Estonian", - "eu_ES": "Basque", - "fa_IR": "Persian", - "fi_FI": "Finnish", - "fo_FO": "Faroese", - "fr_CA":"French (Canada)", - "fr_FR":"French (France)", - "ga_IE": "Irish", - "gl_ES": "Galician", - "gn_PY": "Guarani", - "he_IL": "Hebrew", - "hi_IN": "Hindi", - "hr_HR": "Croatian", - "hu_HU": "Hungarian", - "hy_AM": "Armenian", - "id_ID": "Indonesian", - "is_IS": "Icelandic", - "it_IT": "Italian", - "ja_JP": "Japanese", - "ka_GE": "Georgian", - "km_KH": "Khmer", - "ko_KR": "Korean", - "ku_TR": "Kurdish", - "lt_LT": "Lithuanian", - "lv_LV": "Latvian", - "mk_MK": "Macedonian", - "ml_IN": "Malayalam", - "ms_MY": "Malay", - "nb_NO": "Norwegian Bokmål", - "nn_NO": "Norwegian Nynorsk", - "ne_NP": "Nepali", - "nl_NL": "Dutch", - "pa_IN": "Punjabi", - "pl_PL": "Polish", - "ps_AF": "Pashto", - "pt_BR":"Portuguese (Brazil)", - "pt_PT":"Portuguese (Portugal)", - "ro_RO": "Romanian", - "ru_RU": "Russian", - "sk_SK": "Slovak", - "sl_SI": "Slovene", - "sq_AL": "Albanian", - "sr_RS": "Serbian", - "sv_SE": "Swedish", - "sw_KE": "Swahili", - "ta_IN": "Tamil", - "te_IN": "Telugu", - "th_TH": "Thai", - "tl_PH": "Tagalog", - "tr_TR": "Turkish", - "uk_UA": "Ukrainian", - "ur_PK": "Urdu", - "vi_VN": "Vietnamese", - "zh_CN":"Simplified Chinese (China)", - "zh_HK":"Traditional Chinese (Hong Kong)", - "zh_TW":"Traditional Chinese (Taiwan)" - }, - "dateSearchRanges": { - "on": "On", - "notOn": "Not On", - "after": "After", - "before": "Before", - "between": "Between", - "today": "Today", - "past": "Past", - "future": "Future" - }, - "intSearchRanges": { - "equals": "Equals", - "notEquals": "Not Equals", - "greaterThan": "Greater Than", - "lessThan": "Less Than", - "greaterThanOrEquals": "Greater Than or Equals", - "lessThanOrEquals": "Less Than or Equals", - "between": "Between" - }, - "autorefreshInterval": { - "0": "Trống", - "0.5": "30 seconds", - "1": "1 minute", - "2": "2 minutes", - "5": "5 minutes", - "10": "10 minutes" - }, - "phoneNumber": { - "Mobile": "Mobile", - "Office": "Office", - "Fax": "Fax", - "Home": "Home", - "Other": "Khác" - } - }, - "sets": { - "summernote": { - "NOTICE": "You can find translation here: https://github.com/HackerWins/summernote/tree/master/lang", - "font":{ - "bold": "Đậm", - "italic": "Nghiêng", - "underline": "Gạch chân", - "strike": "Gạch giữa", - "clear": "Xóa định dạng", - "height": "Kích thước dòng", - "name": "Font chữ", - "size": "Kích thước" - }, - "image":{ - "image": "Ảnh", - "insert": "Chèn ảnh", - "resizeFull": "Ảnh đầy đủ", - "resizeHalf": "Giảm nửa kích thước", - "resizeQuarter": "Giảm 1/4 kích thước", - "floatLeft": "Căn trái", - "floatRight": "Căn phải", - "floatNone": "Không căn lề", - "dragImageHere": "Thả ảnh vào đây", - "selectFromFiles": "Chọn từ thư mục", - "url": "Đường dẫn ảnh", - "remove": "Xóa ảnh" - }, - "link":{ - "link": "Đường dẫn", - "insert": "Chèn đường dẫn", - "unlink": "Xóa liên kết", - "edit": "Sửa", - "textToDisplay": "Chữ hiển thị", - "url":"To what URL should this link go?", - "openInNewWindow": "Mở trong cửa sổ mới" - }, - "video":{ - "video": "Video", - "videoLink": "Đường dẫn video", - "insert": "Chèn Video", - "url":"Video URL?", - "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" - }, - "table":{ - "table": "Bảng" - }, - "hr":{ - "insert": "Thêm dòng ngang" - }, - "style":{ - "style": "Kiểu", - "normal": "Bình thường", - "blockquote": "Trích dẫn", - "pre": "Code", - "h1": "Tiêu đề 1", - "h2": "Tiêu đề 2", - "h3": "Tiêu đềTiêu đề 3", - "h4": "Tiêu đề 4", - "h5": "Tiêu đề 5", - "h6": "Tiêu đề 6" - }, - "lists":{ - "unordered": "Liệt kê", - "ordered": "Danh sách" - }, - "options":{ - "help": "Trợ giúp", - "fullscreen": "Đầy màn hình", - "codeview": "Hiển thị dạng code" - }, - "paragraph":{ - "paragraph": "Đoạn văn bản", - "outdent": "Bỏ lùi đầu dòng", - "indent": "Lùi đầu dòng", - "left": "Căn lề trái", - "center": "Căn lề giữa", - "right": "Căn lề phải", - "justify": "Căn lề 2 bên" - }, - "color":{ - "recent": "Màu đã dùng", - "more": "Thêm màu", - "background": "Màu nền", - "foreground": "Màu chữ", - "transparent": "Trong suốt", - "setTransparent": "Chỉnh độ trong suốt", - "reset": "Reset", - "resetToDefault": "Đặt lại mặc định" - }, - "shortcut":{ - "shortcuts": "Phím tắt", - "close": "Đóng", - "textFormatting": "Định dạng chữ", - "action": "Hành động", - "paragraphFormatting": "Định dạng đoạn văn bản", - "documentStyle": "Kiểu văn bản" - }, - "history":{ - "undo": "Quay lui", - "redo": "Tiến lên" - } - } - } + "scopeNames": { + "Email": "Email", + "User": "Người dùng", + "Team": "Nhóm", + "Role": "Vai trò", + "EmailTemplate": "Mẫu email", + "OutboundEmail": "Email đã gửi", + "ScheduledJob": "Công việc đã lên lịch" + }, + "scopeNamesPlural": { + "Email": "Địa chỉ email", + "User": "Người dùng", + "Team": "Nhóm", + "Role": "Vai trò", + "EmailTemplate": "Mẫu email", + "OutboundEmail": "Email đã gửi", + "ScheduledJob": "Công việc đã lên lịch" + }, + "labels": { + "Misc": "Khác", + "Merge": "Gộp", + "None": "Trống", + "by": "bởi", + "Saved": "Đã lưu", + "Error": "Lỗi", + "Select": "Chọn", + "Not valid": "Không phù hợp", + "Please wait...": "Vui lòng đợi...", + "Please wait": "Vui lòng đợi", + "Loading...": "Đang tải...", + "Uploading...": "Đang tải lên...", + "Sending...": "Đang gửi...", + "Removed": "Đã xóa", + "Posted": "Đã đăng", + "Linked": "Đã liên kết", + "Unlinked": "Đã bỏ liên kết", + "Access denied": "Từ chối truy cập", + "Access": "Truy cập", + "Are you sure?": "Are you sure?", + "Record has been removed": "bản ghi đã được xóa", + "Wrong username/password": "Sai tên truy cập và mật khẩu", + "Post cannot be empty": "Nội dung không được để trống", + "Removing...": "Đang xóa...", + "Unlinking...": "Đang bỏ liên kết...", + "Posting...": "Đang gửi...", + "Username can not be empty!": "Tên đăng nhập không được để trống!", + "Cache is not enabled": "Cache không được bật", + "Cache has been cleared": "Cache đã được xóa", + "Rebuild has been done": "Tải lại thành công", + "Saving...": "Đang lưu...", + "Modified": "Đã sửa", + "Created": "Đã tạo", + "Create": "Tạo", + "create": "tạo", + "Overview": "Sơ lược", + "Details": "Chi tiết", + "Add Filter": "Thêm bộ lọc", + "Add Dashlet": "Thêm module", + "Add": "Thêm", + "Reset": "Reset", + "Menu": "Menu", + "More": "Thêm nữa", + "Search": "Tìm kiếm", + "Only My": "Chỉ", + "Open": "Mở", + "Admin": "Admin", + "About": "Thông tin", + "Refresh": "Tải lại", + "Remove": "Xóa", + "Options": "Tùy chọn", + "Username": "Tên đăng nhập", + "Password": "Mật khẩu", + "Login": "Đăng nhập", + "Log Out": "Đăng xuất", + "Preferences": "Tùy chỉnh", + "State": "Thành phố", + "Street": "Đường", + "Country": "Quốc gia", + "City": "Quận - huyện", + "PostalCode": "Mã bưu điện", + "Followed": "Đã theo dõi", + "Follow": "Theo dõi", + "Clear Local Cache": "Clear Local Cache", + "Actions": "Hoạt động", + "Delete": "Xóa", + "Update": "Cập nhật", + "Save": "Lưu", + "Edit": "Sửa", + "Cancel": "Bỏ qua", + "Unlink": "Xóa liên kết", + "Mass Update": "Cập nhật", + "Export": "Xuất", + "No Data": "Không có dữ liệu", + "All": "Tất cả", + "Active": "Đang hoạt động", + "Inactive": "Chưa hoạt động", + "Write your comment here": "Viết lời nhắn tại đây", + "Post": "Gửi", + "Stream": "Luồng", + "Show more": "Xem thêm", + "Dashlet Options": "Tùy chọn module", + "Full Form": "Đầy đủ", + "Insert": "Chèn", + "Person": "Cá nhân", + "First Name": "Tên", + "Last Name": "Họ", + "Original": "Gốc", + "You": "Bạn", + "you": "bạn", + "change": "thay đổi", + "Primary": "Chính", + "Save Filters": "Lưu bộ lọc", + "Administration": "Administration", + "Run Import": "Bắt đầu nhập", + "Duplicate": "Trùng", + "Notifications": "Thông báo" + }, + "messages": { + "notModified": "Bạn chưa sửa bản ghi", + "duplicate": "Bản ghi được tạo bị trùng", + "fieldIsRequired": "{field} là bắt buộc", + "fieldShouldBeEmail": "Kiểm tra lại {field}", + "fieldShouldBeFloat": "Kiểm tra lại {field}", + "fieldShouldBeInt": "Kiểm tra lại {field}", + "fieldShouldBeDate": "Kiểm tra lại {field}", + "fieldShouldBeDatetime": "Kiểm tra lại {field}", + "fieldShouldAfter": "{field} cần đặt sau {otherField}", + "fieldShouldBefore": "{field} cần đặt trước {otherField}", + "fieldShouldBeBetween": "{field} cần đặt giữa {min} và {max}", + "fieldShouldBeLess": "{field} cần nhỏ hơn {value}", + "fieldShouldBeGreater": "{field} cần lớn hơn {value}", + "fieldBadPasswordConfirm": "{field} không hợp lệ" + }, + "boolFilters": { + "onlyMy": "Chỉ", + "open": "Mở", + "active": "Đang hoạt động" + }, + "fields": { + "name": "Tên", + "firstName": "Tên", + "lastName": "Họ", + "salutationName": "Chào đón", + "assignedUser": "Phân công", + "emailAddress": "Email", + "assignedUserName": "Thành viên được phân công", + "teams": "Nhóm", + "createdAt": "Tạo lúc", + "modifiedAt": "Sửa lúc", + "createdBy": "Tạo bởi", + "modifiedBy": "Sửa bởi", + "title": "Tiêu đề", + "dateFrom": "Từ ngày", + "dateTo": "Tới ngày", + "autorefreshInterval": "Tự động tải lại sau", + "displayRecords": "Xem bản ghi" + }, + "links": { + "teams": "Nhóm", + "users": "Người dùng" + }, + "dashlets": { + "Stream": "Luồng" + }, + "streamMessages": { + "create": "{user} tạo {entityType} {entity}", + "createAssigned": "{user} tạo {entityType} {entity} phân công cho {assignee}", + "assign": "{user} phân công {entityType} {entity} cho {assignee}", + "post": "{user} đăng {entityType} {entity}", + "attach": "{user} đính kèm ở {entityType} {entity}", + "status": "{user} cập nhật {field} ở {entityType} {entity}", + "update": "{user} cập nhật {entityType} {entity}", + "createRelated": "{user} created {relatedEntityType} {relatedEntity} linked to {entityType} {entity}", + "emailReceived": "{entity} đã được nhận bởi {entityType} {entity}", + + "createThis": "{user} tạo {entityType}", + "createAssignedThis": "{user} tạo {entityType} phân công cho {assignee}", + "assignThis": "{user} phân công {entityType} cho {assignee}", + "postThis": "{user} đã đăng", + "attachThis": "{user} đã đính kèm", + "statusThis": "{user} đã cập nhật {field}", + "updateThis": "{user} cập nhật {entityType}", + "createRelatedThis": "{user} created {relatedEntityType} {relatedEntity} linked to this {entityType}", + "emailReceivedThis": "{entity} đã được nhận" + }, + "lists": { + "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + "dayNamesShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + "dayNamesMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] + }, + "options": { + "salutationName": { + "Mr.": "Ông.", + "Mrs.": "Bà.", + "Dr.": "Ông.", + "Drs.": "Bà." + }, + "language": { + "af_ZA": "Afrikaans", + "az_AZ": "Azerbaijani", + "be_BY": "Belarusian", + "bg_BG": "Bulgarian", + "bn_IN": "Bengali", + "bs_BA": "Bosnian", + "ca_ES": "Catalan", + "cs_CZ": "Czech", + "cy_GB": "Welsh", + "da_DK": "Danish", + "de_DE": "German", + "el_GR": "Greek", + "en_GB":"English (UK)", + "en_US":"English (US)", + "es_ES":"Spanish (Spain)", + "et_EE": "Estonian", + "eu_ES": "Basque", + "fa_IR": "Persian", + "fi_FI": "Finnish", + "fo_FO": "Faroese", + "fr_CA":"French (Canada)", + "fr_FR":"French (France)", + "ga_IE": "Irish", + "gl_ES": "Galician", + "gn_PY": "Guarani", + "he_IL": "Hebrew", + "hi_IN": "Hindi", + "hr_HR": "Croatian", + "hu_HU": "Hungarian", + "hy_AM": "Armenian", + "id_ID": "Indonesian", + "is_IS": "Icelandic", + "it_IT": "Italian", + "ja_JP": "Japanese", + "ka_GE": "Georgian", + "km_KH": "Khmer", + "ko_KR": "Korean", + "ku_TR": "Kurdish", + "lt_LT": "Lithuanian", + "lv_LV": "Latvian", + "mk_MK": "Macedonian", + "ml_IN": "Malayalam", + "ms_MY": "Malay", + "nb_NO": "Norwegian Bokmål", + "nn_NO": "Norwegian Nynorsk", + "ne_NP": "Nepali", + "nl_NL": "Dutch", + "pa_IN": "Punjabi", + "pl_PL": "Polish", + "ps_AF": "Pashto", + "pt_BR":"Portuguese (Brazil)", + "pt_PT":"Portuguese (Portugal)", + "ro_RO": "Romanian", + "ru_RU": "Russian", + "sk_SK": "Slovak", + "sl_SI": "Slovene", + "sq_AL": "Albanian", + "sr_RS": "Serbian", + "sv_SE": "Swedish", + "sw_KE": "Swahili", + "ta_IN": "Tamil", + "te_IN": "Telugu", + "th_TH": "Thai", + "tl_PH": "Tagalog", + "tr_TR": "Turkish", + "uk_UA": "Ukrainian", + "ur_PK": "Urdu", + "vi_VN": "Vietnamese", + "zh_CN":"Simplified Chinese (China)", + "zh_HK":"Traditional Chinese (Hong Kong)", + "zh_TW":"Traditional Chinese (Taiwan)" + }, + "dateSearchRanges": { + "on": "On", + "notOn": "Not On", + "after": "After", + "before": "Before", + "between": "Between", + "today": "Today", + "past": "Past", + "future": "Future" + }, + "intSearchRanges": { + "equals": "Equals", + "notEquals": "Not Equals", + "greaterThan": "Greater Than", + "lessThan": "Less Than", + "greaterThanOrEquals": "Greater Than or Equals", + "lessThanOrEquals": "Less Than or Equals", + "between": "Between" + }, + "autorefreshInterval": { + "0": "Trống", + "0.5": "30 seconds", + "1": "1 minute", + "2": "2 minutes", + "5": "5 minutes", + "10": "10 minutes" + }, + "phoneNumber": { + "Mobile": "Mobile", + "Office": "Office", + "Fax": "Fax", + "Home": "Home", + "Other": "Khác" + } + }, + "sets": { + "summernote": { + "NOTICE": "You can find translation here: https://github.com/HackerWins/summernote/tree/master/lang", + "font":{ + "bold": "Đậm", + "italic": "Nghiêng", + "underline": "Gạch chân", + "strike": "Gạch giữa", + "clear": "Xóa định dạng", + "height": "Kích thước dòng", + "name": "Font chữ", + "size": "Kích thước" + }, + "image":{ + "image": "Ảnh", + "insert": "Chèn ảnh", + "resizeFull": "Ảnh đầy đủ", + "resizeHalf": "Giảm nửa kích thước", + "resizeQuarter": "Giảm 1/4 kích thước", + "floatLeft": "Căn trái", + "floatRight": "Căn phải", + "floatNone": "Không căn lề", + "dragImageHere": "Thả ảnh vào đây", + "selectFromFiles": "Chọn từ thư mục", + "url": "Đường dẫn ảnh", + "remove": "Xóa ảnh" + }, + "link":{ + "link": "Đường dẫn", + "insert": "Chèn đường dẫn", + "unlink": "Xóa liên kết", + "edit": "Sửa", + "textToDisplay": "Chữ hiển thị", + "url":"To what URL should this link go?", + "openInNewWindow": "Mở trong cửa sổ mới" + }, + "video":{ + "video": "Video", + "videoLink": "Đường dẫn video", + "insert": "Chèn Video", + "url":"Video URL?", + "providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)" + }, + "table":{ + "table": "Bảng" + }, + "hr":{ + "insert": "Thêm dòng ngang" + }, + "style":{ + "style": "Kiểu", + "normal": "Bình thường", + "blockquote": "Trích dẫn", + "pre": "Code", + "h1": "Tiêu đề 1", + "h2": "Tiêu đề 2", + "h3": "Tiêu đềTiêu đề 3", + "h4": "Tiêu đề 4", + "h5": "Tiêu đề 5", + "h6": "Tiêu đề 6" + }, + "lists":{ + "unordered": "Liệt kê", + "ordered": "Danh sách" + }, + "options":{ + "help": "Trợ giúp", + "fullscreen": "Đầy màn hình", + "codeview": "Hiển thị dạng code" + }, + "paragraph":{ + "paragraph": "Đoạn văn bản", + "outdent": "Bỏ lùi đầu dòng", + "indent": "Lùi đầu dòng", + "left": "Căn lề trái", + "center": "Căn lề giữa", + "right": "Căn lề phải", + "justify": "Căn lề 2 bên" + }, + "color":{ + "recent": "Màu đã dùng", + "more": "Thêm màu", + "background": "Màu nền", + "foreground": "Màu chữ", + "transparent": "Trong suốt", + "setTransparent": "Chỉnh độ trong suốt", + "reset": "Reset", + "resetToDefault": "Đặt lại mặc định" + }, + "shortcut":{ + "shortcuts": "Phím tắt", + "close": "Đóng", + "textFormatting": "Định dạng chữ", + "action": "Hành động", + "paragraphFormatting": "Định dạng đoạn văn bản", + "documentStyle": "Kiểu văn bản" + }, + "history":{ + "undo": "Quay lui", + "redo": "Tiến lên" + } + } + } } diff --git a/application/Espo/Resources/i18n/vi_VN/Note.json b/application/Espo/Resources/i18n/vi_VN/Note.json index 58a8f5cb03..04ac101f63 100644 --- a/application/Espo/Resources/i18n/vi_VN/Note.json +++ b/application/Espo/Resources/i18n/vi_VN/Note.json @@ -1,6 +1,6 @@ { - "fields": { - "post": "Gửi", - "attachments": "Đính kèm" - } + "fields": { + "post": "Gửi", + "attachments": "Đính kèm" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/Preferences.json b/application/Espo/Resources/i18n/vi_VN/Preferences.json index 6784cb8d94..a0fcf02ef3 100644 --- a/application/Espo/Resources/i18n/vi_VN/Preferences.json +++ b/application/Espo/Resources/i18n/vi_VN/Preferences.json @@ -1,32 +1,32 @@ { - "fields": { - "dateFormat": "Định dạng ngày", - "timeFormat": "Định dạng thời gian", - "timeZone": "Múi giờ", - "weekStart": "Ngày đầu tiên của tuần", - "thousandSeparator": "Dấu phân cách hàng nghìn", - "decimalMark": "Dấu phân cách thập phân", - "defaultCurrency": "Tiền tệ mặc định", - "currencyList": "Danh sách tiền tệ", - "language": "Ngôn ngữ", - - "smtpServer": "Máy chủ", - "smtpPort": "Cổng", - "smtpAuth": "Truy cập", - "smtpSecurity": "Bảo mật", - "smtpUsername": "Tên đăng nhập", - "emailAddress": "Email", - "smtpPassword": "Mật khẩu", - "smtpEmailAddress": "Địa chỉ email", - - "exportDelimiter": "Xuất dấu phân cách" - }, - "links": { - }, - "options": { - "weekStart": { - "0": "Chủ nhật", - "1": "Thứ 2" - } - } + "fields": { + "dateFormat": "Định dạng ngày", + "timeFormat": "Định dạng thời gian", + "timeZone": "Múi giờ", + "weekStart": "Ngày đầu tiên của tuần", + "thousandSeparator": "Dấu phân cách hàng nghìn", + "decimalMark": "Dấu phân cách thập phân", + "defaultCurrency": "Tiền tệ mặc định", + "currencyList": "Danh sách tiền tệ", + "language": "Ngôn ngữ", + + "smtpServer": "Máy chủ", + "smtpPort": "Cổng", + "smtpAuth": "Truy cập", + "smtpSecurity": "Bảo mật", + "smtpUsername": "Tên đăng nhập", + "emailAddress": "Email", + "smtpPassword": "Mật khẩu", + "smtpEmailAddress": "Địa chỉ email", + + "exportDelimiter": "Xuất dấu phân cách" + }, + "links": { + }, + "options": { + "weekStart": { + "0": "Chủ nhật", + "1": "Thứ 2" + } + } } diff --git a/application/Espo/Resources/i18n/vi_VN/Role.json b/application/Espo/Resources/i18n/vi_VN/Role.json index 3eecea4c34..0d54398cc5 100644 --- a/application/Espo/Resources/i18n/vi_VN/Role.json +++ b/application/Espo/Resources/i18n/vi_VN/Role.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Tên", - "roles": "Vai trò" - }, - "links": { - "users": "Người dùng", - "teams": "Nhóm" - }, - "labels": { - "Access": "Truy cập", - "Create Role": "Tạo vai trò" - }, - "options": { - "accessList": { - "not-set": "chưa đặt", - "enabled": "kích hoạt", - "disabled": "tắt" - }, - "levelList": { - "all": "tất cả", - "team": "nhóm", - "own": "sở hữu", - "no": "không" - } - }, - "actions": { - "read": "Đọc", - "edit": "Sửa", - "delete": "Xóa" - } + "fields": { + "name": "Tên", + "roles": "Vai trò" + }, + "links": { + "users": "Người dùng", + "teams": "Nhóm" + }, + "labels": { + "Access": "Truy cập", + "Create Role": "Tạo vai trò" + }, + "options": { + "accessList": { + "not-set": "chưa đặt", + "enabled": "kích hoạt", + "disabled": "tắt" + }, + "levelList": { + "all": "tất cả", + "team": "nhóm", + "own": "sở hữu", + "no": "không" + } + }, + "actions": { + "read": "Đọc", + "edit": "Sửa", + "delete": "Xóa" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/ScheduledJob.json b/application/Espo/Resources/i18n/vi_VN/ScheduledJob.json index b1c40eb172..a3a5592754 100644 --- a/application/Espo/Resources/i18n/vi_VN/ScheduledJob.json +++ b/application/Espo/Resources/i18n/vi_VN/ScheduledJob.json @@ -1,30 +1,30 @@ { - "fields": { - "name": "Tên", - "status": "Trạng thái", - "job": "Công việc", - "scheduling": "Scheduling (crontab notation)" - }, - "links": { - "log": "Nhật ký" - }, - "labels": { - "Create ScheduledJob": "Lên lịch công việc" - }, - "options": { - "job": { - "CheckInboundEmails": "Kiểm tra hộp thư đến", - "Cleanup": "Dọn dẹp" - }, - "cronSetup": { - "linux": "Note: Add this line to the crontab file to run Espo Scheduled Jobs:", - "mac": "Note: Add this line to the crontab file to run Espo Scheduled Jobs:", - "windows": "Note: Create a batch file with the following commands to run Espo Scheduled Jobs using Windows Scheduled Tasks:", - "default": "Note: Add this command to Cron Job (Scheduled Task):" - }, - "status": { - "Active": "Đang hoạt động", - "Inactive": "Chưa hoạt động" - } - } + "fields": { + "name": "Tên", + "status": "Trạng thái", + "job": "Công việc", + "scheduling": "Scheduling (crontab notation)" + }, + "links": { + "log": "Nhật ký" + }, + "labels": { + "Create ScheduledJob": "Lên lịch công việc" + }, + "options": { + "job": { + "CheckInboundEmails": "Kiểm tra hộp thư đến", + "Cleanup": "Dọn dẹp" + }, + "cronSetup": { + "linux": "Note: Add this line to the crontab file to run Espo Scheduled Jobs:", + "mac": "Note: Add this line to the crontab file to run Espo Scheduled Jobs:", + "windows": "Note: Create a batch file with the following commands to run Espo Scheduled Jobs using Windows Scheduled Tasks:", + "default": "Note: Add this command to Cron Job (Scheduled Task):" + }, + "status": { + "Active": "Đang hoạt động", + "Inactive": "Chưa hoạt động" + } + } } diff --git a/application/Espo/Resources/i18n/vi_VN/ScheduledJobLogRecord.json b/application/Espo/Resources/i18n/vi_VN/ScheduledJobLogRecord.json index 92e3ef7c3e..be8e66c83a 100644 --- a/application/Espo/Resources/i18n/vi_VN/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/i18n/vi_VN/ScheduledJobLogRecord.json @@ -1,6 +1,6 @@ { - "fields": { - "status": "Trạng thái", - "executionTime": "Thời gian hoạt động" - } + "fields": { + "status": "Trạng thái", + "executionTime": "Thời gian hoạt động" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/Settings.json b/application/Espo/Resources/i18n/vi_VN/Settings.json index 63517c5703..5b39e4e29a 100644 --- a/application/Espo/Resources/i18n/vi_VN/Settings.json +++ b/application/Espo/Resources/i18n/vi_VN/Settings.json @@ -1,64 +1,64 @@ { - "fields": { - "useCache": "Dùng Cache", - "dateFormat": "Định dạng ngày", - "timeFormat": "Định dạng thời gian", - "timeZone": "Múi giờ", - "weekStart": "Ngày đầu tiên của tuần", - "thousandSeparator": "Dấu phân cách hàng nghìn", - "decimalMark": "Dấu phân cách thập phân", - "defaultCurrency": "Tiền tệ mặc định", - "currencyList": "Danh sách tiền tệ", - "language": "Ngôn ngữ", - - "companyLogo": "Logo công ty", - - "smtpServer": "Máy chủ", - "smtpPort": "Cổng", - "smtpAuth": "Truy cập", - "smtpSecurity": "Bảo mật", - "smtpUsername": "Tên đăng nhập", - "emailAddress": "Email", - "smtpPassword": "Mật khẩu", - "outboundEmailFromName": "tên người gửi", - "outboundEmailFromAddress": "Địa chỉ gửi", - "outboundEmailIsShared": "Được chia sẻ", - - "recordsPerPage": "Số bản ghi trên mỗi trang", - "recordsPerPageSmall": "Records Per Page (Small)", - "tabList": "Danh sách Tab", - "quickCreateList": "Tạo nhanh danh sách", - - "exportDelimiter": "Xuất dấu phân cách", - - "authenticationMethod": "Phương thức xác thực", - "ldapHost": "Máy chủ", - "ldapPort": "Cổng", - "ldapAuth": "Truy cập", - "ldapUsername": "Tên đăng nhập", - "ldapPassword": "Mật khẩu", - "ldapBindRequiresDn": "Yêu cầu Dn", - "ldapBaseDn": "Dn gốc", - "ldapAccountCanonicalForm": "Account Canonical Form", - "ldapAccountDomainName": "Tên miền tài khoản", - "ldapTryUsernameSplit": "Thử lại", - "ldapCreateEspoUser": "Tạo người dùng", - "ldapSecurity": "Bảo mật", - "ldapUserLoginFilter": "Bộ lọc đăng nhập", - "ldapAccountDomainNameShort": "Tên miền tài khoản", - "ldapOptReferrals": "Được giới thiệu", - "disableExport": "Disable Export (only admin is allowed)" - }, - "options": { - "weekStart": { - "0": "Chủ nhật", - "1": "Thứ 2" - } - }, - "labels": { - "System": "Hệ thống", - "Locale": "Bản địa hóa", - "SMTP": "SMTP", - "Configuration": "Tùy chỉnh" - } + "fields": { + "useCache": "Dùng Cache", + "dateFormat": "Định dạng ngày", + "timeFormat": "Định dạng thời gian", + "timeZone": "Múi giờ", + "weekStart": "Ngày đầu tiên của tuần", + "thousandSeparator": "Dấu phân cách hàng nghìn", + "decimalMark": "Dấu phân cách thập phân", + "defaultCurrency": "Tiền tệ mặc định", + "currencyList": "Danh sách tiền tệ", + "language": "Ngôn ngữ", + + "companyLogo": "Logo công ty", + + "smtpServer": "Máy chủ", + "smtpPort": "Cổng", + "smtpAuth": "Truy cập", + "smtpSecurity": "Bảo mật", + "smtpUsername": "Tên đăng nhập", + "emailAddress": "Email", + "smtpPassword": "Mật khẩu", + "outboundEmailFromName": "tên người gửi", + "outboundEmailFromAddress": "Địa chỉ gửi", + "outboundEmailIsShared": "Được chia sẻ", + + "recordsPerPage": "Số bản ghi trên mỗi trang", + "recordsPerPageSmall": "Records Per Page (Small)", + "tabList": "Danh sách Tab", + "quickCreateList": "Tạo nhanh danh sách", + + "exportDelimiter": "Xuất dấu phân cách", + + "authenticationMethod": "Phương thức xác thực", + "ldapHost": "Máy chủ", + "ldapPort": "Cổng", + "ldapAuth": "Truy cập", + "ldapUsername": "Tên đăng nhập", + "ldapPassword": "Mật khẩu", + "ldapBindRequiresDn": "Yêu cầu Dn", + "ldapBaseDn": "Dn gốc", + "ldapAccountCanonicalForm": "Account Canonical Form", + "ldapAccountDomainName": "Tên miền tài khoản", + "ldapTryUsernameSplit": "Thử lại", + "ldapCreateEspoUser": "Tạo người dùng", + "ldapSecurity": "Bảo mật", + "ldapUserLoginFilter": "Bộ lọc đăng nhập", + "ldapAccountDomainNameShort": "Tên miền tài khoản", + "ldapOptReferrals": "Được giới thiệu", + "disableExport": "Disable Export (only admin is allowed)" + }, + "options": { + "weekStart": { + "0": "Chủ nhật", + "1": "Thứ 2" + } + }, + "labels": { + "System": "Hệ thống", + "Locale": "Bản địa hóa", + "SMTP": "SMTP", + "Configuration": "Tùy chỉnh" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/Team.json b/application/Espo/Resources/i18n/vi_VN/Team.json index 004d4c5967..be15ba1292 100644 --- a/application/Espo/Resources/i18n/vi_VN/Team.json +++ b/application/Espo/Resources/i18n/vi_VN/Team.json @@ -1,12 +1,12 @@ { - "fields": { - "name": "Tên", - "roles": "Vai trò" - }, - "links": { - "users": "Người dùng" - }, - "labels": { - "Create Team": "Tạo nhóm" - } + "fields": { + "name": "Tên", + "roles": "Vai trò" + }, + "links": { + "users": "Người dùng" + }, + "labels": { + "Create Team": "Tạo nhóm" + } } diff --git a/application/Espo/Resources/i18n/vi_VN/User.json b/application/Espo/Resources/i18n/vi_VN/User.json index bfb6d398ef..806fba857d 100644 --- a/application/Espo/Resources/i18n/vi_VN/User.json +++ b/application/Espo/Resources/i18n/vi_VN/User.json @@ -1,32 +1,32 @@ { - "fields": { - "name": "Tên", - "userName": "Tên người dùng", - "title": "Tiêu đề", - "isAdmin": "Tài khoản Admin", - "defaultTeam": "Nhóm mặc định", - "emailAddress": "Email", - "phoneNumber": "Điện thoại", - "roles": "Vai trò", - "password": "Mật khẩu", - "passwordConfirm": "Xác thực mật khẩu", - "newPassword": "Mật khẩu mới" - }, - "links": { - "teams": "Nhóm", - "roles": "Vai trò" - }, - "labels": { - "Create User": "Tạo người dùng", - "Generate": "Tạo", - "Access": "Truy cập", - "Preferences": "Tùy chỉnh", - "Change Password": "Đổi mật khẩu" - }, - "messages": { - "passwordWillBeSent": "Mật khẩu sẽ được gửi tới email tài khoản", - "accountInfoEmailSubject": "Thông tin tài khoản", - "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", - "passwordChanged": "Mật khẩu đã được đổi" - } + "fields": { + "name": "Tên", + "userName": "Tên người dùng", + "title": "Tiêu đề", + "isAdmin": "Tài khoản Admin", + "defaultTeam": "Nhóm mặc định", + "emailAddress": "Email", + "phoneNumber": "Điện thoại", + "roles": "Vai trò", + "password": "Mật khẩu", + "passwordConfirm": "Xác thực mật khẩu", + "newPassword": "Mật khẩu mới" + }, + "links": { + "teams": "Nhóm", + "roles": "Vai trò" + }, + "labels": { + "Create User": "Tạo người dùng", + "Generate": "Tạo", + "Access": "Truy cập", + "Preferences": "Tùy chỉnh", + "Change Password": "Đổi mật khẩu" + }, + "messages": { + "passwordWillBeSent": "Mật khẩu sẽ được gửi tới email tài khoản", + "accountInfoEmailSubject": "Thông tin tài khoản", + "accountInfoEmailBody": "Your account information:\n\nUsername: {userName}\nPassword: {password}\n\n{siteUrl}", + "passwordChanged": "Mật khẩu đã được đổi" + } } diff --git a/application/Espo/Resources/layouts/AuthToken/list.json b/application/Espo/Resources/layouts/AuthToken/list.json index e03be098be..ab0fa30608 100644 --- a/application/Espo/Resources/layouts/AuthToken/list.json +++ b/application/Espo/Resources/layouts/AuthToken/list.json @@ -1,6 +1,6 @@ [ - {"name":"user"}, - {"name":"ipAddress"}, - {"name":"lastAccess"}, - {"name":"createdAt"} + {"name":"user"}, + {"name":"ipAddress"}, + {"name":"lastAccess"}, + {"name":"createdAt"} ] diff --git a/application/Espo/Resources/layouts/Email/composeSmall.json b/application/Espo/Resources/layouts/Email/composeSmall.json index 2b979aea86..f4c75c7bac 100644 --- a/application/Espo/Resources/layouts/Email/composeSmall.json +++ b/application/Espo/Resources/layouts/Email/composeSmall.json @@ -1,30 +1,30 @@ [ - { - "label":"", - "rows":[ - [ - { - "name":"from", - "view": "Email.Fields.ComposeFromAddress" - }, - {"name":"cc"} - ], - [ - {"name":"to"}, - {"name":"bcc"} - ], - [ - { - "name": "parent" - }, - { - "name":"selectTemplate", - "view":"Email.Fields.SelectTemplate" - } - ], - [{"name":"name","fullWidth":true}], - [{"name":"body","fullWidth":true}], - [{"name":"attachments"},{"name":"isHtml"}] - ] - } + { + "label":"", + "rows":[ + [ + { + "name":"from", + "view": "Email.Fields.ComposeFromAddress" + }, + {"name":"cc"} + ], + [ + {"name":"to"}, + {"name":"bcc"} + ], + [ + { + "name": "parent" + }, + { + "name":"selectTemplate", + "view":"Email.Fields.SelectTemplate" + } + ], + [{"name":"name","fullWidth":true}], + [{"name":"body","fullWidth":true}], + [{"name":"attachments"},{"name":"isHtml"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Email/detail.json b/application/Espo/Resources/layouts/Email/detail.json index 2f3d222203..990fa7b368 100644 --- a/application/Espo/Resources/layouts/Email/detail.json +++ b/application/Espo/Resources/layouts/Email/detail.json @@ -1,13 +1,13 @@ [ - { - "label":"", - "rows":[ - [{"name":"status"},{"name":"from"}], - [{"name":"dateSent"}, {"name":"to"}], - [{"name":"parent"}, {"name":"cc"}], - [{"name":"name","fullWidth":true}], - [{"name":"body","fullWidth":true}], - [{"name":"attachments"},{"name":"isHtml"}] - ] - } + { + "label":"", + "rows":[ + [{"name":"status"},{"name":"from"}], + [{"name":"dateSent"}, {"name":"to"}], + [{"name":"parent"}, {"name":"cc"}], + [{"name":"name","fullWidth":true}], + [{"name":"body","fullWidth":true}], + [{"name":"attachments"},{"name":"isHtml"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Email/detailRestricted.json b/application/Espo/Resources/layouts/Email/detailRestricted.json index 8405f48eb5..1d761501a5 100644 --- a/application/Espo/Resources/layouts/Email/detailRestricted.json +++ b/application/Espo/Resources/layouts/Email/detailRestricted.json @@ -1,13 +1,13 @@ [ - { - "label":"", - "rows":[ - [{"name":"status"},{"name":"from", "readOnly": true}], - [{"name":"dateSent", "readOnly": true}, {"name":"to", "readOnly": true}], - [{"name":"parent"}, {"name":"cc", "readOnly": true}], - [{"name":"name","fullWidth":true, "readOnly": true}], - [{"name":"body","fullWidth":true, "readOnly": true}], - [{"name":"attachments", "readOnly": true}] - ] - } + { + "label":"", + "rows":[ + [{"name":"status"},{"name":"from", "readOnly": true}], + [{"name":"dateSent", "readOnly": true}, {"name":"to", "readOnly": true}], + [{"name":"parent"}, {"name":"cc", "readOnly": true}], + [{"name":"name","fullWidth":true, "readOnly": true}], + [{"name":"body","fullWidth":true, "readOnly": true}], + [{"name":"attachments", "readOnly": true}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Email/detailSmall.json b/application/Espo/Resources/layouts/Email/detailSmall.json index 0fb4e49486..68c76118f8 100644 --- a/application/Espo/Resources/layouts/Email/detailSmall.json +++ b/application/Espo/Resources/layouts/Email/detailSmall.json @@ -1,14 +1,14 @@ [ - { - "label":"", - "rows":[ - [{"name":"dateSent"}], - [{"name":"parent"}], - [{"name":"from"}], - [{"name":"to"}], - [{"name":"name"}], - [{"name":"body"}], - [{"name":"attachments"}] - ] - } + { + "label":"", + "rows":[ + [{"name":"dateSent"}], + [{"name":"parent"}], + [{"name":"from"}], + [{"name":"to"}], + [{"name":"name"}], + [{"name":"body"}], + [{"name":"attachments"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Email/detailSmallRestricted.json b/application/Espo/Resources/layouts/Email/detailSmallRestricted.json index 15da8ba697..c93cda560b 100644 --- a/application/Espo/Resources/layouts/Email/detailSmallRestricted.json +++ b/application/Espo/Resources/layouts/Email/detailSmallRestricted.json @@ -1,14 +1,14 @@ [ - { - "label":"", - "rows":[ - [{"name":"dateSent", "readOnly": true}], - [{"name":"parent"}], - [{"name":"from", "readOnly": true}], - [{"name":"to", "readOnly": true}], - [{"name":"name", "readOnly": true}], - [{"name":"body", "readOnly": true}], - [{"name":"attachments", "readOnly": true}] - ] - } + { + "label":"", + "rows":[ + [{"name":"dateSent", "readOnly": true}], + [{"name":"parent"}], + [{"name":"from", "readOnly": true}], + [{"name":"to", "readOnly": true}], + [{"name":"name", "readOnly": true}], + [{"name":"body", "readOnly": true}], + [{"name":"attachments", "readOnly": true}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Email/filters.json b/application/Espo/Resources/layouts/Email/filters.json index 86ea9458ea..b86290d5bd 100644 --- a/application/Espo/Resources/layouts/Email/filters.json +++ b/application/Espo/Resources/layouts/Email/filters.json @@ -1,8 +1,8 @@ [ - "emailAddress", - "dateSent", - "status", - "parent", - "body", - "teams" + "emailAddress", + "dateSent", + "status", + "parent", + "body", + "teams" ] diff --git a/application/Espo/Resources/layouts/Email/list.json b/application/Espo/Resources/layouts/Email/list.json index e6504f68f6..81a73d8090 100644 --- a/application/Espo/Resources/layouts/Email/list.json +++ b/application/Espo/Resources/layouts/Email/list.json @@ -1,7 +1,7 @@ [ - {"name":"name","width":30,"link":true,"notSortable": true}, - {"name":"fromEmailAddress","notSortable": true}, - {"name":"status","notSortable": true, "width":10}, - {"name":"parent","notSortable": true}, - {"name":"dateSent","view": "Fields.DatetimeShort", "notSortable": true, "width":10, "align": "right"} + {"name":"name","width":30,"link":true,"notSortable": true}, + {"name":"fromEmailAddress","notSortable": true}, + {"name":"status","notSortable": true, "width":10}, + {"name":"parent","notSortable": true}, + {"name":"dateSent","view": "Fields.DatetimeShort", "notSortable": true, "width":10, "align": "right"} ] diff --git a/application/Espo/Resources/layouts/EmailAccount/detail.json b/application/Espo/Resources/layouts/EmailAccount/detail.json index da91a57c8e..e83b3b23d8 100644 --- a/application/Espo/Resources/layouts/EmailAccount/detail.json +++ b/application/Espo/Resources/layouts/EmailAccount/detail.json @@ -1,28 +1,28 @@ [ - { - "label":"Main", - "rows":[ - [ - {"name":"name"}, - {"name":"status"} - ], - [ - {"name":"fetchSince"} - ] - ] - }, - { - "label":"IMAP", - "rows":[ - [ - {"name":"host"},{"name":"ssl"} - ], - [ - {"name":"port"},{"name":"username"} - ], - [ - {"name":"monitoredFolders"},{"name":"password"} - ] - ] - } + { + "label":"Main", + "rows":[ + [ + {"name":"name"}, + {"name":"status"} + ], + [ + {"name":"fetchSince"} + ] + ] + }, + { + "label":"IMAP", + "rows":[ + [ + {"name":"host"},{"name":"ssl"} + ], + [ + {"name":"port"},{"name":"username"} + ], + [ + {"name":"monitoredFolders"},{"name":"password"} + ] + ] + } ] diff --git a/application/Espo/Resources/layouts/EmailTemplate/detail.json b/application/Espo/Resources/layouts/EmailTemplate/detail.json index d0fd524418..2ca48b54d1 100644 --- a/application/Espo/Resources/layouts/EmailTemplate/detail.json +++ b/application/Espo/Resources/layouts/EmailTemplate/detail.json @@ -1,22 +1,22 @@ [ - { - "label":"", - "rows":[ - [ - { - "name":"name" - } - ], - [{"name":"subject","fullWidth":true}], - [ - { - "name":"insertField", - "view": "EmailTemplate.Fields.InsertField", - "fullWidth":true - } - ], - [{"name":"body","fullWidth":true}], - [{"name":"attachments"},{"name":"isHtml"}] - ] - } + { + "label":"", + "rows":[ + [ + { + "name":"name" + } + ], + [{"name":"subject","fullWidth":true}], + [ + { + "name":"insertField", + "view": "EmailTemplate.Fields.InsertField", + "fullWidth":true + } + ], + [{"name":"body","fullWidth":true}], + [{"name":"attachments"},{"name":"isHtml"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/EmailTemplate/detailSmall.json b/application/Espo/Resources/layouts/EmailTemplate/detailSmall.json index f847938b99..fb73a9cb5e 100644 --- a/application/Espo/Resources/layouts/EmailTemplate/detailSmall.json +++ b/application/Espo/Resources/layouts/EmailTemplate/detailSmall.json @@ -1,11 +1,11 @@ [ - { - "label":"", - "rows":[ - [{"name":"name"}], - [{"name":"subject"}], - [{"name":"body","fullWidth":true}], - [{"name":"attachments"},{"name":"isHtml"}] - ] - } + { + "label":"", + "rows":[ + [{"name":"name"}], + [{"name":"subject"}], + [{"name":"body","fullWidth":true}], + [{"name":"attachments"},{"name":"isHtml"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Extension/list.json b/application/Espo/Resources/layouts/Extension/list.json index e75712b7ab..2d3189ac60 100644 --- a/application/Espo/Resources/layouts/Extension/list.json +++ b/application/Espo/Resources/layouts/Extension/list.json @@ -1,6 +1,6 @@ [ - {"name":"name","width":35,"notSortable": true}, - {"name":"version","notSortable": true, "width":15}, - {"name":"description","notSortable": true}, - {"name":"isInstalled","notSortable": true, "width":5} + {"name":"name","width":35,"notSortable": true}, + {"name":"version","notSortable": true, "width":15}, + {"name":"description","notSortable": true}, + {"name":"isInstalled","notSortable": true, "width":5} ] diff --git a/application/Espo/Resources/layouts/Note/detail.json b/application/Espo/Resources/layouts/Note/detail.json index 7199565cfd..a521255035 100644 --- a/application/Espo/Resources/layouts/Note/detail.json +++ b/application/Espo/Resources/layouts/Note/detail.json @@ -1,13 +1,13 @@ [ - { - "label":"", - "rows": [ - [ - {"name":"post"} - ], - [ - {"name":"attachments"} - ] - ] - } + { + "label":"", + "rows": [ + [ + {"name":"post"} + ], + [ + {"name":"attachments"} + ] + ] + } ] diff --git a/application/Espo/Resources/layouts/Note/detailSmall.json b/application/Espo/Resources/layouts/Note/detailSmall.json index 7199565cfd..a521255035 100644 --- a/application/Espo/Resources/layouts/Note/detailSmall.json +++ b/application/Espo/Resources/layouts/Note/detailSmall.json @@ -1,13 +1,13 @@ [ - { - "label":"", - "rows": [ - [ - {"name":"post"} - ], - [ - {"name":"attachments"} - ] - ] - } + { + "label":"", + "rows": [ + [ + {"name":"post"} + ], + [ + {"name":"attachments"} + ] + ] + } ] diff --git a/application/Espo/Resources/layouts/OutboundEmail/detail.json b/application/Espo/Resources/layouts/OutboundEmail/detail.json index bbdea10832..9c3e840e4a 100644 --- a/application/Espo/Resources/layouts/OutboundEmail/detail.json +++ b/application/Espo/Resources/layouts/OutboundEmail/detail.json @@ -1,17 +1,17 @@ [ - { - "label": "SMTP", - "rows": [ - [{"name": "server"}, {"name": "port"}], - [{"name": "auth"}, {"name": "security"}], - [{"name": "username"}], - [{"name": "password"}] - ] - }, - { - "label": "Configuration", - "rows": [ - [{"name": "fromName"}, {"name": "fromAddress"}] - ] - } + { + "label": "SMTP", + "rows": [ + [{"name": "server"}, {"name": "port"}], + [{"name": "auth"}, {"name": "security"}], + [{"name": "username"}], + [{"name": "password"}] + ] + }, + { + "label": "Configuration", + "rows": [ + [{"name": "fromName"}, {"name": "fromAddress"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Preferences/detail.json b/application/Espo/Resources/layouts/Preferences/detail.json index 2caa3668b3..e858253c59 100644 --- a/application/Espo/Resources/layouts/Preferences/detail.json +++ b/application/Espo/Resources/layouts/Preferences/detail.json @@ -1,38 +1,38 @@ [ - { - "label": "Locale", - "rows": [ - [{"name": "dateFormat"}, {"name": "timeFormat"}], - [{"name": "timeZone"}, {"name": "weekStart"}], - [{"name": "defaultCurrency"}], - [{"name": "thousandSeparator"}, {"name": "decimalMark"}], - [{"name": "language"}] - ] - }, - { - "label": "SMTP", - "rows": [ - [ - { - "name": "smtpEmailAddress" - } - ], - [{"name": "smtpServer"}, {"name": "smtpPort"}], - [{"name": "smtpAuth"}, {"name": "smtpSecurity"}], - [{"name": "smtpUsername"}], - [{"name": "smtpPassword"}] - ] - }, - { - "label": "Misc", - "rows": [ - [{"name": "exportDelimiter"}] - ] - }, - { - "label": "Notifications", - "rows": [ - [{"name": "receiveAssignmentEmailNotifications"}] - ] - } + { + "label": "Locale", + "rows": [ + [{"name": "dateFormat"}, {"name": "timeFormat"}], + [{"name": "timeZone"}, {"name": "weekStart"}], + [{"name": "defaultCurrency"}], + [{"name": "thousandSeparator"}, {"name": "decimalMark"}], + [{"name": "language"}] + ] + }, + { + "label": "SMTP", + "rows": [ + [ + { + "name": "smtpEmailAddress" + } + ], + [{"name": "smtpServer"}, {"name": "smtpPort"}], + [{"name": "smtpAuth"}, {"name": "smtpSecurity"}], + [{"name": "smtpUsername"}], + [{"name": "smtpPassword"}] + ] + }, + { + "label": "Misc", + "rows": [ + [{"name": "exportDelimiter"}] + ] + }, + { + "label": "Notifications", + "rows": [ + [{"name": "receiveAssignmentEmailNotifications"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/ScheduledJob/detail.json b/application/Espo/Resources/layouts/ScheduledJob/detail.json index fa1324a042..d3c6b566e7 100644 --- a/application/Espo/Resources/layouts/ScheduledJob/detail.json +++ b/application/Espo/Resources/layouts/ScheduledJob/detail.json @@ -1,9 +1,9 @@ [ - { - "rows": [ - [{"name": "name"}, {"name": "status"}], - [{"name": "job"}], - [{"name": "scheduling"}] - ] - } + { + "rows": [ + [{"name": "name"}, {"name": "status"}], + [{"name": "job"}], + [{"name": "scheduling"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Settings/authentication.json b/application/Espo/Resources/layouts/Settings/authentication.json index ee346e9cfd..3e5e8d295f 100644 --- a/application/Espo/Resources/layouts/Settings/authentication.json +++ b/application/Espo/Resources/layouts/Settings/authentication.json @@ -1,24 +1,24 @@ [ - { - "label": "Configuration", - "rows": [ - [{"name": "authenticationMethod"}] - ] - }, - { - "label": "LDAP", - "name": "LDAP", - "rows": [ - [{"name": "ldapHost"}, {"name": "ldapPort"}], - [{"name": "ldapAuth"}, {"name": "ldapSecurity"}], - [{"name": "ldapUsername"}, false], - [{"name": "ldapPassword"}, false], - [{"name": "ldapBindRequiresDn"}, {"name": "ldapUserLoginFilter"}], - [{"name": "ldapBaseDn"}, false], - [{"name": "ldapAccountCanonicalForm"}, false], - [{"name": "ldapAccountDomainName"}, {"name": "ldapAccountDomainNameShort"}], - [{"name": "ldapTryUsernameSplit"}, {"name": "ldapOptReferrals"}], - [{"name": "ldapCreateEspoUser"}, false] - ] - } + { + "label": "Configuration", + "rows": [ + [{"name": "authenticationMethod"}] + ] + }, + { + "label": "LDAP", + "name": "LDAP", + "rows": [ + [{"name": "ldapHost"}, {"name": "ldapPort"}], + [{"name": "ldapAuth"}, {"name": "ldapSecurity"}], + [{"name": "ldapUsername"}, false], + [{"name": "ldapPassword"}, false], + [{"name": "ldapBindRequiresDn"}, {"name": "ldapUserLoginFilter"}], + [{"name": "ldapBaseDn"}, false], + [{"name": "ldapAccountCanonicalForm"}, false], + [{"name": "ldapAccountDomainName"}, {"name": "ldapAccountDomainNameShort"}], + [{"name": "ldapTryUsernameSplit"}, {"name": "ldapOptReferrals"}], + [{"name": "ldapCreateEspoUser"}, false] + ] + } ] diff --git a/application/Espo/Resources/layouts/Settings/currency.json b/application/Espo/Resources/layouts/Settings/currency.json index 8db7204c0b..de72270c38 100644 --- a/application/Espo/Resources/layouts/Settings/currency.json +++ b/application/Espo/Resources/layouts/Settings/currency.json @@ -1,14 +1,14 @@ [ - { - "label": "Currency Settings", - "rows": [ - [{"name": "defaultCurrency"}, {"name": "currencyList"}] - ] - }, - { - "label": "Currency Rates", - "rows": [ - [{"name": "baseCurrency"}, {"name": "currencyRates"}] - ] - } + { + "label": "Currency Settings", + "rows": [ + [{"name": "defaultCurrency"}, {"name": "currencyList"}] + ] + }, + { + "label": "Currency Rates", + "rows": [ + [{"name": "baseCurrency"}, {"name": "currencyRates"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Settings/outboundEmail.json b/application/Espo/Resources/layouts/Settings/outboundEmail.json index 6c03e2a432..8822d67981 100644 --- a/application/Espo/Resources/layouts/Settings/outboundEmail.json +++ b/application/Espo/Resources/layouts/Settings/outboundEmail.json @@ -1,24 +1,24 @@ [ - { - "label": "SMTP", - "rows": [ - [{"name": "smtpServer"}, {"name": "smtpPort"}], - [{"name": "smtpAuth"}, {"name": "smtpSecurity"}], - [{"name": "smtpUsername"}], - [{"name": "smtpPassword"}] - ] - }, - { - "label": "Configuration", - "rows": [ - [{"name": "outboundEmailFromName"}, {"name": "outboundEmailFromAddress"}], - [{"name": "outboundEmailIsShared"}] - ] - }, - { - "label": "Notifications", - "rows": [ - [{"name": "assignmentEmailNotifications"}, {"name": "assignmentEmailNotificationsEntityList"}] - ] - } + { + "label": "SMTP", + "rows": [ + [{"name": "smtpServer"}, {"name": "smtpPort"}], + [{"name": "smtpAuth"}, {"name": "smtpSecurity"}], + [{"name": "smtpUsername"}], + [{"name": "smtpPassword"}] + ] + }, + { + "label": "Configuration", + "rows": [ + [{"name": "outboundEmailFromName"}, {"name": "outboundEmailFromAddress"}], + [{"name": "outboundEmailIsShared"}] + ] + }, + { + "label": "Notifications", + "rows": [ + [{"name": "assignmentEmailNotifications"}, {"name": "assignmentEmailNotificationsEntityList"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Settings/settings.json b/application/Espo/Resources/layouts/Settings/settings.json index 126b994740..182381aefb 100644 --- a/application/Espo/Resources/layouts/Settings/settings.json +++ b/application/Espo/Resources/layouts/Settings/settings.json @@ -1,18 +1,18 @@ [ - { - "label": "System", - "rows": [ - [{"name": "useCache"},{"name": "companyLogo"}], - [{"name": "disableExport"}] - ] - }, - { - "label": "Locale", - "rows": [ - [{"name": "dateFormat"}, {"name": "timeZone"}], - [{"name": "timeFormat"}, {"name": "weekStart"}], - [{"name": "thousandSeparator"}, {"name": "decimalMark"}], - [{"name": "language"}] - ] - } + { + "label": "System", + "rows": [ + [{"name": "useCache"},{"name": "companyLogo"}], + [{"name": "disableExport"}] + ] + }, + { + "label": "Locale", + "rows": [ + [{"name": "dateFormat"}, {"name": "timeZone"}], + [{"name": "timeFormat"}, {"name": "weekStart"}], + [{"name": "thousandSeparator"}, {"name": "decimalMark"}], + [{"name": "language"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/Settings/userInterface.json b/application/Espo/Resources/layouts/Settings/userInterface.json index c70c581322..04b8fd29a3 100644 --- a/application/Espo/Resources/layouts/Settings/userInterface.json +++ b/application/Espo/Resources/layouts/Settings/userInterface.json @@ -1,9 +1,9 @@ [ - { - "label": "Configuration", - "rows": [ - [{"name": "recordsPerPage"},{"name": "recordsPerPageSmall"}], - [{"name": "tabList"},{"name": "quickCreateList"}] - ] - } + { + "label": "Configuration", + "rows": [ + [{"name": "recordsPerPage"},{"name": "recordsPerPageSmall"}], + [{"name": "tabList"},{"name": "quickCreateList"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/User/detail.json b/application/Espo/Resources/layouts/User/detail.json index 1d48a149cb..cc6d8e15cd 100644 --- a/application/Espo/Resources/layouts/User/detail.json +++ b/application/Espo/Resources/layouts/User/detail.json @@ -1,11 +1,11 @@ [ - { - "label":"Overview", - "rows":[ - [{"name":"userName"},{"name":"isAdmin"}], - [{"name":"name"},{"name":"title"}], - [{"name":"defaultTeam"}], - [{"name":"emailAddress"},{"name":"phoneNumber"}] - ] - } + { + "label":"Overview", + "rows":[ + [{"name":"userName"},{"name":"isAdmin"}], + [{"name":"name"},{"name":"title"}], + [{"name":"defaultTeam"}], + [{"name":"emailAddress"},{"name":"phoneNumber"}] + ] + } ] diff --git a/application/Espo/Resources/layouts/User/detailSmall.json b/application/Espo/Resources/layouts/User/detailSmall.json index cf1c7f2fd7..dc3320bad3 100644 --- a/application/Espo/Resources/layouts/User/detailSmall.json +++ b/application/Espo/Resources/layouts/User/detailSmall.json @@ -1,11 +1,11 @@ [ - { - "label":"", - "rows": [ - [{"name":"name"}], - [{"name":"userName"}], - [{"name":"isAdmin"}], - [{"name":"emailAddress"}] - ] - } + { + "label":"", + "rows": [ + [{"name":"name"}], + [{"name":"userName"}], + [{"name":"isAdmin"}], + [{"name":"emailAddress"}] + ] + } ] diff --git a/application/Espo/Resources/metadata/app/acl.json b/application/Espo/Resources/metadata/app/acl.json index a031135533..be9b918107 100644 --- a/application/Espo/Resources/metadata/app/acl.json +++ b/application/Espo/Resources/metadata/app/acl.json @@ -1,30 +1,30 @@ { - "solid": { - "User": { - "read": "all", - "edit": "no", - "delete": "no" - }, - "Team": { - "read": "all", - "edit": "no", - "delete": "no" - }, - "Note": { - "read": "all", - "edit": "own", - "delete": "own" - }, - "EmailAddress": { - "read": "no", - "edit": "no", - "delete": "no" - }, - "EmailAccount": { - "read": "own", - "edit": "own", - "delete": "own" - }, - "Role": false - } + "solid": { + "User": { + "read": "all", + "edit": "no", + "delete": "no" + }, + "Team": { + "read": "all", + "edit": "no", + "delete": "no" + }, + "Note": { + "read": "all", + "edit": "own", + "delete": "own" + }, + "EmailAddress": { + "read": "no", + "edit": "no", + "delete": "no" + }, + "EmailAccount": { + "read": "own", + "edit": "own", + "delete": "own" + }, + "Role": false + } } diff --git a/application/Espo/Resources/metadata/app/defaultDashboardLayout.json b/application/Espo/Resources/metadata/app/defaultDashboardLayout.json index 9f52712790..f4c139490d 100644 --- a/application/Espo/Resources/metadata/app/defaultDashboardLayout.json +++ b/application/Espo/Resources/metadata/app/defaultDashboardLayout.json @@ -1,22 +1,22 @@ [ - [ - { - "name": "Stream", - "id": "d4" - }, - { - "name": "Calls", - "id": "d1" - } - ], - [ - { - "name": "Tasks", - "id": "d3" - }, - { - "name": "Meetings", - "id": "d2" - } - ] + [ + { + "name": "Stream", + "id": "d4" + }, + { + "name": "Calls", + "id": "d1" + } + ], + [ + { + "name": "Tasks", + "id": "d3" + }, + { + "name": "Meetings", + "id": "d2" + } + ] ] diff --git a/application/Espo/Resources/metadata/app/jsLibs.json b/application/Espo/Resources/metadata/app/jsLibs.json index 8bcd04b5d3..0661c35675 100644 --- a/application/Espo/Resources/metadata/app/jsLibs.json +++ b/application/Espo/Resources/metadata/app/jsLibs.json @@ -1,22 +1,22 @@ { - "Flotr": { - "path": "client/lib/flotr2.min.js", - "exportsTo": "window", - "exportsAs": "Flotr" - }, - "Summernote": { - "path": "client/lib/summernote.min.js", - "exportsTo": "$", - "exportsAs": "summernote" - }, - "Textcomplete": { - "path": "client/lib/jquery.textcomplete.js", - "exportsTo": "$", - "exportsAs": "textcomplete" - }, - "Select2": { - "path": "client/lib/select2.min.js", - "exportsTo": "$", - "exportsAs": "select2" - } + "Flotr": { + "path": "client/lib/flotr2.min.js", + "exportsTo": "window", + "exportsAs": "Flotr" + }, + "Summernote": { + "path": "client/lib/summernote.min.js", + "exportsTo": "$", + "exportsAs": "summernote" + }, + "Textcomplete": { + "path": "client/lib/jquery.textcomplete.js", + "exportsTo": "$", + "exportsAs": "textcomplete" + }, + "Select2": { + "path": "client/lib/select2.min.js", + "exportsTo": "$", + "exportsAs": "select2" + } } diff --git a/application/Espo/Resources/metadata/clientDefs/Email.json b/application/Espo/Resources/metadata/clientDefs/Email.json index d333835bf4..f2708cb27c 100644 --- a/application/Espo/Resources/metadata/clientDefs/Email.json +++ b/application/Espo/Resources/metadata/clientDefs/Email.json @@ -22,15 +22,15 @@ } ], "dropdown": [ - { + { "label": "Archive Email", "link": "#Email/create", "acl": "edit" - }, - { + }, + { "label": "Email Accounts", "link": "#EmailAccount" - } + } ] }, "detail": { @@ -43,21 +43,21 @@ } ], "dropdown": [ - { + { "label": "Reply", "action": "reply", "acl": "read" - }, - { + }, + { "label": "Reply to All", "action": "replyToAll", "acl": "read" - }, - { + }, + { "label": "Forward", "action": "forward", "acl": "read" - } + } ] } }, diff --git a/application/Espo/Resources/metadata/clientDefs/EmailAccount.json b/application/Espo/Resources/metadata/clientDefs/EmailAccount.json index 6ca7c5cc1a..ba3d6553ae 100644 --- a/application/Espo/Resources/metadata/clientDefs/EmailAccount.json +++ b/application/Espo/Resources/metadata/clientDefs/EmailAccount.json @@ -1,9 +1,9 @@ { - "controller": "Controllers.Record", - "recordViews":{ - "list":"EmailAccount.Record.List", - "detail": "EmailAccount.Record.Detail", - "edit": "EmailAccount.Record.Edit" - }, - "disableSearchPanel": true + "controller": "Controllers.Record", + "recordViews":{ + "list":"EmailAccount.Record.List", + "detail": "EmailAccount.Record.Detail", + "edit": "EmailAccount.Record.Edit" + }, + "disableSearchPanel": true } diff --git a/application/Espo/Resources/metadata/clientDefs/Role.json b/application/Espo/Resources/metadata/clientDefs/Role.json index 5a5226bd2a..ee4f559172 100644 --- a/application/Espo/Resources/metadata/clientDefs/Role.json +++ b/application/Espo/Resources/metadata/clientDefs/Role.json @@ -16,6 +16,6 @@ } }, "views": { - "list": "Role.List" + "list": "Role.List" } } diff --git a/application/Espo/Resources/metadata/clientDefs/ScheduledJob.json b/application/Espo/Resources/metadata/clientDefs/ScheduledJob.json index 0a6c822afa..c7a9f06556 100644 --- a/application/Espo/Resources/metadata/clientDefs/ScheduledJob.json +++ b/application/Espo/Resources/metadata/clientDefs/ScheduledJob.json @@ -9,6 +9,6 @@ "list":"ScheduledJob.Record.List" }, "views": { - "list": "ScheduledJob.List" + "list": "ScheduledJob.List" } } diff --git a/application/Espo/Resources/metadata/entityDefs/Attachment.json b/application/Espo/Resources/metadata/entityDefs/Attachment.json index 2461d1750b..7aacce7160 100644 --- a/application/Espo/Resources/metadata/entityDefs/Attachment.json +++ b/application/Espo/Resources/metadata/entityDefs/Attachment.json @@ -32,8 +32,8 @@ "maxLength": 36 }, "global": { - "type": "bool", - "default": false + "type": "bool", + "default": false } }, "links": { @@ -47,7 +47,7 @@ } }, "collection": { - "sortBy": "createdAt", - "asc": false + "sortBy": "createdAt", + "asc": false } } diff --git a/application/Espo/Resources/metadata/entityDefs/AuthToken.json b/application/Espo/Resources/metadata/entityDefs/AuthToken.json index c314ce3a3f..1cac4656e2 100644 --- a/application/Espo/Resources/metadata/entityDefs/AuthToken.json +++ b/application/Espo/Resources/metadata/entityDefs/AuthToken.json @@ -17,8 +17,8 @@ "type": "link" }, "ipAddress": { - "type": "varchar", - "maxLength": "36" + "type": "varchar", + "maxLength": "36" }, "lastAccess": { "type": "datetime" @@ -39,7 +39,7 @@ } }, "collection": { - "sortBy": "lastAccess", - "asc": false + "sortBy": "lastAccess", + "asc": false } } diff --git a/application/Espo/Resources/metadata/entityDefs/Email.json b/application/Espo/Resources/metadata/entityDefs/Email.json index bfc57a33c0..dc976a2692 100644 --- a/application/Espo/Resources/metadata/entityDefs/Email.json +++ b/application/Espo/Resources/metadata/entityDefs/Email.json @@ -35,37 +35,37 @@ "view": "Email.Fields.EmailAddressVarchar" }, "nameHash": { - "type": "text", - "notStorable": true, - "readOlny": true, - "disabled": true + "type": "text", + "notStorable": true, + "readOlny": true, + "disabled": true }, "typeHash": { - "type": "text", - "notStorable": true, - "readOlny": true, - "disabled": true + "type": "text", + "notStorable": true, + "readOlny": true, + "disabled": true }, "idHash": { - "type": "text", - "notStorable": true, - "readOlny": true, - "disabled": true + "type": "text", + "notStorable": true, + "readOlny": true, + "disabled": true }, "messageId": { - "type": "varchar", - "maxLength": 255, - "readOlny": true + "type": "varchar", + "maxLength": 255, + "readOlny": true }, "messageIdInternal": { - "type": "varchar", - "maxLength": 300, - "readOlny": true, - "index": true + "type": "varchar", + "maxLength": 300, + "readOlny": true, + "index": true }, "emailAddress": { - "type": "base", - "db": false + "type": "base", + "db": false }, "fromEmailAddress": { "type": "link", @@ -169,48 +169,48 @@ "type": "hasMany", "entity": "EmailAddress", "relationName": "EmailEmailAddress", - "conditions": { - "addressType": "to" - }, + "conditions": { + "addressType": "to" + }, "additionalColumns": { - "addressType": { - "type": "varchar", - "len": "4" - } + "addressType": { + "type": "varchar", + "len": "4" + } } }, "ccEmailAddresses": { "type": "hasMany", "entity": "EmailAddress", "relationName": "EmailEmailAddress", - "conditions": { - "addressType": "cc" - }, + "conditions": { + "addressType": "cc" + }, "additionalColumns": { - "addressType": { - "type": "varchar", - "len": "4" - } + "addressType": { + "type": "varchar", + "len": "4" + } } }, "bccEmailAddresses": { "type": "hasMany", "entity": "EmailAddress", "relationName": "EmailEmailAddress", - "conditions": { - "addressType": "bcc" - }, + "conditions": { + "addressType": "bcc" + }, "additionalColumns": { - "addressType": { - "type": "varchar", - "len": "4" - } + "addressType": { + "type": "varchar", + "len": "4" + } } } }, "collection": { - "sortBy": "dateSent", - "asc": false, - "textFilterFields": ["name", "body", "bodyPlain"] + "sortBy": "dateSent", + "asc": false, + "textFilterFields": ["name", "body", "bodyPlain"] } } diff --git a/application/Espo/Resources/metadata/entityDefs/EmailAccount.json b/application/Espo/Resources/metadata/entityDefs/EmailAccount.json index de747916c7..39e370d4ab 100644 --- a/application/Espo/Resources/metadata/entityDefs/EmailAccount.json +++ b/application/Espo/Resources/metadata/entityDefs/EmailAccount.json @@ -34,11 +34,11 @@ "view": "EmailAccount.Fields.Folders" }, "fetchSince": { - "type": "date", - "required": true + "type": "date", + "required": true }, "fetchData": { - "type": "text", + "type": "text", "readOnly": true }, "createdAt": { @@ -77,7 +77,7 @@ } }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Resources/metadata/entityDefs/EmailAddress.json b/application/Espo/Resources/metadata/entityDefs/EmailAddress.json index 845d6fadcb..1404e27e9c 100644 --- a/application/Espo/Resources/metadata/entityDefs/EmailAddress.json +++ b/application/Espo/Resources/metadata/entityDefs/EmailAddress.json @@ -19,7 +19,7 @@ "links": { }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Resources/metadata/entityDefs/EmailTemplate.json b/application/Espo/Resources/metadata/entityDefs/EmailTemplate.json index 491013f7c2..9bada69af1 100644 --- a/application/Espo/Resources/metadata/entityDefs/EmailTemplate.json +++ b/application/Espo/Resources/metadata/entityDefs/EmailTemplate.json @@ -68,7 +68,7 @@ } }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Resources/metadata/entityDefs/Note.json b/application/Espo/Resources/metadata/entityDefs/Note.json index 008ab4275d..f8d5d3358a 100644 --- a/application/Espo/Resources/metadata/entityDefs/Note.json +++ b/application/Espo/Resources/metadata/entityDefs/Note.json @@ -54,35 +54,35 @@ } }, "collection": { - "sortBy": "createdAt", - "asc": false + "sortBy": "createdAt", + "asc": false }, "streamRelated": { - "Account": [ - "meetings", - "calls", - "tasks", - "opportunities" - ], - "Contact": [ - "meetings", - "calls", - "tasks" - ], - "Lead": [ - "meetings", - "calls", - "tasks" - ], - "Opportunity": [ - "meetings", - "calls", - "tasks" - ], - "Case": [ - "meetings", - "calls", - "tasks" - ] - } + "Account": [ + "meetings", + "calls", + "tasks", + "opportunities" + ], + "Contact": [ + "meetings", + "calls", + "tasks" + ], + "Lead": [ + "meetings", + "calls", + "tasks" + ], + "Opportunity": [ + "meetings", + "calls", + "tasks" + ], + "Case": [ + "meetings", + "calls", + "tasks" + ] + } } diff --git a/application/Espo/Resources/metadata/entityDefs/Notification.json b/application/Espo/Resources/metadata/entityDefs/Notification.json index f55f92bf47..38b81ff02d 100644 --- a/application/Espo/Resources/metadata/entityDefs/Notification.json +++ b/application/Espo/Resources/metadata/entityDefs/Notification.json @@ -14,7 +14,7 @@ "type": "bool" }, "user": { - "type": "link" + "type": "link" }, "createdAt": { "type": "datetime", @@ -22,13 +22,13 @@ } }, "links": { - "user": { - "type": "belongsTo", - "entity": "User" - } + "user": { + "type": "belongsTo", + "entity": "User" + } }, "collection": { - "sortBy": "createdAt", - "asc": false + "sortBy": "createdAt", + "asc": false } } diff --git a/application/Espo/Resources/metadata/entityDefs/OutboundEmail.json b/application/Espo/Resources/metadata/entityDefs/OutboundEmail.json index c5cf9a1f02..b7b952d7a9 100644 --- a/application/Espo/Resources/metadata/entityDefs/OutboundEmail.json +++ b/application/Espo/Resources/metadata/entityDefs/OutboundEmail.json @@ -39,7 +39,7 @@ "required": true }, "user": { - "type": "link" + "type": "link" } }, "links": { diff --git a/application/Espo/Resources/metadata/entityDefs/PhoneNumber.json b/application/Espo/Resources/metadata/entityDefs/PhoneNumber.json index 61fcf70f05..31ba487935 100644 --- a/application/Espo/Resources/metadata/entityDefs/PhoneNumber.json +++ b/application/Espo/Resources/metadata/entityDefs/PhoneNumber.json @@ -13,7 +13,7 @@ "links": { }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Resources/metadata/entityDefs/Preferences.json b/application/Espo/Resources/metadata/entityDefs/Preferences.json index c7bff38bf6..69a0eb7162 100644 --- a/application/Espo/Resources/metadata/entityDefs/Preferences.json +++ b/application/Espo/Resources/metadata/entityDefs/Preferences.json @@ -36,13 +36,13 @@ "default": "USD" }, "dashboardLayout": { - "type": "text" + "type": "text" }, "dashletOptions": { - "type": "text" + "type": "text" }, "presetFilters": { - "type": "text" + "type": "text" }, "smtpEmailAddress": { "type": "varchar", diff --git a/application/Espo/Resources/metadata/entityDefs/Role.json b/application/Espo/Resources/metadata/entityDefs/Role.json index 4383618a98..4740d442c5 100644 --- a/application/Espo/Resources/metadata/entityDefs/Role.json +++ b/application/Espo/Resources/metadata/entityDefs/Role.json @@ -6,7 +6,7 @@ "type": "varchar" }, "data": { - "type": "text" + "type": "text" } }, "links": { @@ -22,7 +22,7 @@ } }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Resources/metadata/entityDefs/ScheduledJob.json b/application/Espo/Resources/metadata/entityDefs/ScheduledJob.json index e627ed7a79..22731ab17b 100644 --- a/application/Espo/Resources/metadata/entityDefs/ScheduledJob.json +++ b/application/Espo/Resources/metadata/entityDefs/ScheduledJob.json @@ -14,11 +14,11 @@ "options": ["Active", "Inactive"] }, "scheduling": { - "type": "varchar", + "type": "varchar", "required": true, "view": "ScheduledJob.Fields.Scheduling", - "default": "* * * * *" - }, + "default": "* * * * *" + }, "lastRun": { "type": "datetime", "readOnly": true @@ -50,13 +50,13 @@ "entity": "User" }, "log": { - "type": "hasMany", - "entity": "ScheduledJobLogRecord", - "foreign": "scheduledJob" + "type": "hasMany", + "entity": "ScheduledJobLogRecord", + "foreign": "scheduledJob" } }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Resources/metadata/entityDefs/ScheduledJobLogRecord.json b/application/Espo/Resources/metadata/entityDefs/ScheduledJobLogRecord.json index 8a05c52979..24e406687e 100644 --- a/application/Espo/Resources/metadata/entityDefs/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/metadata/entityDefs/ScheduledJobLogRecord.json @@ -18,8 +18,8 @@ "readOnly": true }, "scheduledJob": { - "type": "link" - } + "type": "link" + } }, "links": { "scheduledJob": { @@ -28,7 +28,7 @@ } }, "collection": { - "sortBy": "executionTime", - "asc": false + "sortBy": "executionTime", + "asc": false } } diff --git a/application/Espo/Resources/metadata/entityDefs/Settings.json b/application/Espo/Resources/metadata/entityDefs/Settings.json index 42c8769a0a..ca6d4a8ca1 100644 --- a/application/Espo/Resources/metadata/entityDefs/Settings.json +++ b/application/Espo/Resources/metadata/entityDefs/Settings.json @@ -68,8 +68,8 @@ "required": true }, "currencyRates": { - "type": "base", - "view": "Settings.Fields.CurrencyRates" + "type": "base", + "view": "Settings.Fields.CurrencyRates" }, "outboundEmailIsShared": { "type": "bool", @@ -134,77 +134,77 @@ "type": "image" }, "authenticationMethod": { - "type": "enum", - "options": ["Espo", "LDAP"], - "default": "Espo" + "type": "enum", + "options": ["Espo", "LDAP"], + "default": "Espo" }, "ldapHost": { - "type": "varchar", - "required": true + "type": "varchar", + "required": true }, "ldapPort": { - "type": "int", - "max": 9999, - "min": 0, - "default": 389 + "type": "int", + "max": 9999, + "min": 0, + "default": 389 }, "ldapSecurity": { - "type": "enum", - "options": ["", "SSL", "TLS"] + "type": "enum", + "options": ["", "SSL", "TLS"] }, "ldapAuth": { - "type": "bool" + "type": "bool" }, "ldapUsername": { - "type": "varchar", - "required": true + "type": "varchar", + "required": true }, "ldapPassword": { - "type": "password" + "type": "password" }, "ldapBindRequiresDn": { - "type": "bool" + "type": "bool" }, "ldapBaseDn": { - "type": "varchar" + "type": "varchar" }, "ldapUserLoginFilter": { - "type": "varchar" + "type": "varchar" }, "ldapAccountCanonicalForm": { - "type": "enum", - "options": ["Dn", "Username", "Backslash", "Principal"] + "type": "enum", + "options": ["Dn", "Username", "Backslash", "Principal"] }, "ldapAccountDomainName": { - "type": "varchar" + "type": "varchar" }, "ldapAccountDomainNameShort": { - "type": "varchar" + "type": "varchar" }, "ldapAccountFilterFormat": { - "type": "varchar" + "type": "varchar" }, "ldapTryUsernameSplit": { - "type": "bool" + "type": "bool" }, "ldapOptReferrals": { - "type": "bool" + "type": "bool" }, "ldapCreateEspoUser": { - "type": "bool", - "default": true + "type": "bool", + "default": true }, "disableExport": { - "type": "bool", - "default": false - }, + "type": "bool", + "default": false + }, "assignmentEmailNotifications": { - "type": "bool", - "default": false - }, - "assignmentEmailNotificationsEntityList": { - "type": "array", - "translation": "Global.scopeNamesPlural" - } + "type": "bool", + "default": false + }, + "assignmentEmailNotificationsEntityList": { + "type": "array", + "translation": "Global.scopeNamesPlural" + } } } diff --git a/application/Espo/Resources/metadata/entityDefs/Team.json b/application/Espo/Resources/metadata/entityDefs/Team.json index dd24fe86d7..2395c7164d 100644 --- a/application/Espo/Resources/metadata/entityDefs/Team.json +++ b/application/Espo/Resources/metadata/entityDefs/Team.json @@ -22,7 +22,7 @@ } }, "collection": { - "sortBy": "name", - "asc": true + "sortBy": "name", + "asc": true } } diff --git a/application/Espo/Resources/metadata/entityDefs/User.json b/application/Espo/Resources/metadata/entityDefs/User.json index 9f4672bcac..d61e2cc0eb 100644 --- a/application/Espo/Resources/metadata/entityDefs/User.json +++ b/application/Espo/Resources/metadata/entityDefs/User.json @@ -13,7 +13,7 @@ "name": { "type": "personName" }, - "password": { + "password": { "type": "password", "maxLength": 150, "internal": true @@ -55,9 +55,9 @@ "tooltip": true }, "acceptanceStatus": { - "type": "varchar", - "notStorable": true, - "disabled": true + "type": "varchar", + "notStorable": true, + "disabled": true }, "teams": { "type": "linkMultiple" @@ -85,20 +85,20 @@ "type": "hasOne", "entity": "Preferences" }, - "meetings": { + "meetings": { "type": "hasMany", "entity": "Meeting", "foreign": "users" }, - "calls": { + "calls": { "type": "hasMany", "entity": "Call", "foreign": "users" } }, "collection": { - "sortBy": "userName", - "asc": true, - "textFilterFields": ["name", "userName"] + "sortBy": "userName", + "asc": true, + "textFilterFields": ["name", "userName"] } } diff --git a/application/Espo/Resources/metadata/fields/address.json b/application/Espo/Resources/metadata/fields/address.json index 561875579d..832b8f3146 100644 --- a/application/Espo/Resources/metadata/fields/address.json +++ b/application/Espo/Resources/metadata/fields/address.json @@ -8,9 +8,9 @@ ], "fields":{ "street":{ - "type": "text", - "maxLength": 255, - "dbType": "varchar" + "type": "text", + "maxLength": 255, + "dbType": "varchar" }, "city":{ "type":"varchar" diff --git a/application/Espo/Resources/metadata/integrations/Google.json b/application/Espo/Resources/metadata/integrations/Google.json index 26b2502c36..e95bd623ac 100644 --- a/application/Espo/Resources/metadata/integrations/Google.json +++ b/application/Espo/Resources/metadata/integrations/Google.json @@ -1,22 +1,22 @@ { - "fields": { - "clientId": { - "type": "varchar", - "maxLength": 255, - "required": true - }, - "clientSecret": { - "type": "varchar", - "maxLength": 255, - "required": true - } - }, - "params": { - "endpoint": "https://accounts.google.com/o/oauth2/auth", - "tokenEndpoint": "https://accounts.google.com/o/oauth2/token", - "scope": "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/calendar" - }, - "allowUserAccounts": true, - "authMethod": "OAuth2", - "clientClassName": "\\Espo\\Core\\ExternalAccount\\Clients\\Google" + "fields": { + "clientId": { + "type": "varchar", + "maxLength": 255, + "required": true + }, + "clientSecret": { + "type": "varchar", + "maxLength": 255, + "required": true + } + }, + "params": { + "endpoint": "https://accounts.google.com/o/oauth2/auth", + "tokenEndpoint": "https://accounts.google.com/o/oauth2/token", + "scope": "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/calendar" + }, + "allowUserAccounts": true, + "authMethod": "OAuth2", + "clientClassName": "\\Espo\\Core\\ExternalAccount\\Clients\\Google" } diff --git a/application/Espo/Resources/metadata/scopes/AuthToken.json b/application/Espo/Resources/metadata/scopes/AuthToken.json index a64dc42037..e7970c2b06 100644 --- a/application/Espo/Resources/metadata/scopes/AuthToken.json +++ b/application/Espo/Resources/metadata/scopes/AuthToken.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable":false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/Email.json b/application/Espo/Resources/metadata/scopes/Email.json index ce2ff4e148..6f6b169b19 100644 --- a/application/Espo/Resources/metadata/scopes/Email.json +++ b/application/Espo/Resources/metadata/scopes/Email.json @@ -1,6 +1,6 @@ { - "entity": true, - "layouts": false, - "tab": true, - "acl": true + "entity": true, + "layouts": false, + "tab": true, + "acl": true } diff --git a/application/Espo/Resources/metadata/scopes/EmailAccount.json b/application/Espo/Resources/metadata/scopes/EmailAccount.json index 62a7844e2b..7469fbdbdc 100644 --- a/application/Espo/Resources/metadata/scopes/EmailAccount.json +++ b/application/Espo/Resources/metadata/scopes/EmailAccount.json @@ -1,6 +1,6 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false + "entity": true, + "layouts": false, + "tab": false, + "acl": false } diff --git a/application/Espo/Resources/metadata/scopes/EmailAddress.json b/application/Espo/Resources/metadata/scopes/EmailAddress.json index a64dc42037..e7970c2b06 100644 --- a/application/Espo/Resources/metadata/scopes/EmailAddress.json +++ b/application/Espo/Resources/metadata/scopes/EmailAddress.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable":false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/EmailTemplate.json b/application/Espo/Resources/metadata/scopes/EmailTemplate.json index 3a58f377f7..0f8a0bc591 100644 --- a/application/Espo/Resources/metadata/scopes/EmailTemplate.json +++ b/application/Espo/Resources/metadata/scopes/EmailTemplate.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": true, - "acl": true, - "customizable":false + "entity": true, + "layouts": false, + "tab": true, + "acl": true, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/Extension.json b/application/Espo/Resources/metadata/scopes/Extension.json index 55066c1a9f..a5280171da 100644 --- a/application/Espo/Resources/metadata/scopes/Extension.json +++ b/application/Espo/Resources/metadata/scopes/Extension.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable": false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable": false } diff --git a/application/Espo/Resources/metadata/scopes/ExternalAccount.json b/application/Espo/Resources/metadata/scopes/ExternalAccount.json index 6fb84e513f..432d5091d0 100644 --- a/application/Espo/Resources/metadata/scopes/ExternalAccount.json +++ b/application/Espo/Resources/metadata/scopes/ExternalAccount.json @@ -1,7 +1,7 @@ { - "entity":true, - "layouts":false, - "tab":false, - "acl":false, - "customizable":false + "entity":true, + "layouts":false, + "tab":false, + "acl":false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/Integration.json b/application/Espo/Resources/metadata/scopes/Integration.json index 6fb84e513f..432d5091d0 100644 --- a/application/Espo/Resources/metadata/scopes/Integration.json +++ b/application/Espo/Resources/metadata/scopes/Integration.json @@ -1,7 +1,7 @@ { - "entity":true, - "layouts":false, - "tab":false, - "acl":false, - "customizable":false + "entity":true, + "layouts":false, + "tab":false, + "acl":false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/Job.json b/application/Espo/Resources/metadata/scopes/Job.json index a64dc42037..e7970c2b06 100644 --- a/application/Espo/Resources/metadata/scopes/Job.json +++ b/application/Espo/Resources/metadata/scopes/Job.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable":false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/Notification.json b/application/Espo/Resources/metadata/scopes/Notification.json index 6fb84e513f..432d5091d0 100644 --- a/application/Espo/Resources/metadata/scopes/Notification.json +++ b/application/Espo/Resources/metadata/scopes/Notification.json @@ -1,7 +1,7 @@ { - "entity":true, - "layouts":false, - "tab":false, - "acl":false, - "customizable":false + "entity":true, + "layouts":false, + "tab":false, + "acl":false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/OutboundEmail.json b/application/Espo/Resources/metadata/scopes/OutboundEmail.json index a64dc42037..e7970c2b06 100644 --- a/application/Espo/Resources/metadata/scopes/OutboundEmail.json +++ b/application/Espo/Resources/metadata/scopes/OutboundEmail.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable":false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/PhoneNumber.json b/application/Espo/Resources/metadata/scopes/PhoneNumber.json index a64dc42037..e7970c2b06 100644 --- a/application/Espo/Resources/metadata/scopes/PhoneNumber.json +++ b/application/Espo/Resources/metadata/scopes/PhoneNumber.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable":false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/ScheduledJob.json b/application/Espo/Resources/metadata/scopes/ScheduledJob.json index a64dc42037..e7970c2b06 100644 --- a/application/Espo/Resources/metadata/scopes/ScheduledJob.json +++ b/application/Espo/Resources/metadata/scopes/ScheduledJob.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable":false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/ScheduledJobLogRecord.json b/application/Espo/Resources/metadata/scopes/ScheduledJobLogRecord.json index a64dc42037..e7970c2b06 100644 --- a/application/Espo/Resources/metadata/scopes/ScheduledJobLogRecord.json +++ b/application/Espo/Resources/metadata/scopes/ScheduledJobLogRecord.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable":false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/Stream.json b/application/Espo/Resources/metadata/scopes/Stream.json index 36e0d2d257..d606885db7 100644 --- a/application/Espo/Resources/metadata/scopes/Stream.json +++ b/application/Espo/Resources/metadata/scopes/Stream.json @@ -1,7 +1,7 @@ { - "entity":false, - "layouts":false, - "tab":false, - "acl":false, - "customizable":false + "entity":false, + "layouts":false, + "tab":false, + "acl":false, + "customizable":false } diff --git a/application/Espo/Resources/metadata/scopes/UniqueId.json b/application/Espo/Resources/metadata/scopes/UniqueId.json index a64dc42037..e7970c2b06 100644 --- a/application/Espo/Resources/metadata/scopes/UniqueId.json +++ b/application/Espo/Resources/metadata/scopes/UniqueId.json @@ -1,7 +1,7 @@ { - "entity": true, - "layouts": false, - "tab": false, - "acl": false, - "customizable":false + "entity": true, + "layouts": false, + "tab": false, + "acl": false, + "customizable":false } diff --git a/application/Espo/Resources/routes.json b/application/Espo/Resources/routes.json index 41eb470ab4..7ff0690483 100644 --- a/application/Espo/Resources/routes.json +++ b/application/Espo/Resources/routes.json @@ -1,318 +1,318 @@ [ { - "route":"/", - "method":"get", - "params":"

EspoCRM REST API<\/h1>" + "route":"/", + "method":"get", + "params":"

EspoCRM REST API<\/h1>" }, { - "route":"/App/user", - "method":"get", - "params":{ - "controller":"App", - "action":"user" - } + "route":"/App/user", + "method":"get", + "params":{ + "controller":"App", + "action":"user" + } }, { - "route":"/Metadata", - "method":"get", - "params":{ - "controller":"Metadata" - } + "route":"/Metadata", + "method":"get", + "params":{ + "controller":"Metadata" + } }, { - "route":"I18n", - "method":"get", - "params":{ - "controller":"I18n" - } + "route":"I18n", + "method":"get", + "params":{ + "controller":"I18n" + } }, { - "route":"/Settings", - "method":"get", - "params":{ - "controller":"Settings" - }, - "conditions":{ - "auth":false - } + "route":"/Settings", + "method":"get", + "params":{ + "controller":"Settings" + }, + "conditions":{ + "auth":false + } }, { - "route":"/Settings", - "method":"patch", - "params":{ - "controller":"Settings" - } + "route":"/Settings", + "method":"patch", + "params":{ + "controller":"Settings" + } }, { - "route":"/Stream", - "method":"get", - "params":{ - "controller":"Stream", - "action":"list", - "scope": "User" - } + "route":"/Stream", + "method":"get", + "params":{ + "controller":"Stream", + "action":"list", + "scope": "User" + } }, { - "route":"/GlobalSearch/:query", - "method":"get", - "params":{ - "controller":"GlobalSearch", - "action":"search", - "query": ":query" - } + "route":"/GlobalSearch/:query", + "method":"get", + "params":{ + "controller":"GlobalSearch", + "action":"search", + "query": ":query" + } }, { - "route":"/:controller/action/:action", - "method":"post", - "params":{ - "controller":":controller", - "action":":action" - } + "route":"/:controller/action/:action", + "method":"post", + "params":{ + "controller":":controller", + "action":":action" + } }, { - "route":"/:controller/action/:action", - "method":"put", - "params":{ - "controller":":controller", - "action":":action" - } + "route":"/:controller/action/:action", + "method":"put", + "params":{ + "controller":":controller", + "action":":action" + } }, { - "route":"/:controller/action/:action", - "method":"get", - "params":{ - "controller":":controller", - "action":":action" - } + "route":"/:controller/action/:action", + "method":"get", + "params":{ + "controller":":controller", + "action":":action" + } }, { - "route":"/:controller/layout/:name", - "method":"get", - "params":{ - "controller":"Layout", - "scope":":controller" - } + "route":"/:controller/layout/:name", + "method":"get", + "params":{ + "controller":"Layout", + "scope":":controller" + } }, { - "route":"/:controller/layout/:name", - "method":"put", - "params":{ - "controller":"Layout", - "scope":":controller" - } + "route":"/:controller/layout/:name", + "method":"put", + "params":{ + "controller":"Layout", + "scope":":controller" + } }, { - "route":"/:controller/layout/:name", - "method":"patch", - "params":{ - "controller":"Layout", - "scope":":controller" - } + "route":"/:controller/layout/:name", + "method":"patch", + "params":{ + "controller":"Layout", + "scope":":controller" + } }, { - "route":"/Admin/rebuild", - "method":"get", - "params":{ - "controller":"Admin", - "action":"rebuild" - } + "route":"/Admin/rebuild", + "method":"get", + "params":{ + "controller":"Admin", + "action":"rebuild" + } }, { - "route":"/Admin/clearCache", - "method":"get", - "params":{ - "controller":"Admin", - "action":"clearCache" - } + "route":"/Admin/clearCache", + "method":"get", + "params":{ + "controller":"Admin", + "action":"clearCache" + } }, { - "route":"/Admin/jobs", - "method":"get", - "params":{ - "controller":"Admin", - "action":"jobs" - } + "route":"/Admin/jobs", + "method":"get", + "params":{ + "controller":"Admin", + "action":"jobs" + } }, { - "route":"/Admin/fieldManager/:scope/:name", - "method":"get", - "params":{ - "controller":"FieldManager", - "action":"read", - "scope":":scope", - "name":":name" - } + "route":"/Admin/fieldManager/:scope/:name", + "method":"get", + "params":{ + "controller":"FieldManager", + "action":"read", + "scope":":scope", + "name":":name" + } }, { - "route":"/Admin/fieldManager/:scope", - "method":"post", - "params":{ - "controller":"FieldManager", - "action":"create", - "scope":":scope" - } + "route":"/Admin/fieldManager/:scope", + "method":"post", + "params":{ + "controller":"FieldManager", + "action":"create", + "scope":":scope" + } }, { - "route":"/Admin/fieldManager/:scope/:name", - "method":"put", - "params":{ - "controller":"FieldManager", - "action":"update", - "scope":":scope", - "name":":name" - } + "route":"/Admin/fieldManager/:scope/:name", + "method":"put", + "params":{ + "controller":"FieldManager", + "action":"update", + "scope":":scope", + "name":":name" + } }, { - "route":"/Admin/fieldManager/:scope/:name", - "method":"delete", - "params":{ - "controller":"FieldManager", - "action":"delete", - "scope":":scope", - "name":":name" - } + "route":"/Admin/fieldManager/:scope/:name", + "method":"delete", + "params":{ + "controller":"FieldManager", + "action":"delete", + "scope":":scope", + "name":":name" + } }, { - "route":"/:controller/:id", - "method":"get", - "params":{ - "controller":":controller", - "action":"read", - "id":":id" - } + "route":"/:controller/:id", + "method":"get", + "params":{ + "controller":":controller", + "action":"read", + "id":":id" + } }, { - "route":"/:controller", - "method":"get", - "params":{ - "controller":":controller", - "action":"index" - } + "route":"/:controller", + "method":"get", + "params":{ + "controller":":controller", + "action":"index" + } }, { - "route":"/:controller", - "method":"post", - "params":{ - "controller":":controller", - "action":"create" - } + "route":"/:controller", + "method":"post", + "params":{ + "controller":":controller", + "action":"create" + } }, { - "route":"/:controller/:id", - "method":"put", - "params":{ - "controller":":controller", - "action":"update", - "id":":id" - } + "route":"/:controller/:id", + "method":"put", + "params":{ + "controller":":controller", + "action":"update", + "id":":id" + } }, { - "route":"/:controller/:id", - "method":"patch", - "params":{ - "controller":":controller", - "action":"patch", - "id":":id" - } + "route":"/:controller/:id", + "method":"patch", + "params":{ + "controller":":controller", + "action":"patch", + "id":":id" + } }, { - "route":"/:controller/:id", - "method":"delete", - "params":{ - "controller":":controller", - "action":"delete", - "id":":id" - } + "route":"/:controller/:id", + "method":"delete", + "params":{ + "controller":":controller", + "action":"delete", + "id":":id" + } }, { - "route":"/:controller/:id/stream", - "method":"get", - "params":{ - "controller":"Stream", - "action":"list", - "id":":id", - "scope":":controller" - } + "route":"/:controller/:id/stream", + "method":"get", + "params":{ + "controller":"Stream", + "action":"list", + "id":":id", + "scope":":controller" + } }, { - "route":"/:controller/:id/subscription", - "method":"put", - "params":{ - "controller":":controller", - "id":":id", - "action":"follow" - } + "route":"/:controller/:id/subscription", + "method":"put", + "params":{ + "controller":":controller", + "id":":id", + "action":"follow" + } }, { - "route":"/:controller/:id/subscription", - "method":"delete", - "params":{ - "controller":":controller", - "id":":id", - "action":"unfollow" - } + "route":"/:controller/:id/subscription", + "method":"delete", + "params":{ + "controller":":controller", + "id":":id", + "action":"unfollow" + } }, { - "route":"/:controller/:id/:link", - "method":"get", - "params":{ - "controller":":controller", - "action":"listLinked", - "id":":id", - "link":":link" - } + "route":"/:controller/:id/:link", + "method":"get", + "params":{ + "controller":":controller", + "action":"listLinked", + "id":":id", + "link":":link" + } }, { - "route":"/:controller/:id/:link", - "method":"post", - "params":{ - "controller":":controller", - "action":"createLink", - "id":":id", - "link":":link" - } + "route":"/:controller/:id/:link", + "method":"post", + "params":{ + "controller":":controller", + "action":"createLink", + "id":":id", + "link":":link" + } }, { - "route":"/:controller/:id/:link", - "method":"delete", - "params":{ - "controller":":controller", - "action":"removeLink", - "id":":id", - "link":":link" - } + "route":"/:controller/:id/:link", + "method":"delete", + "params":{ + "controller":":controller", + "action":"removeLink", + "id":":id", + "link":":link" + } } ] diff --git a/application/Espo/SelectManagers/EmailAccount.php b/application/Espo/SelectManagers/EmailAccount.php index 8e289b9294..c9f492b88c 100644 --- a/application/Espo/SelectManagers/EmailAccount.php +++ b/application/Espo/SelectManagers/EmailAccount.php @@ -23,13 +23,13 @@ namespace Espo\SelectManagers; class EmailAccount extends \Espo\Core\SelectManagers\Base -{ +{ protected function access(&$result) { - if (!array_key_exists('whereClause', $result)) { - $result['whereClause'] = array(); - } - $result['whereClause']['assignedUserId'] = $this->user->id; + if (!array_key_exists('whereClause', $result)) { + $result['whereClause'] = array(); + } + $result['whereClause']['assignedUserId'] = $this->user->id; } } diff --git a/application/Espo/Services/Attachment.php b/application/Espo/Services/Attachment.php index 7800a0bfdb..7b29928f8f 100644 --- a/application/Espo/Services/Attachment.php +++ b/application/Espo/Services/Attachment.php @@ -24,20 +24,20 @@ namespace Espo\Services; class Attachment extends Record { - - protected $notFilteringFields = array('contents'); - - public function createEntity($data) - { - if (!empty($data['file'])) { - list($prefix, $contents) = explode(',', $data['file']); - $contents = base64_decode($contents); - $data['contents'] = $contents; - } - - $entity = parent::createEntity($data); - - return $entity; - } + + protected $notFilteringFields = array('contents'); + + public function createEntity($data) + { + if (!empty($data['file'])) { + list($prefix, $contents) = explode(',', $data['file']); + $contents = base64_decode($contents); + $data['contents'] = $contents; + } + + $entity = parent::createEntity($data); + + return $entity; + } } diff --git a/application/Espo/Services/AuthToken.php b/application/Espo/Services/AuthToken.php index e47ca45d65..247cb456c3 100644 --- a/application/Espo/Services/AuthToken.php +++ b/application/Espo/Services/AuthToken.php @@ -27,7 +27,7 @@ use \Espo\Core\Exceptions\Error; use \Espo\Core\Exceptions\NotFound; class AuthToken extends Record -{ - protected $internalFields = array('hash', 'token'); +{ + protected $internalFields = array('hash', 'token'); } diff --git a/application/Espo/Services/Email.php b/application/Espo/Services/Email.php index 0b1ca9ffe9..d87674c82a 100644 --- a/application/Espo/Services/Email.php +++ b/application/Espo/Services/Email.php @@ -29,246 +29,246 @@ use \Espo\Core\Exceptions\Error; class Email extends Record { - protected function init() - { - $this->dependencies[] = 'mailSender'; - $this->dependencies[] = 'preferences'; - $this->dependencies[] = 'fileManager'; - $this->dependencies[] = 'crypt'; - } - - protected function getFileManager() - { - return $this->getInjection('fileManager'); - } + protected function init() + { + $this->dependencies[] = 'mailSender'; + $this->dependencies[] = 'preferences'; + $this->dependencies[] = 'fileManager'; + $this->dependencies[] = 'crypt'; + } + + protected function getFileManager() + { + return $this->getInjection('fileManager'); + } - protected function getMailSender() - { - return $this->injections['mailSender']; - } + protected function getMailSender() + { + return $this->injections['mailSender']; + } - protected function getPreferences() - { - return $this->injections['preferences']; - } + protected function getPreferences() + { + return $this->injections['preferences']; + } - protected function getCrypt() - { - return $this->injections['crypt']; - } + protected function getCrypt() + { + return $this->injections['crypt']; + } - public function createEntity($data) - { - $entity = parent::createEntity($data); + public function createEntity($data) + { + $entity = parent::createEntity($data); - if ($entity && $entity->get('status') == 'Sending') { - $emailSender = $this->getMailSender(); + if ($entity && $entity->get('status') == 'Sending') { + $emailSender = $this->getMailSender(); - if (strtolower($this->getUser()->get('emailAddress')) == strtolower($entity->get('from'))) { - $smtpParams = $this->getPreferences()->getSmtpParams(); - if (array_key_exists('password', $smtpParams)) { - $smtpParams['password'] = $this->getCrypt()->decrypt($smtpParams['password']); - } - - if ($smtpParams) { - $smtpParams['fromName'] = $this->getUser()->get('name'); - $emailSender->useSmtp($smtpParams); - } - } else { - if (!$this->getConfig()->get('outboundEmailIsShared')) { - throw new Error('Can not use system smtp. outboundEmailIsShared is false.'); - } - } + if (strtolower($this->getUser()->get('emailAddress')) == strtolower($entity->get('from'))) { + $smtpParams = $this->getPreferences()->getSmtpParams(); + if (array_key_exists('password', $smtpParams)) { + $smtpParams['password'] = $this->getCrypt()->decrypt($smtpParams['password']); + } + + if ($smtpParams) { + $smtpParams['fromName'] = $this->getUser()->get('name'); + $emailSender->useSmtp($smtpParams); + } + } else { + if (!$this->getConfig()->get('outboundEmailIsShared')) { + throw new Error('Can not use system smtp. outboundEmailIsShared is false.'); + } + } - $emailSender->send($entity); + $emailSender->send($entity); - $this->getEntityManager()->saveEntity($entity); - } + $this->getEntityManager()->saveEntity($entity); + } - return $entity; - } + return $entity; + } - public function getEntity($id = null) - { - $entity = parent::getEntity($id); - if (!empty($id)) { + public function getEntity($id = null) + { + $entity = parent::getEntity($id); + if (!empty($id)) { - if ($entity->get('fromEmailAddressName')) { - $entity->set('from', $entity->get('fromEmailAddressName')); - } + if ($entity->get('fromEmailAddressName')) { + $entity->set('from', $entity->get('fromEmailAddressName')); + } - $entity->loadLinkMultipleField('toEmailAddresses'); - $entity->loadLinkMultipleField('ccEmailAddresses'); - $entity->loadLinkMultipleField('bccEmailAddresses'); + $entity->loadLinkMultipleField('toEmailAddresses'); + $entity->loadLinkMultipleField('ccEmailAddresses'); + $entity->loadLinkMultipleField('bccEmailAddresses'); - $names = $entity->get('toEmailAddressesNames'); - if (!empty($names)) { - $arr = array(); - foreach ($names as $id => $address) { - $arr[] = $address; - } - $entity->set('to', implode(';', $arr)); - } + $names = $entity->get('toEmailAddressesNames'); + if (!empty($names)) { + $arr = array(); + foreach ($names as $id => $address) { + $arr[] = $address; + } + $entity->set('to', implode(';', $arr)); + } - $names = $entity->get('ccEmailAddressesNames'); - if (!empty($names)) { - $arr = array(); - foreach ($names as $id => $address) { - $arr[] = $address; - } - $entity->set('cc', implode(';', $arr)); - } + $names = $entity->get('ccEmailAddressesNames'); + if (!empty($names)) { + $arr = array(); + foreach ($names as $id => $address) { + $arr[] = $address; + } + $entity->set('cc', implode(';', $arr)); + } - $names = $entity->get('bccEmailAddressesNames'); - if (!empty($names)) { - $arr = array(); - foreach ($names as $id => $address) { - $arr[] = $address; - } - $entity->set('bcc', implode(';', $arr)); - } - - $this->loadNameHash($entity); + $names = $entity->get('bccEmailAddressesNames'); + if (!empty($names)) { + $arr = array(); + foreach ($names as $id => $address) { + $arr[] = $address; + } + $entity->set('bcc', implode(';', $arr)); + } + + $this->loadNameHash($entity); - } - return $entity; - } - - public function loadNameHash(Entity $entity) - { - $addressList = array(); - if ($entity->get('from')) { - $addressList[] = $entity->get('from'); - } - - $arr = explode(';', $entity->get('to')); - foreach ($arr as $address) { - if (!in_array($address, $addressList)) { - $addressList[] = $address; - } - } - - $arr = explode(';', $entity->get('cc')); - foreach ($arr as $address) { - if (!in_array($address, $addressList)) { - $addressList[] = $address; - } - } - - $nameHash = array(); - $typeHash = array(); - $idHash = array(); - foreach ($addressList as $address) { - $p = $this->getEntityManager()->getRepository('EmailAddress')->getEntityByAddress($address); - if ($p) { - $nameHash[$address] = $p->get('name'); - $typeHash[$address] = $p->getEntityName(); - $idHash[$address] = $p->id; - } - } - - $entity->set('nameHash', $nameHash); - $entity->set('typeHash', $typeHash); - $entity->set('idHash', $idHash); - } - - public function findEntities($params) - { - $searchByEmailAddress = false; - if (!empty($params['where']) && is_array($params['where'])) { - foreach ($params['where'] as $i => $p) { - if (!empty($p['field']) && $p['field'] == 'emailAddress') { - $searchByEmailAddress = true; - $emailAddress = $this->getEntityManager()->getRepository('EmailAddress')->where(array( - 'lower' => strtolower($p['value']) - ))->findOne(); - unset($params['where'][$i]); - $emailAddressId = null; - if ($emailAddress) { - $emailAddressId = $emailAddress->id; - } - } - - } - } - - $selectParams = $this->getSelectManager($this->entityName)->getSelectParams($params, true); - - if ($searchByEmailAddress) { - if ($emailAddressId) { - $pdo = $this->getEntityManager()->getPDO(); - - $selectParams['distinct'] = true; - - $selectParams['customJoin'] = " - LEFT JOIN email_email_address - ON - email_email_address.email_id = email.id AND - email_email_address.deleted = 0 - "; - $selectParams['customWhere'] = " - AND - ( - email.from_email_address_id = ".$pdo->quote($emailAddressId)." OR - email_email_address.email_address_id = ".$pdo->quote($emailAddressId)." - ) - "; - } else { - $selectParams['customWhere'] = ' AND 0'; - } - - } - - $collection = $this->getRepository()->find($selectParams); - - foreach ($collection as $e) { - $this->loadParentNameFields($e); - } - - return array( - 'total' => $this->getRepository()->count($selectParams), - 'collection' => $collection, - ); - } - - public function getCopiedAttachments($id) - { - $ids = array(); - $names = new \stdClass(); - - if (!empty($id)) { - $email = $this->getEntityManager()->getEntity('Email', $id); - if ($email && $this->getAcl()->check($email, 'read')) { - $email->loadLinkMultipleField('attachments'); - $attachmentsIds = $email->get('attachmentsIds'); - - foreach ($attachmentsIds as $attachmentId) { - $source = $this->getEntityManager()->getEntity('Attachment', $attachmentId); - if ($source) { - $attachment = $this->getEntityManager()->getEntity('Attachment'); - $attachment->set('role', 'Attachment'); - $attachment->set('type', $source->get('type')); - $attachment->set('size', $source->get('size')); - $attachment->set('global', $source->get('global')); - $attachment->set('name', $source->get('name')); - - $this->getEntityManager()->saveEntity($attachment); - - $contents = $this->getFileManager()->getContents('data/upload/' . $source->id); - if (!empty($contents)) { - $this->getFileManager()->putContents('data/upload/' . $attachment->id, $contents); - $ids[] = $attachment->id; - $names->{$attachment->id} = $attachment->get('name'); - } - } - } - } - } - - return array( - 'ids' => $ids, - 'names' => $names - ); - } + } + return $entity; + } + + public function loadNameHash(Entity $entity) + { + $addressList = array(); + if ($entity->get('from')) { + $addressList[] = $entity->get('from'); + } + + $arr = explode(';', $entity->get('to')); + foreach ($arr as $address) { + if (!in_array($address, $addressList)) { + $addressList[] = $address; + } + } + + $arr = explode(';', $entity->get('cc')); + foreach ($arr as $address) { + if (!in_array($address, $addressList)) { + $addressList[] = $address; + } + } + + $nameHash = array(); + $typeHash = array(); + $idHash = array(); + foreach ($addressList as $address) { + $p = $this->getEntityManager()->getRepository('EmailAddress')->getEntityByAddress($address); + if ($p) { + $nameHash[$address] = $p->get('name'); + $typeHash[$address] = $p->getEntityName(); + $idHash[$address] = $p->id; + } + } + + $entity->set('nameHash', $nameHash); + $entity->set('typeHash', $typeHash); + $entity->set('idHash', $idHash); + } + + public function findEntities($params) + { + $searchByEmailAddress = false; + if (!empty($params['where']) && is_array($params['where'])) { + foreach ($params['where'] as $i => $p) { + if (!empty($p['field']) && $p['field'] == 'emailAddress') { + $searchByEmailAddress = true; + $emailAddress = $this->getEntityManager()->getRepository('EmailAddress')->where(array( + 'lower' => strtolower($p['value']) + ))->findOne(); + unset($params['where'][$i]); + $emailAddressId = null; + if ($emailAddress) { + $emailAddressId = $emailAddress->id; + } + } + + } + } + + $selectParams = $this->getSelectManager($this->entityName)->getSelectParams($params, true); + + if ($searchByEmailAddress) { + if ($emailAddressId) { + $pdo = $this->getEntityManager()->getPDO(); + + $selectParams['distinct'] = true; + + $selectParams['customJoin'] = " + LEFT JOIN email_email_address + ON + email_email_address.email_id = email.id AND + email_email_address.deleted = 0 + "; + $selectParams['customWhere'] = " + AND + ( + email.from_email_address_id = ".$pdo->quote($emailAddressId)." OR + email_email_address.email_address_id = ".$pdo->quote($emailAddressId)." + ) + "; + } else { + $selectParams['customWhere'] = ' AND 0'; + } + + } + + $collection = $this->getRepository()->find($selectParams); + + foreach ($collection as $e) { + $this->loadParentNameFields($e); + } + + return array( + 'total' => $this->getRepository()->count($selectParams), + 'collection' => $collection, + ); + } + + public function getCopiedAttachments($id) + { + $ids = array(); + $names = new \stdClass(); + + if (!empty($id)) { + $email = $this->getEntityManager()->getEntity('Email', $id); + if ($email && $this->getAcl()->check($email, 'read')) { + $email->loadLinkMultipleField('attachments'); + $attachmentsIds = $email->get('attachmentsIds'); + + foreach ($attachmentsIds as $attachmentId) { + $source = $this->getEntityManager()->getEntity('Attachment', $attachmentId); + if ($source) { + $attachment = $this->getEntityManager()->getEntity('Attachment'); + $attachment->set('role', 'Attachment'); + $attachment->set('type', $source->get('type')); + $attachment->set('size', $source->get('size')); + $attachment->set('global', $source->get('global')); + $attachment->set('name', $source->get('name')); + + $this->getEntityManager()->saveEntity($attachment); + + $contents = $this->getFileManager()->getContents('data/upload/' . $source->id); + if (!empty($contents)) { + $this->getFileManager()->putContents('data/upload/' . $attachment->id, $contents); + $ids[] = $attachment->id; + $names->{$attachment->id} = $attachment->get('name'); + } + } + } + } + } + + return array( + 'ids' => $ids, + 'names' => $names + ); + } } diff --git a/application/Espo/Services/EmailAccount.php b/application/Espo/Services/EmailAccount.php index 2d08db3f45..59d73b02fb 100644 --- a/application/Espo/Services/EmailAccount.php +++ b/application/Espo/Services/EmailAccount.php @@ -28,203 +28,203 @@ use \Espo\Core\Exceptions\Error; use \Espo\Core\Exceptions\Forbidden; class EmailAccount extends Record -{ - protected $internalFields = array('password'); - - protected $readOnlyFields = array('assignedUserId', 'fetchData'); - - const PORTION_LIMIT = 10; - - protected function init() - { - $this->dependencies[] = 'fileManager'; - $this->dependencies[] = 'crypt'; - } - - protected function getFileManager() - { - return $this->injections['fileManager']; - } - - protected function getCrypt() - { - return $this->injections['crypt']; - } - - protected function handleInput(&$data) - { - parent::handleInput($data); - if (array_key_exists('password', $data)) { - $data['password'] = $this->getCrypt()->encrypt($data['password']); - } - } - - public function getFolders($params) - { - $password = $params['password']; - - if (!empty($params['id'])) { - $entity = $this->getEntityManager()->getEntity('EmailAccount', $params['id']); - if ($entity) { - $password = $this->getCrypt()->decrypt($entity->get('password')); - } - } - - $imapParams = array( - 'host' => $params['host'], - 'port' => $params['port'], - 'user' => $params['username'], - 'password' => $password, - ); - - if (!empty($params['ssl'])) { - $imapParams['ssl'] = 'SSL'; - } - - $foldersArr = array(); - - $storage = new \Zend\Mail\Storage\Imap($imapParams); - - $folders = new \RecursiveIteratorIterator($storage->getFolders(), \RecursiveIteratorIterator::SELF_FIRST); - foreach ($folders as $name => $folder) { - $foldersArr[] = $folder->getGlobalName(); - } - return $foldersArr; - } - - public function createEntity($data) - { - $entity = parent::createEntity($data); - if ($entity) { - $entity->set('assignedUserId', $this->getUser()->id); - $this->getEntityManager()->saveEntity($entity); - } - return $entity; - } - - public function fetchFromMailServer(Entity $emailAccount) - { - if ($emailAccount->get('status') != 'Active') { - throw new Error(); - } - - $importer = new \Espo\Core\Mail\Importer($this->getEntityManager(), $this->getFileManager()); - - $maxSize = $this->getConfig()->get('emailMessageMaxSize'); - - $user = $this->getEntityManager()->getEntity('User', $emailAccount->get('assignedUserId')); - - if (!$user) { - throw new Error(); - } - - $userId = $user->id; - $teamId = $user->get('defaultTeam'); - - $fetchData = json_decode($emailAccount->get('fetchData'), true); - if (empty($fetchData)) { - $fetchData = array(); - } - if (!array_key_exists('lastUID', $fetchData)) { - $fetchData['lastUID'] = array(); - } - if (!array_key_exists('lastUID', $fetchData)) { - $fetchData['lastDate'] = array(); - } - - $imapParams = array( - 'host' => $emailAccount->get('host'), - 'port' => $emailAccount->get('port'), - 'user' => $emailAccount->get('username'), - 'password' => $this->getCrypt()->decrypt($emailAccount->get('password')), - ); - - if ($emailAccount->get('ssl')) { - $imapParams['ssl'] = 'SSL'; - } - - $storage = new \Espo\Core\Mail\Storage\Imap($imapParams); - - $monitoredFolders = $emailAccount->get('monitoredFolders'); - if (empty($monitoredFolders)) { - throw new Error(); - } - - $monitoredFoldersArr = explode(',', $monitoredFolders); - foreach ($monitoredFoldersArr as $folder) { - $folder = trim($folder); - $storage->selectFolder($folder); - - $lastUID = 0; - $lastDate = 0; - if (!empty($fetchData['lastUID'][$folder])) { - $lastUID = $fetchData['lastUID'][$folder]; - } - if (!empty($fetchData['lastDate'][$folder])) { - $lastDate = $fetchData['lastDate'][$folder]; - } +{ + protected $internalFields = array('password'); + + protected $readOnlyFields = array('assignedUserId', 'fetchData'); + + const PORTION_LIMIT = 10; + + protected function init() + { + $this->dependencies[] = 'fileManager'; + $this->dependencies[] = 'crypt'; + } + + protected function getFileManager() + { + return $this->injections['fileManager']; + } + + protected function getCrypt() + { + return $this->injections['crypt']; + } + + protected function handleInput(&$data) + { + parent::handleInput($data); + if (array_key_exists('password', $data)) { + $data['password'] = $this->getCrypt()->encrypt($data['password']); + } + } + + public function getFolders($params) + { + $password = $params['password']; + + if (!empty($params['id'])) { + $entity = $this->getEntityManager()->getEntity('EmailAccount', $params['id']); + if ($entity) { + $password = $this->getCrypt()->decrypt($entity->get('password')); + } + } + + $imapParams = array( + 'host' => $params['host'], + 'port' => $params['port'], + 'user' => $params['username'], + 'password' => $password, + ); + + if (!empty($params['ssl'])) { + $imapParams['ssl'] = 'SSL'; + } + + $foldersArr = array(); + + $storage = new \Zend\Mail\Storage\Imap($imapParams); + + $folders = new \RecursiveIteratorIterator($storage->getFolders(), \RecursiveIteratorIterator::SELF_FIRST); + foreach ($folders as $name => $folder) { + $foldersArr[] = $folder->getGlobalName(); + } + return $foldersArr; + } + + public function createEntity($data) + { + $entity = parent::createEntity($data); + if ($entity) { + $entity->set('assignedUserId', $this->getUser()->id); + $this->getEntityManager()->saveEntity($entity); + } + return $entity; + } + + public function fetchFromMailServer(Entity $emailAccount) + { + if ($emailAccount->get('status') != 'Active') { + throw new Error(); + } + + $importer = new \Espo\Core\Mail\Importer($this->getEntityManager(), $this->getFileManager()); + + $maxSize = $this->getConfig()->get('emailMessageMaxSize'); + + $user = $this->getEntityManager()->getEntity('User', $emailAccount->get('assignedUserId')); + + if (!$user) { + throw new Error(); + } + + $userId = $user->id; + $teamId = $user->get('defaultTeam'); + + $fetchData = json_decode($emailAccount->get('fetchData'), true); + if (empty($fetchData)) { + $fetchData = array(); + } + if (!array_key_exists('lastUID', $fetchData)) { + $fetchData['lastUID'] = array(); + } + if (!array_key_exists('lastUID', $fetchData)) { + $fetchData['lastDate'] = array(); + } + + $imapParams = array( + 'host' => $emailAccount->get('host'), + 'port' => $emailAccount->get('port'), + 'user' => $emailAccount->get('username'), + 'password' => $this->getCrypt()->decrypt($emailAccount->get('password')), + ); + + if ($emailAccount->get('ssl')) { + $imapParams['ssl'] = 'SSL'; + } + + $storage = new \Espo\Core\Mail\Storage\Imap($imapParams); + + $monitoredFolders = $emailAccount->get('monitoredFolders'); + if (empty($monitoredFolders)) { + throw new Error(); + } + + $monitoredFoldersArr = explode(',', $monitoredFolders); + foreach ($monitoredFoldersArr as $folder) { + $folder = trim($folder); + $storage->selectFolder($folder); + + $lastUID = 0; + $lastDate = 0; + if (!empty($fetchData['lastUID'][$folder])) { + $lastUID = $fetchData['lastUID'][$folder]; + } + if (!empty($fetchData['lastDate'][$folder])) { + $lastDate = $fetchData['lastDate'][$folder]; + } - if (!empty($lastUID)) { - $ids = $storage->getIdsFromUID($lastUID); - } else { - $dt = new \DateTime($emailAccount->get('fetchSince')); - if ($dt) { - $ids = $storage->getIdsFromDate($dt->format('d-M-Y')); - } else { - return false; - } - } - - if ((count($ids) == 1) && !empty($lastUID)) { - if ($storage->getUniqueId($ids[0]) == $lastUID) { - continue; - } - } - - $k = 0; - foreach ($ids as $i => $id) { - if ($k == count($ids) - 1) { - $lastUID = $storage->getUniqueId($id); - } - - if ($maxSize) { - if ($storage->getSize($id) > $maxSize * 1024 * 1024) { - continue; - } - } - - $message = $storage->getMessage($id); - - $email = $importer->importMessage($message, $userId, array($teamId)); - - if ($k == count($ids) - 1) { - $lastUID = $storage->getUniqueId($id); - - if ($message) { - $dt = new \DateTime($message->date); - if ($dt) { - $dateSent = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'); - $lastDate = $dateSent; - } - } - } - - if ($k == self::PORTION_LIMIT - 1) { - $lastUID = $storage->getUniqueId($id); - break; - } - $k++; - } - - $fetchData['lastUID'][$folder] = $lastUID; - $fetchData['lastDate'][$folder] = $lastDate; - - $emailAccount->set('fetchData', json_encode($fetchData)); - $this->getEntityManager()->saveEntity($emailAccount); - } - - return true; - } + if (!empty($lastUID)) { + $ids = $storage->getIdsFromUID($lastUID); + } else { + $dt = new \DateTime($emailAccount->get('fetchSince')); + if ($dt) { + $ids = $storage->getIdsFromDate($dt->format('d-M-Y')); + } else { + return false; + } + } + + if ((count($ids) == 1) && !empty($lastUID)) { + if ($storage->getUniqueId($ids[0]) == $lastUID) { + continue; + } + } + + $k = 0; + foreach ($ids as $i => $id) { + if ($k == count($ids) - 1) { + $lastUID = $storage->getUniqueId($id); + } + + if ($maxSize) { + if ($storage->getSize($id) > $maxSize * 1024 * 1024) { + continue; + } + } + + $message = $storage->getMessage($id); + + $email = $importer->importMessage($message, $userId, array($teamId)); + + if ($k == count($ids) - 1) { + $lastUID = $storage->getUniqueId($id); + + if ($message) { + $dt = new \DateTime($message->date); + if ($dt) { + $dateSent = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'); + $lastDate = $dateSent; + } + } + } + + if ($k == self::PORTION_LIMIT - 1) { + $lastUID = $storage->getUniqueId($id); + break; + } + $k++; + } + + $fetchData['lastUID'][$folder] = $lastUID; + $fetchData['lastDate'][$folder] = $lastDate; + + $emailAccount->set('fetchData', json_encode($fetchData)); + $this->getEntityManager()->saveEntity($emailAccount); + } + + return true; + } } diff --git a/application/Espo/Services/EmailAddress.php b/application/Espo/Services/EmailAddress.php index ed509152d2..47db95277d 100644 --- a/application/Espo/Services/EmailAddress.php +++ b/application/Espo/Services/EmailAddress.php @@ -28,89 +28,89 @@ use \Espo\Core\Exceptions\Error; class EmailAddress extends Record { - private function findInAddressBookByEntityType($where, $limit, $entityType, &$result) - { - $service = $this->getServiceFactory()->create($entityType); - - $r = $service->findEntities(array( - 'where' => $where, - 'maxSize' => $limit, - 'sortBy' => 'name' - )); - - foreach ($r['collection'] as $entity) { - $entity->loadLinkMultipleField('emailAddress'); - - $emailAddress = $entity->get('emailAddress'); - - $result[] = array( - 'emailAddress' => $emailAddress, - 'name' => $entity->get('name'), - 'entityType' => $entityType - ); - + private function findInAddressBookByEntityType($where, $limit, $entityType, &$result) + { + $service = $this->getServiceFactory()->create($entityType); + + $r = $service->findEntities(array( + 'where' => $where, + 'maxSize' => $limit, + 'sortBy' => 'name' + )); + + foreach ($r['collection'] as $entity) { + $entity->loadLinkMultipleField('emailAddress'); + + $emailAddress = $entity->get('emailAddress'); + + $result[] = array( + 'emailAddress' => $emailAddress, + 'name' => $entity->get('name'), + 'entityType' => $entityType + ); + - $c = $service->getEntity($entity->id); - $emailAddressData = $c->get('emailAddressData'); - foreach ($emailAddressData as $d) { - if ($emailAddress != $d->emailAddress) { - $emailAddress = $d->emailAddress; - $result[] = array( - 'emailAddress' => $emailAddress, - 'name' => $entity->get('name'), - 'entityType' => $entityType - ); - break; - } - } - } - } - - - public function searchInAddressBook($query, $limit) - { - $result = array(); - - $where = array( - array( - 'type' => 'or', - 'value' => array( - array( - 'type' => 'like', - 'field' => 'name', - 'value' => $query . '%' - ), - array( - 'type' => 'like', - 'field' => 'emailAddress', - 'value' => $query . '%' - ) - ) - ), - array( - 'type' => 'notEquals', - 'field' => 'emailAddress', - 'value' => null - ) - ); - - $this->findInAddressBookByEntityType($where, $limit, 'Contact', $result); - $this->findInAddressBookByEntityType($where, $limit, 'Lead', $result); - $this->findInAddressBookByEntityType($where, $limit, 'User', $result); - - $final = array(); - - foreach ($result as $r) { - foreach ($final as $f) { - if ($f['emailAddress'] == $r['emailAddress'] && $f['name'] == $r['name']) { - continue 2; - } - } - $final[] = $r; - } - - return $final; - } - + $c = $service->getEntity($entity->id); + $emailAddressData = $c->get('emailAddressData'); + foreach ($emailAddressData as $d) { + if ($emailAddress != $d->emailAddress) { + $emailAddress = $d->emailAddress; + $result[] = array( + 'emailAddress' => $emailAddress, + 'name' => $entity->get('name'), + 'entityType' => $entityType + ); + break; + } + } + } + } + + + public function searchInAddressBook($query, $limit) + { + $result = array(); + + $where = array( + array( + 'type' => 'or', + 'value' => array( + array( + 'type' => 'like', + 'field' => 'name', + 'value' => $query . '%' + ), + array( + 'type' => 'like', + 'field' => 'emailAddress', + 'value' => $query . '%' + ) + ) + ), + array( + 'type' => 'notEquals', + 'field' => 'emailAddress', + 'value' => null + ) + ); + + $this->findInAddressBookByEntityType($where, $limit, 'Contact', $result); + $this->findInAddressBookByEntityType($where, $limit, 'Lead', $result); + $this->findInAddressBookByEntityType($where, $limit, 'User', $result); + + $final = array(); + + foreach ($result as $r) { + foreach ($final as $f) { + if ($f['emailAddress'] == $r['emailAddress'] && $f['name'] == $r['name']) { + continue 2; + } + } + $final[] = $r; + } + + return $final; + } + } diff --git a/application/Espo/Services/EmailNotification.php b/application/Espo/Services/EmailNotification.php index a60d77cc6e..c6c7678e6c 100644 --- a/application/Espo/Services/EmailNotification.php +++ b/application/Espo/Services/EmailNotification.php @@ -28,91 +28,91 @@ use \Espo\Core\Exceptions\NotFound; use Espo\ORM\Entity; class EmailNotification extends \Espo\Core\Services\Base -{ - protected function init() - { - $this->dependencies[] = 'metadata'; - $this->dependencies[] = 'mailSender'; - $this->dependencies[] = 'language'; - } - - protected function getMailSender() - { - return $this->getInjection('mailSender'); - } - - protected function getMetadata() - { - return $this->getInjection('metadata'); - } - - protected function getLanguage() - { - return $this->getInjection('language'); - } - - protected function replaceMessageVariables($text, $entity, $user, $assignerUser) - { - $recordUrl = $this->getConfig()->get('siteUrl') . '#' . $entity->getEntityName() . '/view/' . $entity->id; - - $text = str_replace('{userName}', $user->get('name'), $text); - $text = str_replace('{assignerUserName}', $assignerUser->get('name'), $text); - $text = str_replace('{recordUrl}', $recordUrl, $text); - $text = str_replace('{entityType}', $this->getLanguage()->translate($entity->getEntityName(), 'scopeNames'), $text); - - $fields = $entity->getFields(); - foreach ($fields as $field => $d) { - $text = str_replace('{Entity.' . $field . '}', $entity->get($field), $text); - } - - return $text; - } - - public function notifyAboutAssignmentJob($data) - { - $userId = $data['userId']; - $assignerUserId = $data['assignerUserId']; - $entityId = $data['entityId']; - $entityType = $data['entityType']; - - $user = $this->getEntityManager()->getEntity('User', $userId); - - $prefs = $this->getEntityManager()->getEntity('Preferences', $userId); - - if (!$prefs) { - return true; - } - - if (!$prefs->get('receiveAssignmentEmailNotifications')) { - return true; - } - - $assignerUser = $this->getEntityManager()->getEntity('User', $assignerUserId); - $entity = $this->getEntityManager()->getEntity($entityType, $entityId); - - if ($user && $entity && $assignerUser && $entity->get('assignedUserId') == $userId) { - $emailAddress = $user->get('emailAddress'); - if (!empty($emailAddress)) { - $email = $this->getEntityManager()->getEntity('Email'); - - $subject = $this->getLanguage()->translate('assignmentEmailNotificationSubject', 'messages', $entity->getEntityName()); - $body = $this->getLanguage()->translate('assignmentEmailNotificationBody', 'messages', $entity->getEntityName()); - - $subject = $this->replaceMessageVariables($subject, $entity, $user, $assignerUser); - $body = $this->replaceMessageVariables($body, $entity, $user, $assignerUser); - - $email->set(array( - 'subject' => $subject, - 'body' => $body, - 'isHtml' => false, - 'to' => $emailAddress - )); - - $this->getMailSender()->send($email); - } - } - - return true; - } +{ + protected function init() + { + $this->dependencies[] = 'metadata'; + $this->dependencies[] = 'mailSender'; + $this->dependencies[] = 'language'; + } + + protected function getMailSender() + { + return $this->getInjection('mailSender'); + } + + protected function getMetadata() + { + return $this->getInjection('metadata'); + } + + protected function getLanguage() + { + return $this->getInjection('language'); + } + + protected function replaceMessageVariables($text, $entity, $user, $assignerUser) + { + $recordUrl = $this->getConfig()->get('siteUrl') . '#' . $entity->getEntityName() . '/view/' . $entity->id; + + $text = str_replace('{userName}', $user->get('name'), $text); + $text = str_replace('{assignerUserName}', $assignerUser->get('name'), $text); + $text = str_replace('{recordUrl}', $recordUrl, $text); + $text = str_replace('{entityType}', $this->getLanguage()->translate($entity->getEntityName(), 'scopeNames'), $text); + + $fields = $entity->getFields(); + foreach ($fields as $field => $d) { + $text = str_replace('{Entity.' . $field . '}', $entity->get($field), $text); + } + + return $text; + } + + public function notifyAboutAssignmentJob($data) + { + $userId = $data['userId']; + $assignerUserId = $data['assignerUserId']; + $entityId = $data['entityId']; + $entityType = $data['entityType']; + + $user = $this->getEntityManager()->getEntity('User', $userId); + + $prefs = $this->getEntityManager()->getEntity('Preferences', $userId); + + if (!$prefs) { + return true; + } + + if (!$prefs->get('receiveAssignmentEmailNotifications')) { + return true; + } + + $assignerUser = $this->getEntityManager()->getEntity('User', $assignerUserId); + $entity = $this->getEntityManager()->getEntity($entityType, $entityId); + + if ($user && $entity && $assignerUser && $entity->get('assignedUserId') == $userId) { + $emailAddress = $user->get('emailAddress'); + if (!empty($emailAddress)) { + $email = $this->getEntityManager()->getEntity('Email'); + + $subject = $this->getLanguage()->translate('assignmentEmailNotificationSubject', 'messages', $entity->getEntityName()); + $body = $this->getLanguage()->translate('assignmentEmailNotificationBody', 'messages', $entity->getEntityName()); + + $subject = $this->replaceMessageVariables($subject, $entity, $user, $assignerUser); + $body = $this->replaceMessageVariables($body, $entity, $user, $assignerUser); + + $email->set(array( + 'subject' => $subject, + 'body' => $body, + 'isHtml' => false, + 'to' => $emailAddress + )); + + $this->getMailSender()->send($email); + } + } + + return true; + } } diff --git a/application/Espo/Services/EmailTemplate.php b/application/Espo/Services/EmailTemplate.php index d2a6ddc9e6..34d2b15dca 100644 --- a/application/Espo/Services/EmailTemplate.php +++ b/application/Espo/Services/EmailTemplate.php @@ -30,142 +30,142 @@ use \Espo\Core\Exceptions\NotFound; class EmailTemplate extends Record { - protected function init() - { - $this->dependencies[] = 'fileManager'; - $this->dependencies[] = 'dateTime'; - } - - protected function getFileManager() - { - return $this->injections['fileManager']; - } - - protected function getDateTime() - { - return $this->injections['dateTime']; - } - - public function parse($id, array $params = array(), $copyAttachments = false) - { - $emailTemplate = $this->getEntity($id); - if (empty($emailTemplate)) { - throw new NotFound(); - } - - - - $entityList = array(); - if (!empty($params['entityHash']) && is_array($params['entityHash'])) { - $entityList = $params['entityHash']; - } - - $entityList['User'] = $this->getUser(); + protected function init() + { + $this->dependencies[] = 'fileManager'; + $this->dependencies[] = 'dateTime'; + } + + protected function getFileManager() + { + return $this->injections['fileManager']; + } + + protected function getDateTime() + { + return $this->injections['dateTime']; + } + + public function parse($id, array $params = array(), $copyAttachments = false) + { + $emailTemplate = $this->getEntity($id); + if (empty($emailTemplate)) { + throw new NotFound(); + } + + + + $entityList = array(); + if (!empty($params['entityHash']) && is_array($params['entityHash'])) { + $entityList = $params['entityHash']; + } + + $entityList['User'] = $this->getUser(); - if (!empty($params['emailAddress'])) { - $emailAddress = $this->getEntityManager()->getRepository('EmailAddress')->where(array( - 'lower' => $params['emailAddress'] - ))->findOne(); - + if (!empty($params['emailAddress'])) { + $emailAddress = $this->getEntityManager()->getRepository('EmailAddress')->where(array( + 'lower' => $params['emailAddress'] + ))->findOne(); + - if (!empty($emailAddress)) { - $pdo = $this->getEntityManager()->getPDO(); - $sql = " - SELECT * FROM `entity_email_address` - WHERE - `primary` = 1 AND `deleted` = 0 AND `email_address_id` = " . $pdo->quote($emailAddress->id). " - "; - $sth = $pdo->prepare($sql); - $sth->execute(); - while ($row = $sth->fetch()) { - if (!empty($row['entity_id'])) { - $entity = $this->getEntityManager()->getEntity($row['entity_type'], $row['entity_id']); - if ($entity) { - if (!empty($entity::$person)) { - $entityList['Person'] = $entity; - } - if (empty($entityList[$entity->getEntityName()])) { - $entityList[$entity->getEntityName()] = $entity; - } - break; - } - - } - } - } - } - - if (!empty($params['parentId']) && !empty($params['parentType'])) { - $parent = $this->getEntityManager()->getEntity($params['parentType'], $params['parentId']); - if (!empty($parent)) { - $entityList[$params['parentType']] = $parent; - $entityList['Parent'] = $parent; - - if (empty($entityList['Person']) && !empty($parent::$person)) { - $entityList['Person'] = $parent; - } - } - } - - $subject = $emailTemplate->get('subject'); - $body = $emailTemplate->get('body'); - - foreach ($entityList as $type => $entity) { - $subject = $this->parseText($type, $entity, $subject); - } - foreach ($entityList as $type => $entity) { - $body = $this->parseText($type, $entity, $body); - } - - $attachmentsIds = array(); - $attachmentsNames = new \StdClass(); - - if ($copyAttachments) { - $attachmentList = $emailTemplate->get('attachments'); - if (!empty($attachmentList)) { - foreach ($attachmentList as $attachment) { - $clone = $this->getEntityManager()->getEntity('Attachment'); - $data = $attachment->toArray(); - unset($data['parentType']); - unset($data['parentId']); - unset($data['id']); - $clone->set($data); - $this->getEntityManager()->saveEntity($clone); - - $contents = $this->getFileManager()->getContents('data/upload/' . $attachment->id); - if (empty($contents)) { - continue; - } - $this->getFileManager()->putContents('data/upload/' . $clone->id, $contents); - - $attachmentsIds[] = $id = $clone->id; - $attachmentsNames->$id = $clone->get('name'); - } - } - } - - return array( - 'subject' => $subject, - 'body' => $body, - 'attachmentsIds' => $attachmentsIds, - 'attachmentsNames' => $attachmentsNames, - 'isHtml' => $emailTemplate->get('isHtml') - ); - } - - protected function parseText($type, Entity $entity, $text) - { - $fields = array_keys($entity->getFields()); - foreach ($fields as $field) { - $value = $entity->get($field); - if ($entity->fields[$field]['type'] == 'date') { - $value = $this->getDateTime()->convertSystemDateToGlobal($value); - } else if ($entity->fields[$field]['type'] == 'datetime') { - $value = $this->getDateTime()->convertSystemDateTimeToGlobal($value); - } - $text = str_replace('{' . $type . '.' . $field . '}', $value, $text); - } - return $text; - } + if (!empty($emailAddress)) { + $pdo = $this->getEntityManager()->getPDO(); + $sql = " + SELECT * FROM `entity_email_address` + WHERE + `primary` = 1 AND `deleted` = 0 AND `email_address_id` = " . $pdo->quote($emailAddress->id). " + "; + $sth = $pdo->prepare($sql); + $sth->execute(); + while ($row = $sth->fetch()) { + if (!empty($row['entity_id'])) { + $entity = $this->getEntityManager()->getEntity($row['entity_type'], $row['entity_id']); + if ($entity) { + if (!empty($entity::$person)) { + $entityList['Person'] = $entity; + } + if (empty($entityList[$entity->getEntityName()])) { + $entityList[$entity->getEntityName()] = $entity; + } + break; + } + + } + } + } + } + + if (!empty($params['parentId']) && !empty($params['parentType'])) { + $parent = $this->getEntityManager()->getEntity($params['parentType'], $params['parentId']); + if (!empty($parent)) { + $entityList[$params['parentType']] = $parent; + $entityList['Parent'] = $parent; + + if (empty($entityList['Person']) && !empty($parent::$person)) { + $entityList['Person'] = $parent; + } + } + } + + $subject = $emailTemplate->get('subject'); + $body = $emailTemplate->get('body'); + + foreach ($entityList as $type => $entity) { + $subject = $this->parseText($type, $entity, $subject); + } + foreach ($entityList as $type => $entity) { + $body = $this->parseText($type, $entity, $body); + } + + $attachmentsIds = array(); + $attachmentsNames = new \StdClass(); + + if ($copyAttachments) { + $attachmentList = $emailTemplate->get('attachments'); + if (!empty($attachmentList)) { + foreach ($attachmentList as $attachment) { + $clone = $this->getEntityManager()->getEntity('Attachment'); + $data = $attachment->toArray(); + unset($data['parentType']); + unset($data['parentId']); + unset($data['id']); + $clone->set($data); + $this->getEntityManager()->saveEntity($clone); + + $contents = $this->getFileManager()->getContents('data/upload/' . $attachment->id); + if (empty($contents)) { + continue; + } + $this->getFileManager()->putContents('data/upload/' . $clone->id, $contents); + + $attachmentsIds[] = $id = $clone->id; + $attachmentsNames->$id = $clone->get('name'); + } + } + } + + return array( + 'subject' => $subject, + 'body' => $body, + 'attachmentsIds' => $attachmentsIds, + 'attachmentsNames' => $attachmentsNames, + 'isHtml' => $emailTemplate->get('isHtml') + ); + } + + protected function parseText($type, Entity $entity, $text) + { + $fields = array_keys($entity->getFields()); + foreach ($fields as $field) { + $value = $entity->get($field); + if ($entity->fields[$field]['type'] == 'date') { + $value = $this->getDateTime()->convertSystemDateToGlobal($value); + } else if ($entity->fields[$field]['type'] == 'datetime') { + $value = $this->getDateTime()->convertSystemDateTimeToGlobal($value); + } + $text = str_replace('{' . $type . '.' . $field . '}', $value, $text); + } + return $text; + } } diff --git a/application/Espo/Services/ExternalAccount.php b/application/Espo/Services/ExternalAccount.php index 4c1b446fb4..a8609a2b6d 100644 --- a/application/Espo/Services/ExternalAccount.php +++ b/application/Espo/Services/ExternalAccount.php @@ -29,67 +29,67 @@ use \Espo\Core\Exceptions\Forbidden; use \Espo\Core\Exceptions\NotFound; class ExternalAccount extends Record -{ - protected function getClient($integration, $id) - { - $integrationEntity = $this->getEntityManager()->getEntity('Integration', $integration); - - if (!$integrationEntity) { - throw new NotFound(); - } - $d = $integrationEntity->toArray(); - - if (!$integrationEntity->get('enabled')) { - throw new Error("{$integration} is disabled."); - } - - $factory = new \Espo\Core\ExternalAccount\ClientManager($this->getEntityManager(), $this->getMetadata(), $this->getConfig()); - return $factory->create($integration, $id); - } - - public function getExternalAccountEntity($integration, $userId) - { - return $this->getEntityManager()->getEntity('ExternalAccount', $integration . '__' . $userId); - } - - public function ping($integration, $userId) - { - $entity = $this->getExternalAccountEntity($integration, $userId); - try { - $client = $this->getClient($integration, $userId); - if ($client) { - return $client->ping(); - } - } catch (\Exception $e) {} - } - - public function authorizationCode($integration, $userId, $code) - { - $entity = $this->getExternalAccountEntity($integration, $userId); - if (!$entity) { - throw new NotFound(); - } - $entity->set('enabled', true); - $this->getEntityManager()->saveEntity($entity); - - $client = $this->getClient($integration, $userId); - if ($client instanceof \Espo\Core\ExternalAccount\Clients\OAuth2Abstract) { - $result = $client->getAccessTokenFromAuthorizationCode($code); - if (!empty($result) && !empty($result['accessToken'])) { - $entity->clear('accessToken'); - $entity->clear('refreshToken'); - $entity->clear('tokenType'); - foreach ($result as $name => $value) { - $entity->set($name, $value); - } - $this->getEntityManager()->saveEntity($entity); - return true; - } else { - throw new Error("Could not get access token for {$integration}."); - } - } else { - throw new Error("Could not load client for {$integration}."); - } - } +{ + protected function getClient($integration, $id) + { + $integrationEntity = $this->getEntityManager()->getEntity('Integration', $integration); + + if (!$integrationEntity) { + throw new NotFound(); + } + $d = $integrationEntity->toArray(); + + if (!$integrationEntity->get('enabled')) { + throw new Error("{$integration} is disabled."); + } + + $factory = new \Espo\Core\ExternalAccount\ClientManager($this->getEntityManager(), $this->getMetadata(), $this->getConfig()); + return $factory->create($integration, $id); + } + + public function getExternalAccountEntity($integration, $userId) + { + return $this->getEntityManager()->getEntity('ExternalAccount', $integration . '__' . $userId); + } + + public function ping($integration, $userId) + { + $entity = $this->getExternalAccountEntity($integration, $userId); + try { + $client = $this->getClient($integration, $userId); + if ($client) { + return $client->ping(); + } + } catch (\Exception $e) {} + } + + public function authorizationCode($integration, $userId, $code) + { + $entity = $this->getExternalAccountEntity($integration, $userId); + if (!$entity) { + throw new NotFound(); + } + $entity->set('enabled', true); + $this->getEntityManager()->saveEntity($entity); + + $client = $this->getClient($integration, $userId); + if ($client instanceof \Espo\Core\ExternalAccount\Clients\OAuth2Abstract) { + $result = $client->getAccessTokenFromAuthorizationCode($code); + if (!empty($result) && !empty($result['accessToken'])) { + $entity->clear('accessToken'); + $entity->clear('refreshToken'); + $entity->clear('tokenType'); + foreach ($result as $name => $value) { + $entity->set($name, $value); + } + $this->getEntityManager()->saveEntity($entity); + return true; + } else { + throw new Error("Could not get access token for {$integration}."); + } + } else { + throw new Error("Could not load client for {$integration}."); + } + } } diff --git a/application/Espo/Services/GlobalSearch.php b/application/Espo/Services/GlobalSearch.php index f39e83a488..4629a3476a 100644 --- a/application/Espo/Services/GlobalSearch.php +++ b/application/Espo/Services/GlobalSearch.php @@ -28,79 +28,79 @@ use \Espo\Core\Exceptions\NotFound; use Espo\ORM\Entity; class GlobalSearch extends \Espo\Core\Services\Base -{ - protected $dependencies = array( - 'entityManager', - 'user', - 'metadata', - 'acl', - 'selectManagerFactory', - 'config', - ); - - protected function getSelectManagerFactory() - { - return $this->injections['selectManagerFactory']; - } +{ + protected $dependencies = array( + 'entityManager', + 'user', + 'metadata', + 'acl', + 'selectManagerFactory', + 'config', + ); + + protected function getSelectManagerFactory() + { + return $this->injections['selectManagerFactory']; + } - protected function getEntityManager() - { - return $this->injections['entityManager']; - } - - protected function getAcl() - { - return $this->injections['acl']; - } - - protected function getMetadata() - { - return $this->injections['metadata']; - } - - public function find($query, $offset, $maxSize) - { - $entityNameList = $this->getConfig()->get('globalSearchEntityList'); - - $entityTypeCount = count($entityNameList); - - $list = array(); - $count = 0; - $total = 0; - foreach ($entityNameList as $entityName) { - - if (!$this->getAcl()->check($entityName, 'read')) { - continue; - } - $selectManager = $this->getSelectManagerFactory()->create($entityName); - - $searchParams = array( - 'whereClause' => array( - 'OR' => array( - 'name*' => '%' . $query . '%', - ) - ), - 'offset' => round($offset / $entityTypeCount), - 'limit' => round($maxSize / $entityTypeCount), - 'orderBy' => 'createdAt', - 'order' => 'DESC', - ); - $selectParams = array_merge_recursive($searchParams, $selectManager->getAclParams()); - - $collection = $this->getEntityManager()->getRepository($entityName)->find($selectParams); - $count += count($collection); - $total += $this->getEntityManager()->getRepository($entityName)->count($selectParams); - foreach ($collection as $entity) { - $data = $entity->toArray(); - $data['_scope'] = $entityName; - $list[] = $data; - } - } - - return array( - 'total' => $total, - 'list' => $list, - ); - } + protected function getEntityManager() + { + return $this->injections['entityManager']; + } + + protected function getAcl() + { + return $this->injections['acl']; + } + + protected function getMetadata() + { + return $this->injections['metadata']; + } + + public function find($query, $offset, $maxSize) + { + $entityNameList = $this->getConfig()->get('globalSearchEntityList'); + + $entityTypeCount = count($entityNameList); + + $list = array(); + $count = 0; + $total = 0; + foreach ($entityNameList as $entityName) { + + if (!$this->getAcl()->check($entityName, 'read')) { + continue; + } + $selectManager = $this->getSelectManagerFactory()->create($entityName); + + $searchParams = array( + 'whereClause' => array( + 'OR' => array( + 'name*' => '%' . $query . '%', + ) + ), + 'offset' => round($offset / $entityTypeCount), + 'limit' => round($maxSize / $entityTypeCount), + 'orderBy' => 'createdAt', + 'order' => 'DESC', + ); + $selectParams = array_merge_recursive($searchParams, $selectManager->getAclParams()); + + $collection = $this->getEntityManager()->getRepository($entityName)->find($selectParams); + $count += count($collection); + $total += $this->getEntityManager()->getRepository($entityName)->count($selectParams); + foreach ($collection as $entity) { + $data = $entity->toArray(); + $data['_scope'] = $entityName; + $list[] = $data; + } + } + + return array( + 'total' => $total, + 'list' => $list, + ); + } } diff --git a/application/Espo/Services/Import.php b/application/Espo/Services/Import.php index 31b9908e99..3bca7e2606 100644 --- a/application/Espo/Services/Import.php +++ b/application/Espo/Services/Import.php @@ -29,381 +29,381 @@ use \Espo\Core\Exceptions\Error; use Espo\ORM\Entity; class Import extends \Espo\Core\Services\Base -{ - protected $dependencies = array( - 'entityManager', - 'user', - 'metadata', - 'acl', - 'selectManagerFactory', - 'config', - 'serviceFactory', - 'fileManager', - ); - - protected $dateFormatsMap = array( - 'YYYY-MM-DD' => 'Y-m-d', - 'DD-MM-YYYY' => 'd-m-Y', - 'MM-DD-YYYY' => 'm-d-Y', - 'MM/DD/YYYY' => 'm/d/Y', - 'DD/MM/YYYY' => 'd/m/Y', - 'DD.MM.YYYY' => 'd.m.Y', - 'MM.DD.YYYY' => 'm.d.Y', - 'YYYY.MM.DD' => 'Y.m.d', - ); - - protected $timeFormatsMap = array( - 'HH:mm' => 'H:i', - 'hh:mm a' => 'h:i a', - 'hh:mma' => 'h:ia', - 'hh:mm A' => 'h:iA', - 'hh:mmA' => 'h:iA', - ); - - protected function getSelectManagerFactory() - { - return $this->injections['selectManagerFactory']; - } - - protected function getFileManager() - { - return $this->injections['fileManager']; - } - - protected function getAcl() - { - return $this->injections['acl']; - } - - protected function getMetadata() - { - return $this->injections['metadata']; - } - - protected function getServiceFactory() - { - return $this->injections['serviceFactory']; - } - - - protected function readCsvString(&$string, $CSV_SEPARATOR = ';', $CSV_ENCLOSURE = '"', $CSV_LINEBREAK = "\n") - { - $o = array(); - $cnt = strlen($string); - $esc = false; - $escesc = false; - $num = 0; - $i = 0; - while ($i < $cnt) { - $s = $string[$i]; - if ($s == $CSV_LINEBREAK) { - if ($esc) { - $o[$num].= $s; - } - else { - $i++; - break; - } - } - elseif ($s == $CSV_SEPARATOR) { - if ($esc) { - $o[$num].= $s; - } - else { - $num++; - $esc = false; - $escesc = false; - } - } - elseif ($s == $CSV_ENCLOSURE) { - if ($escesc) { - $o[$num].= $CSV_ENCLOSURE; - $escesc = false; - } +{ + protected $dependencies = array( + 'entityManager', + 'user', + 'metadata', + 'acl', + 'selectManagerFactory', + 'config', + 'serviceFactory', + 'fileManager', + ); + + protected $dateFormatsMap = array( + 'YYYY-MM-DD' => 'Y-m-d', + 'DD-MM-YYYY' => 'd-m-Y', + 'MM-DD-YYYY' => 'm-d-Y', + 'MM/DD/YYYY' => 'm/d/Y', + 'DD/MM/YYYY' => 'd/m/Y', + 'DD.MM.YYYY' => 'd.m.Y', + 'MM.DD.YYYY' => 'm.d.Y', + 'YYYY.MM.DD' => 'Y.m.d', + ); + + protected $timeFormatsMap = array( + 'HH:mm' => 'H:i', + 'hh:mm a' => 'h:i a', + 'hh:mma' => 'h:ia', + 'hh:mm A' => 'h:iA', + 'hh:mmA' => 'h:iA', + ); + + protected function getSelectManagerFactory() + { + return $this->injections['selectManagerFactory']; + } + + protected function getFileManager() + { + return $this->injections['fileManager']; + } + + protected function getAcl() + { + return $this->injections['acl']; + } + + protected function getMetadata() + { + return $this->injections['metadata']; + } + + protected function getServiceFactory() + { + return $this->injections['serviceFactory']; + } + + + protected function readCsvString(&$string, $CSV_SEPARATOR = ';', $CSV_ENCLOSURE = '"', $CSV_LINEBREAK = "\n") + { + $o = array(); + $cnt = strlen($string); + $esc = false; + $escesc = false; + $num = 0; + $i = 0; + while ($i < $cnt) { + $s = $string[$i]; + if ($s == $CSV_LINEBREAK) { + if ($esc) { + $o[$num].= $s; + } + else { + $i++; + break; + } + } + elseif ($s == $CSV_SEPARATOR) { + if ($esc) { + $o[$num].= $s; + } + else { + $num++; + $esc = false; + $escesc = false; + } + } + elseif ($s == $CSV_ENCLOSURE) { + if ($escesc) { + $o[$num].= $CSV_ENCLOSURE; + $escesc = false; + } - if ($esc) { - $esc = false; - $escesc = true; - } - else { - $esc = true; - $escesc = false; - } - } - else { - if ($escesc) { - $o[$num].= $CSV_ENCLOSURE; - $escesc = false; - } + if ($esc) { + $esc = false; + $escesc = true; + } + else { + $esc = true; + $escesc = false; + } + } + else { + if ($escesc) { + $o[$num].= $CSV_ENCLOSURE; + $escesc = false; + } - $o[$num].= $s; - } + $o[$num].= $s; + } - $i++; - } - $string = substr($string, $i); - return $o; - } - - public function revert($scope, array $idsToRemove) - { - $ids = array(); - if (!empty($scope) && !empty($idsToRemove)) { - foreach ($idsToRemove as $id) { - $entity = $this->getEntityManager()->getEntity($scope, $id); - if ($entity) { - if ($this->getEntityManager()->removeEntity($entity)) { - $ids[] = $id; - } - } - $this->getEntityManager()->getRepository($scope)->deleteFromDb($id); - } - } - return $ids; - } - - public function import($scope, array $fields, $attachmentId, array $params = array()) - { - $delimiter = ','; - if (!empty($params['fieldDelimiter'])) { - $delimiter = $params['fieldDelimiter']; - } - $enclosure = '"'; - if (!empty($params['textQualifier'])) { - $enclosure = $params['textQualifier']; - } - - $contents = $this->getFileManager()->getContents('data/upload/' . $attachmentId); - - if (empty($contents)) { - throw new Error('Import error'); - } - - $result = array( - 'importedIds' => array(), - 'updatedIds' => array(), - 'duplicateIds' => array(), - ); - $i = -1; - while ($arr = $this->readCsvString($contents, $delimiter, $enclosure)) { - $i++; - if ($i == 0 && !empty($params['headerRow'])) { - continue; - } - if (count($arr) == 1 && empty($arr[0])) { - continue; - } - $r = $this->importRow($scope, $fields, $arr, $params); - if (!empty($r['imported'])) { - $result['importedIds'][] = $r['id']; - } - if (!empty($r['updated'])) { - $result['updatedIds'][] = $r['id']; - } - if (!empty($r['duplicate'])) { - $result['duplicateIds'][] = $r['id']; - } - - } - return array( - 'countCreated' => count($result['importedIds']), - 'countUpdated' => count($result['updatedIds']), - 'importedIds' => $result['importedIds'], - 'duplicateIds' => $result['duplicateIds'], - ); - } - - public function importRow($scope, array $fields, array $row, array $params = array()) - { - // TODO create related records or related if exists, e.g. Account from accountName (skip users) - // Duplicate check - - $id = null; - if (!empty($params['action'])) { - if ($params['action'] == 'createAndUpdate' && in_array('id', $fields)) { - $i = array_search('id', $fields); - $id = $row[$i]; - if (empty($id)) { - $id = null; - } - } - } - - - $entity = $this->getEntityManager()->getEntity($scope, $id); - - $entity->set('assignedUserId', $this->getUser()->id); - - if (!empty($params['defaultValues'])) { - $entity->set(get_object_vars($params['defaultValues'])); - } - - $fieldsDefs = $entity->getFields(); - $relDefs = $entity->getRelations(); + $i++; + } + $string = substr($string, $i); + return $o; + } + + public function revert($scope, array $idsToRemove) + { + $ids = array(); + if (!empty($scope) && !empty($idsToRemove)) { + foreach ($idsToRemove as $id) { + $entity = $this->getEntityManager()->getEntity($scope, $id); + if ($entity) { + if ($this->getEntityManager()->removeEntity($entity)) { + $ids[] = $id; + } + } + $this->getEntityManager()->getRepository($scope)->deleteFromDb($id); + } + } + return $ids; + } + + public function import($scope, array $fields, $attachmentId, array $params = array()) + { + $delimiter = ','; + if (!empty($params['fieldDelimiter'])) { + $delimiter = $params['fieldDelimiter']; + } + $enclosure = '"'; + if (!empty($params['textQualifier'])) { + $enclosure = $params['textQualifier']; + } + + $contents = $this->getFileManager()->getContents('data/upload/' . $attachmentId); + + if (empty($contents)) { + throw new Error('Import error'); + } + + $result = array( + 'importedIds' => array(), + 'updatedIds' => array(), + 'duplicateIds' => array(), + ); + $i = -1; + while ($arr = $this->readCsvString($contents, $delimiter, $enclosure)) { + $i++; + if ($i == 0 && !empty($params['headerRow'])) { + continue; + } + if (count($arr) == 1 && empty($arr[0])) { + continue; + } + $r = $this->importRow($scope, $fields, $arr, $params); + if (!empty($r['imported'])) { + $result['importedIds'][] = $r['id']; + } + if (!empty($r['updated'])) { + $result['updatedIds'][] = $r['id']; + } + if (!empty($r['duplicate'])) { + $result['duplicateIds'][] = $r['id']; + } + + } + return array( + 'countCreated' => count($result['importedIds']), + 'countUpdated' => count($result['updatedIds']), + 'importedIds' => $result['importedIds'], + 'duplicateIds' => $result['duplicateIds'], + ); + } + + public function importRow($scope, array $fields, array $row, array $params = array()) + { + // TODO create related records or related if exists, e.g. Account from accountName (skip users) + // Duplicate check + + $id = null; + if (!empty($params['action'])) { + if ($params['action'] == 'createAndUpdate' && in_array('id', $fields)) { + $i = array_search('id', $fields); + $id = $row[$i]; + if (empty($id)) { + $id = null; + } + } + } + + + $entity = $this->getEntityManager()->getEntity($scope, $id); + + $entity->set('assignedUserId', $this->getUser()->id); + + if (!empty($params['defaultValues'])) { + $entity->set(get_object_vars($params['defaultValues'])); + } + + $fieldsDefs = $entity->getFields(); + $relDefs = $entity->getRelations(); - foreach ($fields as $i => $field) { - if (!empty($field)) { - $value = $row[$i]; - if ($field == 'id') { - if ($params['action'] == 'create') { - $entity->id = $value; - } - continue; - } - if (array_key_exists($field, $fieldsDefs)) { - if ($value !== '') { - $type = $this->getMetadata()->get("entityDefs.{$scope}.fields.{$field}.type"); - if ($type == 'personName') { - $lastNameField = 'last' . ucfirst($field); - $firstNameField = 'first' . ucfirst($field); - - $firstName = ''; - $lastName = $value; - switch ($params['personNameFormat']) { + foreach ($fields as $i => $field) { + if (!empty($field)) { + $value = $row[$i]; + if ($field == 'id') { + if ($params['action'] == 'create') { + $entity->id = $value; + } + continue; + } + if (array_key_exists($field, $fieldsDefs)) { + if ($value !== '') { + $type = $this->getMetadata()->get("entityDefs.{$scope}.fields.{$field}.type"); + if ($type == 'personName') { + $lastNameField = 'last' . ucfirst($field); + $firstNameField = 'first' . ucfirst($field); + + $firstName = ''; + $lastName = $value; + switch ($params['personNameFormat']) { - case 'f l': - $pos = strpos($value, ' '); - if ($pos) { - $firstName = trim(substr($value, 0, $pos)); - $lastName = trim(substr($value, $pos + 1)); - } - break; - case 'l f': - $pos = strpos($value, ' '); - if ($pos) { - $lastName = trim(substr($value, 0, $pos)); - $firstName = trim(substr($value, $pos + 1)); - } - break; - case 'l, f': - $pos = strpos($value, ','); - if ($pos) { - $lastName = trim(substr($value, 0, $pos)); - $firstName = trim(substr($value, $pos + 1)); - } - break; - } - - if (!$entity->get($firstNameField)) { - $entity->set($firstNameField, $firstName); - } - if (!$entity->get($lastNameField)) { - $entity->set($lastNameField, $lastName); - } - continue; - } - $entity->set($field, $this->parseValue($entity, $field, $value, $params)); - } - } - } - } - - - - foreach ($fields as $i => $field) { - if (array_key_exists($field, $fieldsDefs) && $fieldsDefs[$field]['type'] == Entity::FOREIGN) { - if ($entity->has($field)) { - $relation = $fieldsDefs[$field]['relation']; - if ($field == $relation . 'Name' && !$entity->has($relation . 'Id') && array_key_exists($relation, $relDefs)) { - if ($relDefs[$relation]['type'] == Entity::BELONGS_TO) { - $name = $entity->get($field); - $scope = $relDefs[$relation]['entity']; - $found = $this->getEntityManager()->getRepository($scope)->where(array('name' => $name))->findOne(); - - if ($found) { - $entity->set($relation . 'Id', $found->id); - } else { - if (!in_array($scope, 'User', 'Team')) { - - // TODO create related record with name $name and relate - } - } - } - } - } - } - - } + case 'f l': + $pos = strpos($value, ' '); + if ($pos) { + $firstName = trim(substr($value, 0, $pos)); + $lastName = trim(substr($value, $pos + 1)); + } + break; + case 'l f': + $pos = strpos($value, ' '); + if ($pos) { + $lastName = trim(substr($value, 0, $pos)); + $firstName = trim(substr($value, $pos + 1)); + } + break; + case 'l, f': + $pos = strpos($value, ','); + if ($pos) { + $lastName = trim(substr($value, 0, $pos)); + $firstName = trim(substr($value, $pos + 1)); + } + break; + } + + if (!$entity->get($firstNameField)) { + $entity->set($firstNameField, $firstName); + } + if (!$entity->get($lastNameField)) { + $entity->set($lastNameField, $lastName); + } + continue; + } + $entity->set($field, $this->parseValue($entity, $field, $value, $params)); + } + } + } + } + + + + foreach ($fields as $i => $field) { + if (array_key_exists($field, $fieldsDefs) && $fieldsDefs[$field]['type'] == Entity::FOREIGN) { + if ($entity->has($field)) { + $relation = $fieldsDefs[$field]['relation']; + if ($field == $relation . 'Name' && !$entity->has($relation . 'Id') && array_key_exists($relation, $relDefs)) { + if ($relDefs[$relation]['type'] == Entity::BELONGS_TO) { + $name = $entity->get($field); + $scope = $relDefs[$relation]['entity']; + $found = $this->getEntityManager()->getRepository($scope)->where(array('name' => $name))->findOne(); + + if ($found) { + $entity->set($relation . 'Id', $found->id); + } else { + if (!in_array($scope, 'User', 'Team')) { + + // TODO create related record with name $name and relate + } + } + } + } + } + } + + } - $result = array(); - - $a = $entity->toArray(); - - try { - if ($this->getEntityManager()->saveEntity($entity)) { - $result['id'] = $entity->id; - if (empty($id)) { - $result['imported'] = true; - } else { - $result['updated'] = true; - } - } - } catch (\Exception $e) {} - - return $result; - } - - protected function parseValue(Entity $entity, $field, $value, $params = array()) - { - $decimalMark = '.'; - if (!empty($params['decimalMark'])) { - $decimalMark = $params['decimalMark']; - } - - $defaultCurrency = 'USD'; - if (!empty($params['defaultCurrency'])) { - $dateFormat = $params['defaultCurrency']; - } - - $dateFormat = 'Y-m-d'; - if (!empty($params['dateFormat'])) { - $dateFormat = $params['dateFormat']; - } - - $timeFormat = 'H:i'; - if (!empty($params['timeFormat'])) { - $timeFormat = $params['timeFormat']; - } - - $fieldDefs = $entity->getFields(); - - if (!empty($fieldDefs[$field])) { - $type = $fieldDefs[$field]['type']; - - switch ($type) { - case Entity::DATE: - $dt = \DateTime::createFromFormat($dateFormat, $value); - if ($dt) { - return $dt->format('Y-m-d'); - } - break; - case Entity::DATETIME: - $dt = \DateTime::createFromFormat($dateFormat . ' ' . $timeFormat, $value); - if ($dt) { - return $dt->format('Y-m-d H:i'); - } - break; - case Entity::FLOAT: - $currencyField = $field . 'Currency'; - if ($entity->hasField($currencyField)) { - if (!$entity->has($currencyField)) { - $entity->set($currencyField, $defaultCurrency); - } - } - - $a = explode($decimalMark, $value); - $a[0] = preg_replace('/[^A-Za-z0-9\-]/', '', $a[0]); - - if (count($a) > 1) { - return $a[0] . '.' . $a[1]; - } else { - return $a[0]; - } - break; - } - - } - return $value; - } + $result = array(); + + $a = $entity->toArray(); + + try { + if ($this->getEntityManager()->saveEntity($entity)) { + $result['id'] = $entity->id; + if (empty($id)) { + $result['imported'] = true; + } else { + $result['updated'] = true; + } + } + } catch (\Exception $e) {} + + return $result; + } + + protected function parseValue(Entity $entity, $field, $value, $params = array()) + { + $decimalMark = '.'; + if (!empty($params['decimalMark'])) { + $decimalMark = $params['decimalMark']; + } + + $defaultCurrency = 'USD'; + if (!empty($params['defaultCurrency'])) { + $dateFormat = $params['defaultCurrency']; + } + + $dateFormat = 'Y-m-d'; + if (!empty($params['dateFormat'])) { + $dateFormat = $params['dateFormat']; + } + + $timeFormat = 'H:i'; + if (!empty($params['timeFormat'])) { + $timeFormat = $params['timeFormat']; + } + + $fieldDefs = $entity->getFields(); + + if (!empty($fieldDefs[$field])) { + $type = $fieldDefs[$field]['type']; + + switch ($type) { + case Entity::DATE: + $dt = \DateTime::createFromFormat($dateFormat, $value); + if ($dt) { + return $dt->format('Y-m-d'); + } + break; + case Entity::DATETIME: + $dt = \DateTime::createFromFormat($dateFormat . ' ' . $timeFormat, $value); + if ($dt) { + return $dt->format('Y-m-d H:i'); + } + break; + case Entity::FLOAT: + $currencyField = $field . 'Currency'; + if ($entity->hasField($currencyField)) { + if (!$entity->has($currencyField)) { + $entity->set($currencyField, $defaultCurrency); + } + } + + $a = explode($decimalMark, $value); + $a[0] = preg_replace('/[^A-Za-z0-9\-]/', '', $a[0]); + + if (count($a) > 1) { + return $a[0] . '.' . $a[1]; + } else { + return $a[0]; + } + break; + } + + } + return $value; + } } diff --git a/application/Espo/Services/Job.php b/application/Espo/Services/Job.php index bb15b5bc64..dff54a12f5 100644 --- a/application/Espo/Services/Job.php +++ b/application/Espo/Services/Job.php @@ -27,125 +27,125 @@ use \Espo\Core\CronManager; class Job extends Record { - public function getPendingJobs() - { - /** Mark Failed old jobs and remove pending duplicates */ - $this->markFailedJobs(); - $this->removePendingJobDuplicates(); + public function getPendingJobs() + { + /** Mark Failed old jobs and remove pending duplicates */ + $this->markFailedJobs(); + $this->removePendingJobDuplicates(); - $jobList = $this->getActiveJobs(); + $jobList = $this->getActiveJobs(); - $runningScheduledJobs = $this->getActiveJobs('scheduled_job_id', CronManager::RUNNING, PDO::FETCH_COLUMN); + $runningScheduledJobs = $this->getActiveJobs('scheduled_job_id', CronManager::RUNNING, PDO::FETCH_COLUMN); - $list = array(); - foreach ($jobList as $row) { - if (!in_array($row['scheduled_job_id'], $runningScheduledJobs)) { - $list[] = $row; - } - } + $list = array(); + foreach ($jobList as $row) { + if (!in_array($row['scheduled_job_id'], $runningScheduledJobs)) { + $list[] = $row; + } + } - return $list; - } + return $list; + } - /** - * Get active Jobs, which execution date in jobPeriod time - * - * @param string $displayColumns - * @param string $status - * @return array - */ - protected function getActiveJobs($displayColumns = '*', $status = CronManager::PENDING, $fetchMode = PDO::FETCH_ASSOC) - { - $jobConfigs = $this->getConfig()->get('cron'); + /** + * Get active Jobs, which execution date in jobPeriod time + * + * @param string $displayColumns + * @param string $status + * @return array + */ + protected function getActiveJobs($displayColumns = '*', $status = CronManager::PENDING, $fetchMode = PDO::FETCH_ASSOC) + { + $jobConfigs = $this->getConfig()->get('cron'); - $currentTime = time(); - $periodTime = $currentTime - intval($jobConfigs['jobPeriod']); - $limit = empty($jobConfigs['maxJobNumber']) ? '' : 'LIMIT '.$jobConfigs['maxJobNumber']; + $currentTime = time(); + $periodTime = $currentTime - intval($jobConfigs['jobPeriod']); + $limit = empty($jobConfigs['maxJobNumber']) ? '' : 'LIMIT '.$jobConfigs['maxJobNumber']; - $query = "SELECT " . $displayColumns . " FROM job WHERE - `status` = '" . $status . "' - AND execute_time BETWEEN '".date('Y-m-d H:i:s', $periodTime)."' AND '".date('Y-m-d H:i:s', $currentTime)."' - AND deleted = 0 - ORDER BY execute_time DESC ".$limit; + $query = "SELECT " . $displayColumns . " FROM job WHERE + `status` = '" . $status . "' + AND execute_time BETWEEN '".date('Y-m-d H:i:s', $periodTime)."' AND '".date('Y-m-d H:i:s', $currentTime)."' + AND deleted = 0 + ORDER BY execute_time DESC ".$limit; - $pdo = $this->getEntityManager()->getPDO(); - $sth = $pdo->prepare($query); - $sth->execute(); + $pdo = $this->getEntityManager()->getPDO(); + $sth = $pdo->prepare($query); + $sth->execute(); - $rows = $sth->fetchAll($fetchMode); + $rows = $sth->fetchAll($fetchMode); - return $rows; - } + return $rows; + } - public function getJobByScheduledJob($scheduledJobId, $date) - { - $query = "SELECT * FROM job WHERE - scheduled_job_id = '".$scheduledJobId."' - AND execute_time = '".$date."' - AND deleted = 0 - LIMIT 1"; + public function getJobByScheduledJob($scheduledJobId, $date) + { + $query = "SELECT * FROM job WHERE + scheduled_job_id = '".$scheduledJobId."' + AND execute_time = '".$date."' + AND deleted = 0 + LIMIT 1"; - $pdo = $this->getEntityManager()->getPDO(); - $sth = $pdo->prepare($query); - $sth->execute(); + $pdo = $this->getEntityManager()->getPDO(); + $sth = $pdo->prepare($query); + $sth->execute(); - $scheduledJob = $sth->fetchAll(PDO::FETCH_ASSOC); + $scheduledJob = $sth->fetchAll(PDO::FETCH_ASSOC); - return $scheduledJob; - } + return $scheduledJob; + } - /** - * Mark pending jobs (all jobs that exceeded jobPeriod) - * - * @return void - */ - protected function markFailedJobs() - { - $jobConfigs = $this->getConfig()->get('cron'); + /** + * Mark pending jobs (all jobs that exceeded jobPeriod) + * + * @return void + */ + protected function markFailedJobs() + { + $jobConfigs = $this->getConfig()->get('cron'); - $currentTime = time(); - $periodTime = $currentTime - intval($jobConfigs['jobPeriod']); + $currentTime = time(); + $periodTime = $currentTime - intval($jobConfigs['jobPeriod']); - $update = "UPDATE job SET `status` = '" . CronManager::FAILED ."' WHERE - (`status` = '" . CronManager::PENDING ."' OR `status` = '" . CronManager::RUNNING ."') - AND execute_time < '".date('Y-m-d H:i:s', $periodTime)."' "; + $update = "UPDATE job SET `status` = '" . CronManager::FAILED ."' WHERE + (`status` = '" . CronManager::PENDING ."' OR `status` = '" . CronManager::RUNNING ."') + AND execute_time < '".date('Y-m-d H:i:s', $periodTime)."' "; - $pdo = $this->getEntityManager()->getPDO(); - $sth = $pdo->prepare($update); - $sth->execute(); - } + $pdo = $this->getEntityManager()->getPDO(); + $sth = $pdo->prepare($update); + $sth->execute(); + } - /** - * Remove pending duplicate jobs, no need to run twice the same job - * - * @return void - */ - protected function removePendingJobDuplicates() - { - $duplicateJobs = $this->getActiveJobs('DISTINCT scheduled_job_id'); + /** + * Remove pending duplicate jobs, no need to run twice the same job + * + * @return void + */ + protected function removePendingJobDuplicates() + { + $duplicateJobs = $this->getActiveJobs('DISTINCT scheduled_job_id'); - $pdo = $this->getEntityManager()->getPDO(); + $pdo = $this->getEntityManager()->getPDO(); - foreach ($duplicateJobs as $row) { - if (!empty($row['scheduled_job_id'])) { + foreach ($duplicateJobs as $row) { + if (!empty($row['scheduled_job_id'])) { - /* no possibility to use limit in update or subqueries */ - $query = "SELECT id FROM `job` WHERE scheduled_job_id = '" . $row['scheduled_job_id'] . "' - AND `status` = '" . CronManager::PENDING ."' - ORDER BY execute_time - DESC LIMIT 1, 100000 "; - $sth = $pdo->prepare($query); - $sth->execute(); - $jobIds = $sth->fetchAll(PDO::FETCH_COLUMN); + /* no possibility to use limit in update or subqueries */ + $query = "SELECT id FROM `job` WHERE scheduled_job_id = '" . $row['scheduled_job_id'] . "' + AND `status` = '" . CronManager::PENDING ."' + ORDER BY execute_time + DESC LIMIT 1, 100000 "; + $sth = $pdo->prepare($query); + $sth->execute(); + $jobIds = $sth->fetchAll(PDO::FETCH_COLUMN); - $update = "UPDATE job SET deleted = 1 WHERE - id IN ('". implode("', '", $jobIds)."') "; + $update = "UPDATE job SET deleted = 1 WHERE + id IN ('". implode("', '", $jobIds)."') "; - $sth = $pdo->prepare($update); - $sth->execute(); - } - } - } + $sth = $pdo->prepare($update); + $sth->execute(); + } + } + } } diff --git a/application/Espo/Services/Note.php b/application/Espo/Services/Note.php index bcae8b4dd4..b39fcfbb1d 100644 --- a/application/Espo/Services/Note.php +++ b/application/Espo/Services/Note.php @@ -28,30 +28,30 @@ use \Espo\Core\Exceptions\NotFound; use Espo\ORM\Entity; class Note extends Record -{ - public function getEntity($id = null) - { - $entity = parent::getEntity($id); - if (!empty($id)) { - $entity->loadAttachments(); - } - return $entity; - } - - public function createEntity($data) - { - if (!empty($data['parentType']) && !empty($data['parentId'])) { - $entity = $this->getEntityManager()->getEntity($data['parentType'], $data['parentId']); - if ($entity) { - if (!$this->getAcl()->check($entity, 'read')) { - throw new Forbidden(); - } - } - } - - - return parent::createEntity($data); - } +{ + public function getEntity($id = null) + { + $entity = parent::getEntity($id); + if (!empty($id)) { + $entity->loadAttachments(); + } + return $entity; + } + + public function createEntity($data) + { + if (!empty($data['parentType']) && !empty($data['parentId'])) { + $entity = $this->getEntityManager()->getEntity($data['parentType'], $data['parentId']); + if ($entity) { + if (!$this->getAcl()->check($entity, 'read')) { + throw new Forbidden(); + } + } + } + + + return parent::createEntity($data); + } } diff --git a/application/Espo/Services/Notification.php b/application/Espo/Services/Notification.php index 2a1394a0af..07bde19f4e 100644 --- a/application/Espo/Services/Notification.php +++ b/application/Espo/Services/Notification.php @@ -28,140 +28,140 @@ use \Espo\Core\Exceptions\NotFound; use Espo\ORM\Entity; class Notification extends \Espo\Core\Services\Base -{ - protected $dependencies = array( - 'entityManager', - 'user', - 'metadata', - ); +{ + protected $dependencies = array( + 'entityManager', + 'user', + 'metadata', + ); - protected function getEntityManager() - { - return $this->injections['entityManager']; - } + protected function getEntityManager() + { + return $this->injections['entityManager']; + } - protected function getUser() - { - return $this->injections['user']; - } - - protected function getMetadata() - { - return $this->injections['metadata']; - } - - public function notifyAboutMentionInPost($userId, $noteId) - { - $notification = $this->getEntityManager()->getEntity('Notification'); - $notification->set(array( - 'type' => 'MentionInPost', - 'data' => array('noteId' => $noteId), - 'userId' => $userId - )); - $this->getEntityManager()->saveEntity($notification); - } - - public function notifyAboutNote($userId, $noteId) - { - $notification = $this->getEntityManager()->getEntity('Notification'); - $notification->set(array( - 'type' => 'Note', - 'data' => array('noteId' => $noteId), - 'userId' => $userId - )); - $this->getEntityManager()->saveEntity($notification); - } - - public function notifyAboutNoteFromJob($data) - { - $userIdList = $data['userIdList']; - $noteId = $data['noteId']; - - foreach ($userIdList as $userId) { - $this->notifyAboutNote($userId, $noteId); - } - return true; - } - - public function getNotReadCount($userId) - { - $searchParams = array(); - $searchParams['whereClause'] = array( - 'userId' => $userId - ); - return $this->getEntityManager()->getRepository('Notification')->where(array( - 'userId' => $userId, - 'read' => 0, - ))->count(); - } - - public function markAllRead($userId) - { - $pdo = $this->getEntityManager()->getPDO(); - $sql = "UPDATE notification SET `read` = 1 WHERE user_id = ".$pdo->quote($userId)." AND `read` = 0"; - $pdo->prepare($sql)->execute(); - return true; - } - - public function getList($userId, array $params = array()) - { - $searchParams = array(); - $searchParams['whereClause'] = array( - 'userId' => $userId - ); - if (array_key_exists('offset', $params)) { - $searchParams['offset'] = $params['offset']; - } - if (array_key_exists('maxSize', $params)) { - $searchParams['limit'] = $params['maxSize']; - } - $searchParams['orderBy'] = 'createdAt'; - $searchParams['order'] = 'DESC'; - - $collection = $this->getEntityManager()->getRepository('Notification')->find($searchParams); - $count = $this->getEntityManager()->getRepository('Notification')->count($searchParams); - - $ids = array(); - foreach ($collection as $k => $entity) { - $ids[] = $entity->id; - $data = $entity->get('data'); - if (empty($data)) { - continue; - } - switch ($entity->get('type')) { - case 'Note': - case 'MentionInPost': - $note = $this->getEntityManager()->getEntity('Note', $data->noteId); - if ($note) { - if ($note->get('parentId') && $note->get('parentType')) { - $parent = $this->getEntityManager()->getEntity($note->get('parentType'), $note->get('parentId')); - if ($parent) { - $note->set('parentName', $parent->get('name')); - } - } - $entity->set('noteData', $note->toArray()); - } else { - unset($collection[$k]); - $count--; - $this->getEntityManager()->removeEntity($entity); - } - break; - } - } - - if (!empty($ids)) { - $pdo = $this->getEntityManager()->getPDO(); - $sql = "UPDATE notification SET `read` = 1 WHERE id IN ('" . implode("', '", $ids) ."')"; + protected function getUser() + { + return $this->injections['user']; + } + + protected function getMetadata() + { + return $this->injections['metadata']; + } + + public function notifyAboutMentionInPost($userId, $noteId) + { + $notification = $this->getEntityManager()->getEntity('Notification'); + $notification->set(array( + 'type' => 'MentionInPost', + 'data' => array('noteId' => $noteId), + 'userId' => $userId + )); + $this->getEntityManager()->saveEntity($notification); + } + + public function notifyAboutNote($userId, $noteId) + { + $notification = $this->getEntityManager()->getEntity('Notification'); + $notification->set(array( + 'type' => 'Note', + 'data' => array('noteId' => $noteId), + 'userId' => $userId + )); + $this->getEntityManager()->saveEntity($notification); + } + + public function notifyAboutNoteFromJob($data) + { + $userIdList = $data['userIdList']; + $noteId = $data['noteId']; + + foreach ($userIdList as $userId) { + $this->notifyAboutNote($userId, $noteId); + } + return true; + } + + public function getNotReadCount($userId) + { + $searchParams = array(); + $searchParams['whereClause'] = array( + 'userId' => $userId + ); + return $this->getEntityManager()->getRepository('Notification')->where(array( + 'userId' => $userId, + 'read' => 0, + ))->count(); + } + + public function markAllRead($userId) + { + $pdo = $this->getEntityManager()->getPDO(); + $sql = "UPDATE notification SET `read` = 1 WHERE user_id = ".$pdo->quote($userId)." AND `read` = 0"; + $pdo->prepare($sql)->execute(); + return true; + } + + public function getList($userId, array $params = array()) + { + $searchParams = array(); + $searchParams['whereClause'] = array( + 'userId' => $userId + ); + if (array_key_exists('offset', $params)) { + $searchParams['offset'] = $params['offset']; + } + if (array_key_exists('maxSize', $params)) { + $searchParams['limit'] = $params['maxSize']; + } + $searchParams['orderBy'] = 'createdAt'; + $searchParams['order'] = 'DESC'; + + $collection = $this->getEntityManager()->getRepository('Notification')->find($searchParams); + $count = $this->getEntityManager()->getRepository('Notification')->count($searchParams); + + $ids = array(); + foreach ($collection as $k => $entity) { + $ids[] = $entity->id; + $data = $entity->get('data'); + if (empty($data)) { + continue; + } + switch ($entity->get('type')) { + case 'Note': + case 'MentionInPost': + $note = $this->getEntityManager()->getEntity('Note', $data->noteId); + if ($note) { + if ($note->get('parentId') && $note->get('parentType')) { + $parent = $this->getEntityManager()->getEntity($note->get('parentType'), $note->get('parentId')); + if ($parent) { + $note->set('parentName', $parent->get('name')); + } + } + $entity->set('noteData', $note->toArray()); + } else { + unset($collection[$k]); + $count--; + $this->getEntityManager()->removeEntity($entity); + } + break; + } + } + + if (!empty($ids)) { + $pdo = $this->getEntityManager()->getPDO(); + $sql = "UPDATE notification SET `read` = 1 WHERE id IN ('" . implode("', '", $ids) ."')"; - $s = $pdo->prepare($sql); - $s->execute(); - } - - - return array( - 'total' => $count, - 'collection' => $collection - ); - } + $s = $pdo->prepare($sql); + $s->execute(); + } + + + return array( + 'total' => $count, + 'collection' => $collection + ); + } } diff --git a/application/Espo/Services/Record.php b/application/Espo/Services/Record.php index 98005f4afd..a0cbf80aa0 100644 --- a/application/Espo/Services/Record.php +++ b/application/Espo/Services/Record.php @@ -33,600 +33,600 @@ use \Espo\Core\Utils\Util; class Record extends \Espo\Core\Services\Base { - protected $dependencies = array( - 'entityManager', - 'user', - 'metadata', - 'acl', - 'config', - 'serviceFactory', - 'fileManager', - 'selectManagerFactory', - 'preferences' - ); - - protected $entityName; - - private $streamService; - - protected $notFilteringFields = array(); // TODO maybe remove it - - protected $internalFields = array(); - - protected $readOnlyFields = array(); - - protected $linkSelectParams = array(); - - public function __construct() - { - parent::__construct(); - if (empty($this->entityName)) { - $name = get_class($this); - if (preg_match('@\\\\([\w]+)$@', $name, $matches)) { - $name = $matches[1]; - } - if ($name != 'Record') { - $this->entityName = $name; - } - } - } + protected $dependencies = array( + 'entityManager', + 'user', + 'metadata', + 'acl', + 'config', + 'serviceFactory', + 'fileManager', + 'selectManagerFactory', + 'preferences' + ); + + protected $entityName; + + private $streamService; + + protected $notFilteringFields = array(); // TODO maybe remove it + + protected $internalFields = array(); + + protected $readOnlyFields = array(); + + protected $linkSelectParams = array(); + + public function __construct() + { + parent::__construct(); + if (empty($this->entityName)) { + $name = get_class($this); + if (preg_match('@\\\\([\w]+)$@', $name, $matches)) { + $name = $matches[1]; + } + if ($name != 'Record') { + $this->entityName = $name; + } + } + } - public function setEntityName($entityName) - { - $this->entityName = $entityName; - } - - protected function getServiceFactory() - { - return $this->injections['serviceFactory']; - } - - protected function getSelectManagerFactory() - { - return $this->injections['selectManagerFactory']; - } - - protected function getAcl() - { - return $this->injections['acl']; - } - - protected function getFileManager() - { - return $this->injections['fileManager']; - } - - protected function getPreferences() - { - return $this->injections['preferences']; - } - - protected function getMetadata() - { - return $this->injections['metadata']; - } - - protected function getRepository() - { - return $this->getEntityManager()->getRepository($this->entityName); - } - - protected function getRecordService($name) - { - if ($this->getServiceFactory()->checkExists($name)) { - $service = $this->getServiceFactory()->create($name); - } else { - $service = $this->getServiceFactory()->create('Record'); - $service->setEntityName($name); - } - - return $service; - } - - protected function prepareEntity($entity) - { - - } + public function setEntityName($entityName) + { + $this->entityName = $entityName; + } + + protected function getServiceFactory() + { + return $this->injections['serviceFactory']; + } + + protected function getSelectManagerFactory() + { + return $this->injections['selectManagerFactory']; + } + + protected function getAcl() + { + return $this->injections['acl']; + } + + protected function getFileManager() + { + return $this->injections['fileManager']; + } + + protected function getPreferences() + { + return $this->injections['preferences']; + } + + protected function getMetadata() + { + return $this->injections['metadata']; + } + + protected function getRepository() + { + return $this->getEntityManager()->getRepository($this->entityName); + } + + protected function getRecordService($name) + { + if ($this->getServiceFactory()->checkExists($name)) { + $service = $this->getServiceFactory()->create($name); + } else { + $service = $this->getServiceFactory()->create('Record'); + $service->setEntityName($name); + } + + return $service; + } + + protected function prepareEntity($entity) + { + + } - public function getEntity($id = null) - { - $entity = $this->getRepository()->get($id); - if (!empty($entity) && !empty($id)) { - $this->loadAdditionalFields($entity); - - if ($entity->getEntityName() == 'Opportunity') { - $contactsColumns = $entity->get('contactsColumns'); - } - - if (!$this->getAcl()->check($entity, 'read')) { - throw new Forbidden(); - } - } - if (!empty($entity)) { - $this->prepareEntityForOutput($entity); - } - return $entity; - } - + public function getEntity($id = null) + { + $entity = $this->getRepository()->get($id); + if (!empty($entity) && !empty($id)) { + $this->loadAdditionalFields($entity); + + if ($entity->getEntityName() == 'Opportunity') { + $contactsColumns = $entity->get('contactsColumns'); + } + + if (!$this->getAcl()->check($entity, 'read')) { + throw new Forbidden(); + } + } + if (!empty($entity)) { + $this->prepareEntityForOutput($entity); + } + return $entity; + } + protected function getStreamService() { - if (empty($this->streamService)) { - $this->streamService = $this->getServiceFactory()->create('Stream'); - } - return $this->streamService; + if (empty($this->streamService)) { + $this->streamService = $this->getServiceFactory()->create('Stream'); + } + return $this->streamService; + } + + protected function loadIsFollowed(Entity $entity) + { + if ($this->getStreamService()->checkIsFollowed($entity)) { + $entity->set('isFollowed', true); + } else { + $entity->set('isFollowed', false); + } + } + + protected function loadLinkMultipleFields(Entity $entity) + { + $fieldDefs = $this->getMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields', array()); + foreach ($fieldDefs as $field => $defs) { + if (isset($defs['type']) && $defs['type'] == 'linkMultiple') { + $columns = null; + if (!empty($defs['columns'])) { + $columns = $defs['columns']; + } + $entity->loadLinkMultipleField($field, $columns); + } + } + } + + protected function loadParentNameFields(Entity $entity) + { + $fieldDefs = $this->getMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields', array()); + foreach ($fieldDefs as $field => $defs) { + if (isset($defs['type']) && $defs['type'] == 'linkParent') { + $id = $entity->get($field . 'Id'); + $scope = $entity->get($field . 'Type'); + + if ($scope) { + if ($foreignEntity = $this->getEntityManager()->getEntity($scope, $id)) { + $entity->set($field . 'Name', $foreignEntity->get('name')); + } + } + } + } + } + + protected function loadAdditionalFields($entity) + { + $this->loadLinkMultipleFields($entity); + $this->loadParentNameFields($entity); + $this->loadIsFollowed($entity); + $this->loadEmailAddressField($entity); + $this->loadPhoneNumberField($entity); + } + + protected function loadEmailAddressField(Entity $entity) + { + $fieldDefs = $this->getMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields', array()); + if (!empty($fieldDefs['emailAddress']) && $fieldDefs['emailAddress']['type'] == 'email') { + $dataFieldName = 'emailAddressData'; + $entity->set($dataFieldName, $this->getEntityManager()->getRepository('EmailAddress')->getEmailAddressData($entity)); + } + } + + protected function loadPhoneNumberField(Entity $entity) + { + $fieldDefs = $this->getMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields', array()); + if (!empty($fieldDefs['phoneNumber']) && $fieldDefs['phoneNumber']['type'] == 'phone') { + $dataFieldName = 'phoneNumberData'; + $entity->set($dataFieldName, $this->getEntityManager()->getRepository('PhoneNumber')->getPhoneNumberData($entity)); + } + } + + protected function getSelectManager($entityName) + { + return $this->getSelectManagerFactory()->create($entityName); + } + + protected function storeEntity(Entity $entity) + { + return $this->getRepository()->save($entity); + } + + protected function isValid($entity) + { + $fieldDefs = $entity->getFields(); + if ($entity->hasField('name') && !empty($fieldDefs['name']['required'])) { + if (!$entity->get('name')) { + return false; + } + } + return true; + } + + protected function stripTags($string) + { + return strip_tags($string, '


'); + } + + protected function filterInputField($field, $value) + { + if (in_array($field, $this->notFilteringFields)) { + return $value; + } + $methodName = 'filterInputField' . ucfirst($field); + if (method_exists($this, $methodName)) { + $value = $this->$methodName($value); + } + return $value; + } + + protected function filterInput(&$data) + { + foreach ($this->readOnlyFields as $field) { + unset($data[$field]); + } + + foreach ($data as $key => $value) { + if (is_array($data[$key])) { + foreach ($data[$key] as $i => $v) { + $data[$key][$i] = $this->filterInputField($i, $data[$key][$i]); + } + } else if ($data[$key] instanceof \stdClass) { + $propertyList = get_object_vars($data[$key]); + foreach ($propertyList as $property => $value) { + $data[$key]->$property = $this->filterInputField($property, $data[$key]->$property); + } + } else { + $data[$key] = $this->filterInputField($key, $data[$key]); + } + } + } + + protected function handleInput(&$data) + { + } - - protected function loadIsFollowed(Entity $entity) - { - if ($this->getStreamService()->checkIsFollowed($entity)) { - $entity->set('isFollowed', true); - } else { - $entity->set('isFollowed', false); - } - } - - protected function loadLinkMultipleFields(Entity $entity) - { - $fieldDefs = $this->getMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields', array()); - foreach ($fieldDefs as $field => $defs) { - if (isset($defs['type']) && $defs['type'] == 'linkMultiple') { - $columns = null; - if (!empty($defs['columns'])) { - $columns = $defs['columns']; - } - $entity->loadLinkMultipleField($field, $columns); - } - } - } - - protected function loadParentNameFields(Entity $entity) - { - $fieldDefs = $this->getMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields', array()); - foreach ($fieldDefs as $field => $defs) { - if (isset($defs['type']) && $defs['type'] == 'linkParent') { - $id = $entity->get($field . 'Id'); - $scope = $entity->get($field . 'Type'); - - if ($scope) { - if ($foreignEntity = $this->getEntityManager()->getEntity($scope, $id)) { - $entity->set($field . 'Name', $foreignEntity->get('name')); - } - } - } - } - } - - protected function loadAdditionalFields($entity) - { - $this->loadLinkMultipleFields($entity); - $this->loadParentNameFields($entity); - $this->loadIsFollowed($entity); - $this->loadEmailAddressField($entity); - $this->loadPhoneNumberField($entity); - } - - protected function loadEmailAddressField(Entity $entity) - { - $fieldDefs = $this->getMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields', array()); - if (!empty($fieldDefs['emailAddress']) && $fieldDefs['emailAddress']['type'] == 'email') { - $dataFieldName = 'emailAddressData'; - $entity->set($dataFieldName, $this->getEntityManager()->getRepository('EmailAddress')->getEmailAddressData($entity)); - } - } - - protected function loadPhoneNumberField(Entity $entity) - { - $fieldDefs = $this->getMetadata()->get('entityDefs.' . $entity->getEntityName() . '.fields', array()); - if (!empty($fieldDefs['phoneNumber']) && $fieldDefs['phoneNumber']['type'] == 'phone') { - $dataFieldName = 'phoneNumberData'; - $entity->set($dataFieldName, $this->getEntityManager()->getRepository('PhoneNumber')->getPhoneNumberData($entity)); - } - } - - protected function getSelectManager($entityName) - { - return $this->getSelectManagerFactory()->create($entityName); - } - - protected function storeEntity(Entity $entity) - { - return $this->getRepository()->save($entity); - } - - protected function isValid($entity) - { - $fieldDefs = $entity->getFields(); - if ($entity->hasField('name') && !empty($fieldDefs['name']['required'])) { - if (!$entity->get('name')) { - return false; - } - } - return true; - } - - protected function stripTags($string) - { - return strip_tags($string, '


'); - } - - protected function filterInputField($field, $value) - { - if (in_array($field, $this->notFilteringFields)) { - return $value; - } - $methodName = 'filterInputField' . ucfirst($field); - if (method_exists($this, $methodName)) { - $value = $this->$methodName($value); - } - return $value; - } - - protected function filterInput(&$data) - { - foreach ($this->readOnlyFields as $field) { - unset($data[$field]); - } - - foreach ($data as $key => $value) { - if (is_array($data[$key])) { - foreach ($data[$key] as $i => $v) { - $data[$key][$i] = $this->filterInputField($i, $data[$key][$i]); - } - } else if ($data[$key] instanceof \stdClass) { - $propertyList = get_object_vars($data[$key]); - foreach ($propertyList as $property => $value) { - $data[$key]->$property = $this->filterInputField($property, $data[$key]->$property); - } - } else { - $data[$key] = $this->filterInputField($key, $data[$key]); - } - } - } - - protected function handleInput(&$data) - { - - } - public function createEntity($data) - { - $entity = $this->getEntity(); - - $this->filterInput($data); - $this->handleInput($data); - - $entity->set($data); - - if (!$this->isValid($entity)) { - throw new BadRequest(); - } - - if (empty($data['forceDuplicate'])) { - $duplicates = $this->checkEntityForDuplicate($entity); - if (!empty($duplicates)) { - $reason = array( - 'reason' => 'Duplicate', - 'data' => $duplicates - ); - throw new Conflict(json_encode($reason)); - } - } - - if ($this->storeEntity($entity)) { - $this->prepareEntityForOutput($entity); - return $entity; - } - - throw new Error(); - } - - - public function updateEntity($id, $data) - { - unset($data['deleted']); - - $this->filterInput($data); - $this->handleInput($data); - - $entity = $this->getEntity($id); - - if (!$this->getAcl()->check($entity, 'edit')) { - throw new Forbidden(); - } - - $entity->set($data); - - if (!$this->isValid($entity)) { - throw new BadRequest(); - } - - if ($this->storeEntity($entity)) { - $this->prepareEntityForOutput($entity); - return $entity; - } + public function createEntity($data) + { + $entity = $this->getEntity(); + + $this->filterInput($data); + $this->handleInput($data); + + $entity->set($data); + + if (!$this->isValid($entity)) { + throw new BadRequest(); + } + + if (empty($data['forceDuplicate'])) { + $duplicates = $this->checkEntityForDuplicate($entity); + if (!empty($duplicates)) { + $reason = array( + 'reason' => 'Duplicate', + 'data' => $duplicates + ); + throw new Conflict(json_encode($reason)); + } + } + + if ($this->storeEntity($entity)) { + $this->prepareEntityForOutput($entity); + return $entity; + } + + throw new Error(); + } + + + public function updateEntity($id, $data) + { + unset($data['deleted']); + + $this->filterInput($data); + $this->handleInput($data); + + $entity = $this->getEntity($id); + + if (!$this->getAcl()->check($entity, 'edit')) { + throw new Forbidden(); + } + + $entity->set($data); + + if (!$this->isValid($entity)) { + throw new BadRequest(); + } + + if ($this->storeEntity($entity)) { + $this->prepareEntityForOutput($entity); + return $entity; + } - throw new Error(); - } + throw new Error(); + } - public function deleteEntity($id) - { - $entity = $this->getEntity($id); + public function deleteEntity($id) + { + $entity = $this->getEntity($id); - if (!$this->getAcl()->check($entity, 'delete')) { - throw new Forbidden(); - } - - return $this->getRepository()->remove($entity); - } - - public function findEntities($params) - { - $selectParams = $this->getSelectManager($this->entityName)->getSelectParams($params, true); - $collection = $this->getRepository()->find($selectParams); - - foreach ($collection as $e) { - $this->loadParentNameFields($e); - $this->prepareEntityForOutput($e); - } - - return array( - 'total' => $this->getRepository()->count($selectParams), - 'collection' => $collection, - ); - } + if (!$this->getAcl()->check($entity, 'delete')) { + throw new Forbidden(); + } + + return $this->getRepository()->remove($entity); + } + + public function findEntities($params) + { + $selectParams = $this->getSelectManager($this->entityName)->getSelectParams($params, true); + $collection = $this->getRepository()->find($selectParams); + + foreach ($collection as $e) { + $this->loadParentNameFields($e); + $this->prepareEntityForOutput($e); + } + + return array( + 'total' => $this->getRepository()->count($selectParams), + 'collection' => $collection, + ); + } public function findLinkedEntities($id, $link, $params) - { - $entity = $this->getEntity($id); - $foreignEntityName = $entity->relations[$link]['entity']; - - if (!$this->getAcl()->check($entity, 'read')) { - throw new Forbidden(); - } - if (!$this->getAcl()->check($foreignEntityName, 'read')) { - throw new Forbidden(); - } - - $selectParams = $this->getSelectManager($foreignEntityName)->getSelectParams($params, true); - - if (array_key_exists($link, $this->linkSelectParams)) { - $selectParams = array_merge($selectParams, $this->linkSelectParams[$link]); - } - - $collection = $this->getRepository()->findRelated($entity, $link, $selectParams); - - $recordService = $this->getRecordService($foreignEntityName); - - foreach ($collection as $e) { - $this->loadParentNameFields($e); - $recordService->prepareEntityForOutput($e); - } - - return array( - 'total' => $this->getRepository()->countRelated($entity, $link, $selectParams), - 'collection' => $collection, - ); + { + $entity = $this->getEntity($id); + $foreignEntityName = $entity->relations[$link]['entity']; + + if (!$this->getAcl()->check($entity, 'read')) { + throw new Forbidden(); + } + if (!$this->getAcl()->check($foreignEntityName, 'read')) { + throw new Forbidden(); + } + + $selectParams = $this->getSelectManager($foreignEntityName)->getSelectParams($params, true); + + if (array_key_exists($link, $this->linkSelectParams)) { + $selectParams = array_merge($selectParams, $this->linkSelectParams[$link]); + } + + $collection = $this->getRepository()->findRelated($entity, $link, $selectParams); + + $recordService = $this->getRecordService($foreignEntityName); + + foreach ($collection as $e) { + $this->loadParentNameFields($e); + $recordService->prepareEntityForOutput($e); + } + + return array( + 'total' => $this->getRepository()->countRelated($entity, $link, $selectParams), + 'collection' => $collection, + ); } public function linkEntity($id, $link, $foreignId) { - $entity = $this->getEntity($id); + $entity = $this->getEntity($id); - $entityName = $entity->getEntityName($entity); - $foreignEntityName = $entity->relations[$link]['entity']; - - if (!$this->getAcl()->check($entity, 'edit')) { - throw new Forbidden(); - } - - if (empty($foreignEntityName)) { - throw new Error(); - } - - $foreignEntity = $this->getEntityManager()->getEntity($foreignEntityName, $foreignId); - - if (!$this->getAcl()->check($foreignEntity, 'edit')) { - throw new Forbidden(); - } - - if (!empty($foreignEntity)) { - $this->getRepository()->relate($entity, $link, $foreignEntity); - return true; - } + $entityName = $entity->getEntityName($entity); + $foreignEntityName = $entity->relations[$link]['entity']; + + if (!$this->getAcl()->check($entity, 'edit')) { + throw new Forbidden(); + } + + if (empty($foreignEntityName)) { + throw new Error(); + } + + $foreignEntity = $this->getEntityManager()->getEntity($foreignEntityName, $foreignId); + + if (!$this->getAcl()->check($foreignEntity, 'edit')) { + throw new Forbidden(); + } + + if (!empty($foreignEntity)) { + $this->getRepository()->relate($entity, $link, $foreignEntity); + return true; + } } public function unlinkEntity($id, $link, $foreignId) { - $entity = $this->getEntity($id); + $entity = $this->getEntity($id); - $entityName = $entity->getEntityName($entity); - $foreignEntityName = $entity->relations[$link]['entity']; - - if (!$this->getAcl()->check($entity, 'edit')) { - throw new Forbidden(); - } - - if (empty($foreignEntityName)) { - throw new Error(); - } - - $foreignEntity = $this->getEntityManager()->getEntity($foreignEntityName, $foreignId); - - if (!$this->getAcl()->check($foreignEntity, 'edit')) { - throw new Forbidden(); - } - - if (!empty($foreignEntity)) { - $this->getRepository()->unrelate($entity, $link, $foreignEntity); - return true; - } + $entityName = $entity->getEntityName($entity); + $foreignEntityName = $entity->relations[$link]['entity']; + + if (!$this->getAcl()->check($entity, 'edit')) { + throw new Forbidden(); + } + + if (empty($foreignEntityName)) { + throw new Error(); + } + + $foreignEntity = $this->getEntityManager()->getEntity($foreignEntityName, $foreignId); + + if (!$this->getAcl()->check($foreignEntity, 'edit')) { + throw new Forbidden(); + } + + if (!empty($foreignEntity)) { + $this->getRepository()->unrelate($entity, $link, $foreignEntity); + return true; + } } public function massUpdate($attributes = array(), $ids = array(), $where = array()) { - $idsUpdated = array(); - $repository = $this->getRepository(); - - if (!empty($ids)) { - foreach ($ids as $id) { - $entity = $this->getEntity($id); - if ($this->getAcl()->check($entity, 'edit')) { - $entity->set(get_object_vars($attributes)); - if ($repository->save($entity)) { - $idsUpdated[] = $id; - } - } - } - } - - return $idsUpdated; - - // TODO update $where + $idsUpdated = array(); + $repository = $this->getRepository(); + + if (!empty($ids)) { + foreach ($ids as $id) { + $entity = $this->getEntity($id); + if ($this->getAcl()->check($entity, 'edit')) { + $entity->set(get_object_vars($attributes)); + if ($repository->save($entity)) { + $idsUpdated[] = $id; + } + } + } + } + + return $idsUpdated; + + // TODO update $where } public function follow($id, $userId = null) { - $entity = $this->getEntity($id); - if (!$this->getAcl()->check($entity, 'read')) { - throw new Forbidden(); - } - - if (empty($userId)) { - $userId = $this->getUser()->id; - } + $entity = $this->getEntity($id); + if (!$this->getAcl()->check($entity, 'read')) { + throw new Forbidden(); + } + + if (empty($userId)) { + $userId = $this->getUser()->id; + } - return $this->getStreamService()->followEntity($entity, $userId); + return $this->getStreamService()->followEntity($entity, $userId); } public function unfollow($id, $userId = null) { - $entity = $this->getEntity($id); - if (!$this->getAcl()->check($entity, 'read')) { - throw new Forbidden(); - } - - if (empty($userId)) { - $userId = $this->getUser()->id; - } - - return $this->getStreamService()->unfollowEntity($entity, $userId); + $entity = $this->getEntity($id); + if (!$this->getAcl()->check($entity, 'read')) { + throw new Forbidden(); + } + + if (empty($userId)) { + $userId = $this->getUser()->id; + } + + return $this->getStreamService()->unfollowEntity($entity, $userId); } protected function getDuplicateWhereClause(Entity $entity) { - return false; + return false; } public function checkEntityForDuplicate(Entity $entity) - { - $where = $this->getDuplicateWhereClause($entity); - - if ($where) { - $duplicates = $this->getRepository()->where($where)->find(); - if (count($duplicates)) { - $result = array(); - foreach ($duplicates as $e) { - $result[$e->id] = $e->get('name'); - } - return $result; - } - } - return false; + { + $where = $this->getDuplicateWhereClause($entity); + + if ($where) { + $duplicates = $this->getRepository()->where($where)->find(); + if (count($duplicates)) { + $result = array(); + foreach ($duplicates as $e) { + $result[$e->id] = $e->get('name'); + } + return $result; + } + } + return false; } public function export($ids, $where) { - if (!empty($ids)) { - $where = array( - array( - 'type' => 'in', - 'field' => 'id', - 'value' => $ids - ) - ); - } - - $selectParams = $this->getSelectManager($this->entityName)->getSelectParams(array('where' => $where), true); - $collection = $this->getRepository()->find($selectParams); - - $arr = array(); - - $collection->toArray(); - - $fieldsToSkip = array( - 'modifiedByName', - 'createdByName', - 'modifiedById', - 'createdById', - 'modifiedAt', - 'createdAt', - 'deleted', - ); - - $fields = null; - foreach ($collection as $entity) { - if (empty($fields)) { - $fields = array(); - foreach ($entity->getFields() as $field => $defs) { - if (in_array($field, $fieldsToSkip)) { - continue; - } - - if (empty($defs['notStorable'])) { - $fields[] = $field; - } else { - if (in_array($defs['type'], array('email', 'phone'))) { - $fields[] = $field; - } else if ($defs['name'] == 'name') { - $fields[] = $field; - } - } - } - } - - $row = array(); - foreach ($fields as $field) { - $row[$field] = $entity->get($field); - } - $arr[] = $row; - } - - $delimiter = $this->getPreferences()->get('exportDelimiter'); - if (empty($delimiter)) { - $delimiter = ','; - } - - $fp = fopen('php://temp', 'w'); - fputcsv($fp, array_keys($arr[0]), $delimiter); - foreach ($arr as $row) { - fputcsv($fp, $row, $delimiter); - } - rewind($fp); - $csv = stream_get_contents($fp); - fclose($fp); - - $fileName = "Export_{$this->entityName}.csv"; - - $attachment = $this->getEntityManager()->getEntity('Attachment'); - $attachment->set('name', $fileName); - $attachment->set('role', 'Export File'); - $attachment->set('type', 'text/csv'); - - $this->getEntityManager()->saveEntity($attachment); - - if (!empty($attachment->id)) { - $this->getInjection('fileManager')->putContents('data/upload/' . $attachment->id, $csv); - // TODO cron job to remove file - return $attachment->id; - } - throw new Error(); + if (!empty($ids)) { + $where = array( + array( + 'type' => 'in', + 'field' => 'id', + 'value' => $ids + ) + ); + } + + $selectParams = $this->getSelectManager($this->entityName)->getSelectParams(array('where' => $where), true); + $collection = $this->getRepository()->find($selectParams); + + $arr = array(); + + $collection->toArray(); + + $fieldsToSkip = array( + 'modifiedByName', + 'createdByName', + 'modifiedById', + 'createdById', + 'modifiedAt', + 'createdAt', + 'deleted', + ); + + $fields = null; + foreach ($collection as $entity) { + if (empty($fields)) { + $fields = array(); + foreach ($entity->getFields() as $field => $defs) { + if (in_array($field, $fieldsToSkip)) { + continue; + } + + if (empty($defs['notStorable'])) { + $fields[] = $field; + } else { + if (in_array($defs['type'], array('email', 'phone'))) { + $fields[] = $field; + } else if ($defs['name'] == 'name') { + $fields[] = $field; + } + } + } + } + + $row = array(); + foreach ($fields as $field) { + $row[$field] = $entity->get($field); + } + $arr[] = $row; + } + + $delimiter = $this->getPreferences()->get('exportDelimiter'); + if (empty($delimiter)) { + $delimiter = ','; + } + + $fp = fopen('php://temp', 'w'); + fputcsv($fp, array_keys($arr[0]), $delimiter); + foreach ($arr as $row) { + fputcsv($fp, $row, $delimiter); + } + rewind($fp); + $csv = stream_get_contents($fp); + fclose($fp); + + $fileName = "Export_{$this->entityName}.csv"; + + $attachment = $this->getEntityManager()->getEntity('Attachment'); + $attachment->set('name', $fileName); + $attachment->set('role', 'Export File'); + $attachment->set('type', 'text/csv'); + + $this->getEntityManager()->saveEntity($attachment); + + if (!empty($attachment->id)) { + $this->getInjection('fileManager')->putContents('data/upload/' . $attachment->id, $csv); + // TODO cron job to remove file + return $attachment->id; + } + throw new Error(); } public function prepareEntityForOutput(Entity $entity) - { - foreach ($this->internalFields as $field) { - $entity->clear($field); - } + { + foreach ($this->internalFields as $field) { + $entity->clear($field); + } } } diff --git a/application/Espo/Services/ScheduledJob.php b/application/Espo/Services/ScheduledJob.php index c8dfd83a7a..a92eb0f3ed 100644 --- a/application/Espo/Services/ScheduledJob.php +++ b/application/Espo/Services/ScheduledJob.php @@ -25,59 +25,59 @@ namespace Espo\Services; use \PDO; class ScheduledJob extends \Espo\Services\Record -{ +{ - public function getActiveJobs() - { - $query = "SELECT * FROM scheduled_job WHERE - `status` = 'Active' - AND deleted = 0"; + public function getActiveJobs() + { + $query = "SELECT * FROM scheduled_job WHERE + `status` = 'Active' + AND deleted = 0"; - $pdo = $this->getEntityManager()->getPDO(); - $sth = $pdo->prepare($query); - $sth->execute(); + $pdo = $this->getEntityManager()->getPDO(); + $sth = $pdo->prepare($query); + $sth->execute(); - $rows = $sth->fetchAll(PDO::FETCH_ASSOC); - - $list = array(); - foreach ($rows as $row) { - $list[] = $row; - } + $rows = $sth->fetchAll(PDO::FETCH_ASSOC); + + $list = array(); + foreach ($rows as $row) { + $list[] = $row; + } - return $list; - } + return $list; + } - /** - * Add record to ScheduledJobLogRecord about executed job - * @param string $scheduledJobId - * @param string $status - * - * @return string Id of created ScheduledJobLogRecord - */ - public function addLogRecord($scheduledJobId, $status) - { - $lastRun = date('Y-m-d H:i:s'); + /** + * Add record to ScheduledJobLogRecord about executed job + * @param string $scheduledJobId + * @param string $status + * + * @return string Id of created ScheduledJobLogRecord + */ + public function addLogRecord($scheduledJobId, $status) + { + $lastRun = date('Y-m-d H:i:s'); - $entityManager = $this->getEntityManager(); + $entityManager = $this->getEntityManager(); - $scheduledJob = $entityManager->getEntity('ScheduledJob', $scheduledJobId); - $scheduledJob->set('lastRun', $lastRun); - $entityManager->saveEntity($scheduledJob); + $scheduledJob = $entityManager->getEntity('ScheduledJob', $scheduledJobId); + $scheduledJob->set('lastRun', $lastRun); + $entityManager->saveEntity($scheduledJob); - $scheduledJobLog = $entityManager->getEntity('ScheduledJobLogRecord'); - $scheduledJobLog->set(array( - 'scheduledJobId' => $scheduledJobId, - 'name' => $scheduledJob->get('name'), - 'status' => $status, - 'executionTime' => $lastRun, - )); - $scheduledJobLogId = $entityManager->saveEntity($scheduledJobLog); - //$entityManager->getRepository('ScheduledJobLogRecord')->relate($scheduledJobLog, 'scheduledJob', $scheduledJob); + $scheduledJobLog = $entityManager->getEntity('ScheduledJobLogRecord'); + $scheduledJobLog->set(array( + 'scheduledJobId' => $scheduledJobId, + 'name' => $scheduledJob->get('name'), + 'status' => $status, + 'executionTime' => $lastRun, + )); + $scheduledJobLogId = $entityManager->saveEntity($scheduledJobLog); + //$entityManager->getRepository('ScheduledJobLogRecord')->relate($scheduledJobLog, 'scheduledJob', $scheduledJob); - return $scheduledJobLogId; - } - - - + return $scheduledJobLogId; + } + + + } diff --git a/application/Espo/Services/Stream.php b/application/Espo/Services/Stream.php index 081ceb834c..e034006f0b 100644 --- a/application/Espo/Services/Stream.php +++ b/application/Espo/Services/Stream.php @@ -29,436 +29,436 @@ use Espo\ORM\Entity; class Stream extends \Espo\Core\Services\Base { - protected $statusDefs = array( - 'Lead' => array( - 'field' => 'status', - 'style' => array( - 'New' => 'primary', - 'Assigned' => 'primary', - 'In Process' => 'primary', - 'Converted' => 'success', - 'Recycled' => 'danger', - 'Dead' => 'danger', - ), - ), - 'Case' => array( - 'field' => 'status', - 'style' => array( - 'New' => 'primary', - 'Assigned' => 'primary', - 'Pending' => 'default', - 'Closed' => 'success', - 'Rejected' => 'danger', - 'Duplicate' => 'danger', - ), - ), - 'Opportunity' => array( - 'field' => 'stage', - 'style' => array( - 'Closed Won' => 'success', - 'Closed Lost' => 'danger', - ), - ), - ); - - protected $dependencies = array( - 'entityManager', - 'config', - 'user', - 'metadata', - 'acl' - ); - - protected function getAcl() - { - return $this->injections['acl']; - } - - protected function getMetadata() - { - return $this->injections['metadata']; - } - - public function checkIsFollowed(Entity $entity, $userId = null) - { - if (empty($userId)) { - $userId = $this->getUser()->id; - } - - $pdo = $this->getEntityManager()->getPDO(); - $sql = " - SELECT id FROM subscription - WHERE - entity_id = " . $pdo->quote($entity->id) . " AND entity_type = " . $pdo->quote($entity->getEntityName()) . " AND - user_id = " . $pdo->quote($userId) . " - "; - - $sth = $pdo->prepare($sql); - $sth->execute(); - if ($sth->fetchAll()) { - return true; - } - return false; - } - - public function followEntity(Entity $entity, $userId) - { - if ($userId == 'system') { - return; - } - if (!$this->getMetadata()->get('scopes.' . $entity->getEntityName() . '.stream')) { - throw new Error(); - } - - $pdo = $this->getEntityManager()->getPDO(); - - if (!$this->checkIsFollowed($entity, $userId)) { - $sql = " - INSERT INTO subscription - (entity_id, entity_type, user_id) - VALUES - (".$pdo->quote($entity->id) . ", " . $pdo->quote($entity->getEntityName()) . ", " . $pdo->quote($userId).") - "; - $sth = $pdo->prepare($sql)->execute(); - } - return true; - } - - public function unfollowEntity(Entity $entity, $userId) - { - if (!$this->getMetadata()->get('scopes.' . $entity->getEntityName() . '.stream')) { - throw new Error(); - } - - $pdo = $this->getEntityManager()->getPDO(); + protected $statusDefs = array( + 'Lead' => array( + 'field' => 'status', + 'style' => array( + 'New' => 'primary', + 'Assigned' => 'primary', + 'In Process' => 'primary', + 'Converted' => 'success', + 'Recycled' => 'danger', + 'Dead' => 'danger', + ), + ), + 'Case' => array( + 'field' => 'status', + 'style' => array( + 'New' => 'primary', + 'Assigned' => 'primary', + 'Pending' => 'default', + 'Closed' => 'success', + 'Rejected' => 'danger', + 'Duplicate' => 'danger', + ), + ), + 'Opportunity' => array( + 'field' => 'stage', + 'style' => array( + 'Closed Won' => 'success', + 'Closed Lost' => 'danger', + ), + ), + ); + + protected $dependencies = array( + 'entityManager', + 'config', + 'user', + 'metadata', + 'acl' + ); + + protected function getAcl() + { + return $this->injections['acl']; + } + + protected function getMetadata() + { + return $this->injections['metadata']; + } + + public function checkIsFollowed(Entity $entity, $userId = null) + { + if (empty($userId)) { + $userId = $this->getUser()->id; + } + + $pdo = $this->getEntityManager()->getPDO(); + $sql = " + SELECT id FROM subscription + WHERE + entity_id = " . $pdo->quote($entity->id) . " AND entity_type = " . $pdo->quote($entity->getEntityName()) . " AND + user_id = " . $pdo->quote($userId) . " + "; + + $sth = $pdo->prepare($sql); + $sth->execute(); + if ($sth->fetchAll()) { + return true; + } + return false; + } + + public function followEntity(Entity $entity, $userId) + { + if ($userId == 'system') { + return; + } + if (!$this->getMetadata()->get('scopes.' . $entity->getEntityName() . '.stream')) { + throw new Error(); + } + + $pdo = $this->getEntityManager()->getPDO(); + + if (!$this->checkIsFollowed($entity, $userId)) { + $sql = " + INSERT INTO subscription + (entity_id, entity_type, user_id) + VALUES + (".$pdo->quote($entity->id) . ", " . $pdo->quote($entity->getEntityName()) . ", " . $pdo->quote($userId).") + "; + $sth = $pdo->prepare($sql)->execute(); + } + return true; + } + + public function unfollowEntity(Entity $entity, $userId) + { + if (!$this->getMetadata()->get('scopes.' . $entity->getEntityName() . '.stream')) { + throw new Error(); + } + + $pdo = $this->getEntityManager()->getPDO(); - $sql = " - DELETE FROM subscription - WHERE - entity_id = " . $pdo->quote($entity->id) . " AND entity_type = " . $pdo->quote($entity->getEntityName()) . " AND - user_id = " . $pdo->quote($userId) . " - "; - $sth = $pdo->prepare($sql)->execute(); - - return true; - } - - - public function unfollowAllUsersFromEntity(Entity $entity) - { - if (empty($entity->id)) { - return; - } - - $pdo = $this->getEntityManager()->getPDO(); - $sql = " - DELETE FROM subscription - WHERE - entity_id = " . $pdo->quote($entity->id) . " AND entity_type = " . $pdo->quote($entity->getEntityName()) . " - "; - $sth = $pdo->prepare($sql)->execute(); - } - - public function findUserStream($params = array()) - { - $selectParams = array( - 'offset' => $params['offset'], - 'limit' => $params['maxSize'], - 'orderBy' => 'createdAt', - 'order' => 'DESC', - 'customJoin' => " - JOIN subscription ON - note.parent_type = subscription.entity_type AND - note.parent_id = subscription.entity_id AND - subscription.user_id = '" . $this->getUser()->id . "' - " - ); - - if (!empty($params['after'])) { - $where = array(); - $where['createdAt>'] = $params['after']; - $selectParams['whereClause'] = $where; - } - - $collection = $this->getEntityManager()->getRepository('Note')->find($selectParams); - - foreach ($collection as $e) { - if ($e->get('type') == 'Post') { - $e->loadAttachments(); - } - } - - foreach ($collection as $e) { - if ($e->get('parentId') && $e->get('parentType')) { - $entity = $this->getEntityManager()->getEntity($e->get('parentType'), $e->get('parentId')); - if ($entity) { - $e->set('parentName', $entity->get('name')); - } - } - } - - unset($selectParams['whereClause']['createdAt>']); - $count = $this->getEntityManager()->getRepository('Note')->count($selectParams); - - return array( - 'total' => $count, - 'collection' => $collection, - ); - } - - public function find($scope, $id, $params = array()) - { - if ($scope == 'User') { - return $this->findUserStream($params); - } - $entity = $this->getEntityManager()->getEntity($scope, $id); - - if (empty($entity)) { - throw new NotFound(); - } - - if (!$this->getAcl($entity, 'read')) { - throw new Forbidden(); - } - - $where = array( - 'parentType' => $scope, - 'parentId' => $id - ); - - if (!empty($params['after'])) { - $where['createdAt>'] = $params['after']; - } - - $collection = $this->getEntityManager()->getRepository('Note')->find(array( - 'whereClause' => $where, - 'offset' => $params['offset'], - 'limit' => $params['maxSize'], - 'orderBy' => 'createdAt', - 'order' => 'DESC' - )); - - foreach ($collection as $e) { - if ($e->get('type') == 'Post') { - $e->loadAttachments(); - } - } - - unset($where['createdAt>']); - $count = $this->getEntityManager()->getRepository('Note')->count(array( - 'whereClause' => $where, - )); - - return array( - 'total' => $count, - 'collection' => $collection, - ); - } - - protected function loadAssignedUserName(Entity $entity) - { - $user = $this->getEntityManager()->getEntity('User', $entity->get('assignedUserId')); - if ($user) { - $entity->set('assignedUserName', $user->get('name')); - } - } - - public function noteEmailReceived(Entity $entity, Entity $email) - { - $entityName = $entity->getEntityName(); - - $note = $this->getEntityManager()->getEntity('Note'); - - $note->set('type', 'EmailReceived'); - $note->set('parentId', $entity->id); - $note->set('parentType', $entityName); - - $data = array(); - - $data['emailId'] = $email->id; - $data['emailName'] = $email->get('name'); - - $note->set('data', $data); - - $this->getEntityManager()->saveEntity($note); - } - - public function noteCreate(Entity $entity) - { - $entityName = $entity->getEntityName(); - - $note = $this->getEntityManager()->getEntity('Note'); - - $note->set('type', 'Create'); - $note->set('parentId', $entity->id); - $note->set('parentType', $entityName); + $sql = " + DELETE FROM subscription + WHERE + entity_id = " . $pdo->quote($entity->id) . " AND entity_type = " . $pdo->quote($entity->getEntityName()) . " AND + user_id = " . $pdo->quote($userId) . " + "; + $sth = $pdo->prepare($sql)->execute(); + + return true; + } + + + public function unfollowAllUsersFromEntity(Entity $entity) + { + if (empty($entity->id)) { + return; + } + + $pdo = $this->getEntityManager()->getPDO(); + $sql = " + DELETE FROM subscription + WHERE + entity_id = " . $pdo->quote($entity->id) . " AND entity_type = " . $pdo->quote($entity->getEntityName()) . " + "; + $sth = $pdo->prepare($sql)->execute(); + } + + public function findUserStream($params = array()) + { + $selectParams = array( + 'offset' => $params['offset'], + 'limit' => $params['maxSize'], + 'orderBy' => 'createdAt', + 'order' => 'DESC', + 'customJoin' => " + JOIN subscription ON + note.parent_type = subscription.entity_type AND + note.parent_id = subscription.entity_id AND + subscription.user_id = '" . $this->getUser()->id . "' + " + ); + + if (!empty($params['after'])) { + $where = array(); + $where['createdAt>'] = $params['after']; + $selectParams['whereClause'] = $where; + } + + $collection = $this->getEntityManager()->getRepository('Note')->find($selectParams); + + foreach ($collection as $e) { + if ($e->get('type') == 'Post') { + $e->loadAttachments(); + } + } + + foreach ($collection as $e) { + if ($e->get('parentId') && $e->get('parentType')) { + $entity = $this->getEntityManager()->getEntity($e->get('parentType'), $e->get('parentId')); + if ($entity) { + $e->set('parentName', $entity->get('name')); + } + } + } + + unset($selectParams['whereClause']['createdAt>']); + $count = $this->getEntityManager()->getRepository('Note')->count($selectParams); + + return array( + 'total' => $count, + 'collection' => $collection, + ); + } + + public function find($scope, $id, $params = array()) + { + if ($scope == 'User') { + return $this->findUserStream($params); + } + $entity = $this->getEntityManager()->getEntity($scope, $id); + + if (empty($entity)) { + throw new NotFound(); + } + + if (!$this->getAcl($entity, 'read')) { + throw new Forbidden(); + } + + $where = array( + 'parentType' => $scope, + 'parentId' => $id + ); + + if (!empty($params['after'])) { + $where['createdAt>'] = $params['after']; + } + + $collection = $this->getEntityManager()->getRepository('Note')->find(array( + 'whereClause' => $where, + 'offset' => $params['offset'], + 'limit' => $params['maxSize'], + 'orderBy' => 'createdAt', + 'order' => 'DESC' + )); + + foreach ($collection as $e) { + if ($e->get('type') == 'Post') { + $e->loadAttachments(); + } + } + + unset($where['createdAt>']); + $count = $this->getEntityManager()->getRepository('Note')->count(array( + 'whereClause' => $where, + )); + + return array( + 'total' => $count, + 'collection' => $collection, + ); + } + + protected function loadAssignedUserName(Entity $entity) + { + $user = $this->getEntityManager()->getEntity('User', $entity->get('assignedUserId')); + if ($user) { + $entity->set('assignedUserName', $user->get('name')); + } + } + + public function noteEmailReceived(Entity $entity, Entity $email) + { + $entityName = $entity->getEntityName(); + + $note = $this->getEntityManager()->getEntity('Note'); + + $note->set('type', 'EmailReceived'); + $note->set('parentId', $entity->id); + $note->set('parentType', $entityName); + + $data = array(); + + $data['emailId'] = $email->id; + $data['emailName'] = $email->get('name'); + + $note->set('data', $data); + + $this->getEntityManager()->saveEntity($note); + } + + public function noteCreate(Entity $entity) + { + $entityName = $entity->getEntityName(); + + $note = $this->getEntityManager()->getEntity('Note'); + + $note->set('type', 'Create'); + $note->set('parentId', $entity->id); + $note->set('parentType', $entityName); - $data = array(); + $data = array(); - if ($entity->get('assignedUserId') != $entity->get('createdById')) { - if (!$entity->has('assignedUserName')) { - $this->loadAssignedUserName($entity); - } - $data['assignedUserId'] = $entity->get('assignedUserId'); - $data['assignedUserName'] = $entity->get('assignedUserName'); - } - - if (array_key_exists($entityName, $this->statusDefs)) { - $field = $this->statusDefs[$entityName]['field']; - $value = $entity->get($field); - if (!empty($value)) { - $style = 'default'; - if (!empty($this->statusDefs[$entityName]['style'][$value])) { - $style = $this->statusDefs[$entityName]['style'][$value]; - } - $data['statusValue'] = $value; - $data['statusField'] = $field; - $data['statusStyle'] = $style; - } - } - - $note->set('data', $data); - - $this->getEntityManager()->saveEntity($note); - } - - public function noteCreateRelated(Entity $entity, $entityType, $id, $action = 'created') - { - $note = $this->getEntityManager()->getEntity('Note'); - - $note->set('type', 'CreateRelated'); - $note->set('parentId', $id); - $note->set('parentType', $entityType); + if ($entity->get('assignedUserId') != $entity->get('createdById')) { + if (!$entity->has('assignedUserName')) { + $this->loadAssignedUserName($entity); + } + $data['assignedUserId'] = $entity->get('assignedUserId'); + $data['assignedUserName'] = $entity->get('assignedUserName'); + } + + if (array_key_exists($entityName, $this->statusDefs)) { + $field = $this->statusDefs[$entityName]['field']; + $value = $entity->get($field); + if (!empty($value)) { + $style = 'default'; + if (!empty($this->statusDefs[$entityName]['style'][$value])) { + $style = $this->statusDefs[$entityName]['style'][$value]; + } + $data['statusValue'] = $value; + $data['statusField'] = $field; + $data['statusStyle'] = $style; + } + } + + $note->set('data', $data); + + $this->getEntityManager()->saveEntity($note); + } + + public function noteCreateRelated(Entity $entity, $entityType, $id, $action = 'created') + { + $note = $this->getEntityManager()->getEntity('Note'); + + $note->set('type', 'CreateRelated'); + $note->set('parentId', $id); + $note->set('parentType', $entityType); - $note->set('data', array( - 'action' => $action, - 'entityType' => $entity->getEntityName(), - 'entityId' => $entity->id, - 'entityName' => $entity->get('name') - )); + $note->set('data', array( + 'action' => $action, + 'entityType' => $entity->getEntityName(), + 'entityId' => $entity->id, + 'entityName' => $entity->get('name') + )); - $this->getEntityManager()->saveEntity($note); - } - - public function noteAssign(Entity $entity) - { - $note = $this->getEntityManager()->getEntity('Note'); - - $note->set('type', 'Assign'); - $note->set('parentId', $entity->id); - $note->set('parentType', $entity->getEntityName()); + $this->getEntityManager()->saveEntity($note); + } + + public function noteAssign(Entity $entity) + { + $note = $this->getEntityManager()->getEntity('Note'); + + $note->set('type', 'Assign'); + $note->set('parentId', $entity->id); + $note->set('parentType', $entity->getEntityName()); - if (!$entity->has('assignedUserName')) { - $this->loadAssignedUserName($entity); - } - $note->set('data', array( - 'assignedUserId' => $entity->get('assignedUserId'), - 'assignedUserName' => $entity->get('assignedUserName'), - )); + if (!$entity->has('assignedUserName')) { + $this->loadAssignedUserName($entity); + } + $note->set('data', array( + 'assignedUserId' => $entity->get('assignedUserId'), + 'assignedUserName' => $entity->get('assignedUserName'), + )); - $this->getEntityManager()->saveEntity($note); - } - - public function noteStatus(Entity $entity, $field) - { - $note = $this->getEntityManager()->getEntity('Note'); - - $note->set('type', 'Status'); - $note->set('parentId', $entity->id); - $note->set('parentType', $entity->getEntityName()); - - $style = 'default'; - $entityName = $entity->getEntityName(); - $value = $entity->get($field); - - if (!empty($this->statusDefs[$entityName]) && !empty($this->statusDefs[$entityName]['style'][$value])) { - $style = $this->statusDefs[$entityName]['style'][$value]; - } - - $note->set('data', array( - 'field' => $field, - 'value' => $value, - 'style' => $style, - )); - - $this->getEntityManager()->saveEntity($note); - } - - protected function getAuditedFields(Entity $entity) - { - $entityName = $entity->getEntityName(); - - if (!array_key_exists($entityName, $this->auditedFieldsCache)) { - $fields = $this->getMetadata()->get('entityDefs.' . $entityName . '.fields'); - $auditedFields = array(); - foreach ($fields as $field => $d) { - if (!empty($d['audited'])) { - $attributes = array(); - $fieldsDefs = $this->getMetadata()->get('fields.' . $d['type']); - - if (empty($fieldsDefs['actualFields'])) { - $attributes[] = $field; - } else { - foreach ($fieldsDefs['actualFields'] as $part) { - if (!empty($fieldsDefs['naming']) && $fieldsDefs['naming'] == 'prefix') { - $attributes[] = $part . ucfirst($field); - } else { - $attributes[] = $field . ucfirst($part); - } - } - } - - $auditedFields[$field] = $attributes; - } - } - $this->auditedFieldsCache[$entityName] = $auditedFields; - } - - return $this->auditedFieldsCache[$entityName]; - } - - public function handleAudited($entity) - { - $auditedFields = $this->getAuditedFields($entity); - - $updatedFields = array(); - $was = array(); - $became = array(); - - foreach ($auditedFields as $field => $attrs) { - $updated = false; - foreach ($attrs as $attr) { - if ($entity->get($attr) != $entity->getFetched($attr)) { + $this->getEntityManager()->saveEntity($note); + } + + public function noteStatus(Entity $entity, $field) + { + $note = $this->getEntityManager()->getEntity('Note'); + + $note->set('type', 'Status'); + $note->set('parentId', $entity->id); + $note->set('parentType', $entity->getEntityName()); + + $style = 'default'; + $entityName = $entity->getEntityName(); + $value = $entity->get($field); + + if (!empty($this->statusDefs[$entityName]) && !empty($this->statusDefs[$entityName]['style'][$value])) { + $style = $this->statusDefs[$entityName]['style'][$value]; + } + + $note->set('data', array( + 'field' => $field, + 'value' => $value, + 'style' => $style, + )); + + $this->getEntityManager()->saveEntity($note); + } + + protected function getAuditedFields(Entity $entity) + { + $entityName = $entity->getEntityName(); + + if (!array_key_exists($entityName, $this->auditedFieldsCache)) { + $fields = $this->getMetadata()->get('entityDefs.' . $entityName . '.fields'); + $auditedFields = array(); + foreach ($fields as $field => $d) { + if (!empty($d['audited'])) { + $attributes = array(); + $fieldsDefs = $this->getMetadata()->get('fields.' . $d['type']); + + if (empty($fieldsDefs['actualFields'])) { + $attributes[] = $field; + } else { + foreach ($fieldsDefs['actualFields'] as $part) { + if (!empty($fieldsDefs['naming']) && $fieldsDefs['naming'] == 'prefix') { + $attributes[] = $part . ucfirst($field); + } else { + $attributes[] = $field . ucfirst($part); + } + } + } + + $auditedFields[$field] = $attributes; + } + } + $this->auditedFieldsCache[$entityName] = $auditedFields; + } + + return $this->auditedFieldsCache[$entityName]; + } + + public function handleAudited($entity) + { + $auditedFields = $this->getAuditedFields($entity); + + $updatedFields = array(); + $was = array(); + $became = array(); + + foreach ($auditedFields as $field => $attrs) { + $updated = false; + foreach ($attrs as $attr) { + if ($entity->get($attr) != $entity->getFetched($attr)) { - $updated = true; - } - } - if ($updated) { - $updatedFields[] = $field; - foreach ($attrs as $attr) { - $was[$attr] = $entity->getFetched($attr); - $became[$attr] = $entity->get($attr); - } - } - } - - if (!empty($updatedFields)) { - $note = $this->getEntityManager()->getEntity('Note'); - - $note->set('type', 'Update'); - $note->set('parentId', $entity->id); - $note->set('parentType', $entity->getEntityName()); + $updated = true; + } + } + if ($updated) { + $updatedFields[] = $field; + foreach ($attrs as $attr) { + $was[$attr] = $entity->getFetched($attr); + $became[$attr] = $entity->get($attr); + } + } + } + + if (!empty($updatedFields)) { + $note = $this->getEntityManager()->getEntity('Note'); + + $note->set('type', 'Update'); + $note->set('parentId', $entity->id); + $note->set('parentType', $entity->getEntityName()); - $note->set('data', array( - 'fields' => $updatedFields, - 'attributes' => array( - 'was' => $was, - 'became' => $became, - ) - )); + $note->set('data', array( + 'fields' => $updatedFields, + 'attributes' => array( + 'was' => $was, + 'became' => $became, + ) + )); - $this->getEntityManager()->saveEntity($note); - } - } + $this->getEntityManager()->saveEntity($note); + } + } } diff --git a/application/Espo/Services/User.php b/application/Espo/Services/User.php index 669d18ca98..f4b89905fa 100644 --- a/application/Espo/Services/User.php +++ b/application/Espo/Services/User.php @@ -30,150 +30,150 @@ use \Espo\ORM\Entity; class User extends Record { - protected function init() - { - $this->dependencies[] = 'mailSender'; - $this->dependencies[] = 'language'; - } + protected function init() + { + $this->dependencies[] = 'mailSender'; + $this->dependencies[] = 'language'; + } - protected $internalFields = array('password'); + protected $internalFields = array('password'); - protected function getMailSender() - { - return $this->injections['mailSender']; - } + protected function getMailSender() + { + return $this->injections['mailSender']; + } - protected function getLanguage() - { - return $this->injections['language']; - } + protected function getLanguage() + { + return $this->injections['language']; + } - public function getEntity($id) - { - if ($id == 'system') { - throw new Forbidden(); - } + public function getEntity($id) + { + if ($id == 'system') { + throw new Forbidden(); + } - $entity = parent::getEntity($id); - return $entity; - } + $entity = parent::getEntity($id); + return $entity; + } - public function findEntities($params) - { - if (empty($params['where'])) { - $params['where'] = array(); - } - $params['where'][] = array( - 'type' => 'notEquals', - 'field' => 'id', - 'value' => 'system' - ); + public function findEntities($params) + { + if (empty($params['where'])) { + $params['where'] = array(); + } + $params['where'][] = array( + 'type' => 'notEquals', + 'field' => 'id', + 'value' => 'system' + ); - $result = parent::findEntities($params); - return $result; - } + $result = parent::findEntities($params); + return $result; + } - public function changePassword($userId, $password) - { - $user = $this->getEntityManager()->getEntity('User', $userId); - if (!$user) { - throw new NotFound(); - } + public function changePassword($userId, $password) + { + $user = $this->getEntityManager()->getEntity('User', $userId); + if (!$user) { + throw new NotFound(); + } - if (empty($password)) { - throw new Error('Password can\'t be empty.'); - } + if (empty($password)) { + throw new Error('Password can\'t be empty.'); + } - $user->set('password', $this->hashPassword($password)); + $user->set('password', $this->hashPassword($password)); - $this->getEntityManager()->saveEntity($user); + $this->getEntityManager()->saveEntity($user); - return true; - } + return true; + } - protected function hashPassword($password) - { - $config = $this->getConfig(); - $passwordHash = new \Espo\Core\Utils\PasswordHash($config); + protected function hashPassword($password) + { + $config = $this->getConfig(); + $passwordHash = new \Espo\Core\Utils\PasswordHash($config); - return $passwordHash->hash($password); - } + return $passwordHash->hash($password); + } - public function createEntity($data) - { - $newPassword = null; - if (array_key_exists('password', $data)) { - $newPassword = $data['password']; - $data['password'] = $this->hashPassword($data['password']); - } - $user = parent::createEntity($data); + public function createEntity($data) + { + $newPassword = null; + if (array_key_exists('password', $data)) { + $newPassword = $data['password']; + $data['password'] = $this->hashPassword($data['password']); + } + $user = parent::createEntity($data); - if (!is_null($newPassword)) { - $this->sendPassword($user, $newPassword); - } + if (!is_null($newPassword)) { + $this->sendPassword($user, $newPassword); + } - return $user; - } + return $user; + } - public function updateEntity($id, $data) - { - if ($id == 'system') { - throw new Forbidden(); - } - $newPassword = null; - if (array_key_exists('password', $data)) { - $newPassword = $data['password']; - $data['password'] = $this->hashPassword($data['password']); - } - $user = parent::updateEntity($id, $data); + public function updateEntity($id, $data) + { + if ($id == 'system') { + throw new Forbidden(); + } + $newPassword = null; + if (array_key_exists('password', $data)) { + $newPassword = $data['password']; + $data['password'] = $this->hashPassword($data['password']); + } + $user = parent::updateEntity($id, $data); - if (!is_null($newPassword)) { - try { - $this->sendPassword($user, $newPassword); - } catch (\Exception $e) {} - } + if (!is_null($newPassword)) { + try { + $this->sendPassword($user, $newPassword); + } catch (\Exception $e) {} + } - return $user; - } + return $user; + } - protected function sendPassword(Entity $user, $password) - { - $emailAddress = $user->get('emailAddress'); + protected function sendPassword(Entity $user, $password) + { + $emailAddress = $user->get('emailAddress'); - if (empty($emailAddress)) { - return; - } + if (empty($emailAddress)) { + return; + } - $email = $this->getEntityManager()->getEntity('Email'); + $email = $this->getEntityManager()->getEntity('Email'); - if (!$this->getConfig()->get('smtpServer')) { - return; - } + if (!$this->getConfig()->get('smtpServer')) { + return; + } - $subject = $this->getLanguage()->translate('accountInfoEmailSubject', 'messages', 'User'); - $body = $this->getLanguage()->translate('accountInfoEmailBody', 'messages', 'User'); + $subject = $this->getLanguage()->translate('accountInfoEmailSubject', 'messages', 'User'); + $body = $this->getLanguage()->translate('accountInfoEmailBody', 'messages', 'User'); - $body = str_replace('{userName}', $user->get('userName'), $body); - $body = str_replace('{password}', $password, $body); - $body = str_replace('{siteUrl}', $this->getConfig()->get('siteUrl'), $body); + $body = str_replace('{userName}', $user->get('userName'), $body); + $body = str_replace('{password}', $password, $body); + $body = str_replace('{siteUrl}', $this->getConfig()->get('siteUrl'), $body); - $email->set(array( - 'subject' => $subject, - 'body' => $body, - 'isHtml' => false, - 'to' => $emailAddress - )); + $email->set(array( + 'subject' => $subject, + 'body' => $body, + 'isHtml' => false, + 'to' => $emailAddress + )); - $this->getMailSender()->send($email); - } + $this->getMailSender()->send($email); + } - public function deleteEntity($id) - { - if ($id == 'system') { - throw new Forbidden(); - } - return parent::deleteEntity($id); - } + public function deleteEntity($id) + { + if ($id == 'system') { + throw new Forbidden(); + } + return parent::deleteEntity($id); + } } diff --git a/cron.php b/cron.php index f437f2df28..4ccec0bca2 100644 --- a/cron.php +++ b/cron.php @@ -7,7 +7,7 @@ if (substr($sapiName, 0, 3) != 'cli') { } include "bootstrap.php"; - + $app = new \Espo\Core\Application(); $app->runCron(); diff --git a/diff.js b/diff.js index 012871bc22..291a3c9425 100644 --- a/diff.js +++ b/diff.js @@ -1,7 +1,7 @@ var versionFrom = process.argv[2]; if (process.argv.length < 3) { - throw new Error("No 'version from' passed"); + throw new Error("No 'version from' passed"); } var acceptedVersionName = process.argv[3] || versionFrom; @@ -24,93 +24,93 @@ var upgradePath = currentPath + '/build/EspoCRM-upgrade-' + acceptedVersionName var exec = require('child_process').exec; function execute(command, callback) { - exec(command, function(error, stdout, stderr) { - callback(stdout); + exec(command, function(error, stdout, stderr) { + callback(stdout); }); }; execute('git diff --name-only ' + versionFrom, function (stdout) { - if (!fs.existsSync(upgradePath)) { - fs.mkdirSync(upgradePath); - } - if (!fs.existsSync(upgradePath + '/files')) { - fs.mkdirSync(upgradePath + '/files'); - } - process.chdir(buildPath); - - var fileList = []; - - (stdout || '').split('\n').forEach(function (file) { - if (file == '') { - return; - } - fileList.push(file.replace('frontend/', '')); - }); - - fileList.push('client/espo.min.js'); - - fileList.push('client/css/espo.min.css'); - - fs.writeFileSync(diffFilePath, fileList.join('\n')); - - execute('git diff --name-only --diff-filter=D ' + versionFrom, function (stdout) { - var deletedFileList = []; - - (stdout || '').split('\n').forEach(function (file) { - if (file == '') { - return; - } - deletedFileList.push(file.replace('frontend/', '')); - }); - - - execute('xargs -a ' + diffFilePath + ' cp --parents -t ' + upgradePath + '/files ' , function (stdout) { - - }); - - var d = new Date(); - - var monthN = ((d.getMonth() + 1).toString()); - monthN = monthN.length == 1 ? '0' + monthN : monthN; - - var dateN = d.getDate().toString(); - dateN = dateN.length == 1 ? '0' + dateN : dateN; - - var date = d.getFullYear().toString() + '-' + monthN + '-' + dateN.toString(); - - execute('git tag', function (stdout) { - var versionList = []; - var occured = false; - tagList = stdout.split('\n').forEach(function (tag) { - if (tag == versionFrom) { - occured = true; - } - if (!tag || tag == version) { - return; - } - if (occured) { - versionList.push(tag); - } - }); - - var manifest = { - "name": "EspoCRM Upgrade "+acceptedVersionName+" to "+version, - "type": "upgrade", - "version": version, - "acceptableVersions": versionList, - "releaseDate": date, - "author": "EspoCRM", - "description": "", - "delete": deletedFileList - } - - fs.writeFileSync(upgradePath + '/manifest.json', JSON.stringify(manifest, null, ' ')); - - }); - - fs.unlinkSync(diffFilePath) - - }); - + if (!fs.existsSync(upgradePath)) { + fs.mkdirSync(upgradePath); + } + if (!fs.existsSync(upgradePath + '/files')) { + fs.mkdirSync(upgradePath + '/files'); + } + process.chdir(buildPath); + + var fileList = []; + + (stdout || '').split('\n').forEach(function (file) { + if (file == '') { + return; + } + fileList.push(file.replace('frontend/', '')); + }); + + fileList.push('client/espo.min.js'); + + fileList.push('client/css/espo.min.css'); + + fs.writeFileSync(diffFilePath, fileList.join('\n')); + + execute('git diff --name-only --diff-filter=D ' + versionFrom, function (stdout) { + var deletedFileList = []; + + (stdout || '').split('\n').forEach(function (file) { + if (file == '') { + return; + } + deletedFileList.push(file.replace('frontend/', '')); + }); + + + execute('xargs -a ' + diffFilePath + ' cp --parents -t ' + upgradePath + '/files ' , function (stdout) { + + }); + + var d = new Date(); + + var monthN = ((d.getMonth() + 1).toString()); + monthN = monthN.length == 1 ? '0' + monthN : monthN; + + var dateN = d.getDate().toString(); + dateN = dateN.length == 1 ? '0' + dateN : dateN; + + var date = d.getFullYear().toString() + '-' + monthN + '-' + dateN.toString(); + + execute('git tag', function (stdout) { + var versionList = []; + var occured = false; + tagList = stdout.split('\n').forEach(function (tag) { + if (tag == versionFrom) { + occured = true; + } + if (!tag || tag == version) { + return; + } + if (occured) { + versionList.push(tag); + } + }); + + var manifest = { + "name": "EspoCRM Upgrade "+acceptedVersionName+" to "+version, + "type": "upgrade", + "version": version, + "acceptableVersions": versionList, + "releaseDate": date, + "author": "EspoCRM", + "description": "", + "delete": deletedFileList + } + + fs.writeFileSync(upgradePath + '/manifest.json', JSON.stringify(manifest, null, ' ')); + + }); + + fs.unlinkSync(diffFilePath) + + }); + }); diff --git a/frontend/client/modules/crm/res/templates/calendar-page.tpl b/frontend/client/modules/crm/res/templates/calendar-page.tpl index c11018b406..8027ea2121 100644 --- a/frontend/client/modules/crm/res/templates/calendar-page.tpl +++ b/frontend/client/modules/crm/res/templates/calendar-page.tpl @@ -1,3 +1,3 @@
- {{{calendar}}} + {{{calendar}}}
diff --git a/frontend/client/modules/crm/res/templates/calendar/calendar.tpl b/frontend/client/modules/crm/res/templates/calendar/calendar.tpl index 2f16796625..ea1688b950 100644 --- a/frontend/client/modules/crm/res/templates/calendar/calendar.tpl +++ b/frontend/client/modules/crm/res/templates/calendar/calendar.tpl @@ -3,24 +3,24 @@ {{#if header}} -
-
-
- - -
- -
- -

- -
-
- {{#each ../modeList}} - - {{/each}} -
-
+
+
+
+ + +
+ +
+ +

+ +
+
+ {{#each ../modeList}} + + {{/each}} +
+
{{/if}} diff --git a/frontend/client/modules/crm/res/templates/calendar/modals/edit.tpl b/frontend/client/modules/crm/res/templates/calendar/modals/edit.tpl index a822642e71..d4489c79f9 100644 --- a/frontend/client/modules/crm/res/templates/calendar/modals/edit.tpl +++ b/frontend/client/modules/crm/res/templates/calendar/modals/edit.tpl @@ -1,10 +1,10 @@ {{#if isNew}}
{{#each scopeList}} -   +   {{/each}}
{{/if}} diff --git a/frontend/client/modules/crm/res/templates/inbound-email/fields/folder/edit.tpl b/frontend/client/modules/crm/res/templates/inbound-email/fields/folder/edit.tpl index bb60aadcb5..88c42c50c4 100644 --- a/frontend/client/modules/crm/res/templates/inbound-email/fields/folder/edit.tpl +++ b/frontend/client/modules/crm/res/templates/inbound-email/fields/folder/edit.tpl @@ -1,8 +1,8 @@
- - + + - +
diff --git a/frontend/client/modules/crm/res/templates/inbound-email/modals/select-folder.tpl b/frontend/client/modules/crm/res/templates/inbound-email/modals/select-folder.tpl index 5bb8d78c3f..f62dd3f962 100644 --- a/frontend/client/modules/crm/res/templates/inbound-email/modals/select-folder.tpl +++ b/frontend/client/modules/crm/res/templates/inbound-email/modals/select-folder.tpl @@ -1,11 +1,11 @@ {{#unless folders}} - {{translate 'No Data'}} + {{translate 'No Data'}} {{/unless}}
    {{#each folders}} -
  • - {{./this}} - -
  • +
  • + {{./this}} + +
  • {{/each}}
diff --git a/frontend/client/modules/crm/res/templates/lead/convert.tpl b/frontend/client/modules/crm/res/templates/lead/convert.tpl index 4726914ad7..4ec990a7f8 100644 --- a/frontend/client/modules/crm/res/templates/lead/convert.tpl +++ b/frontend/client/modules/crm/res/templates/lead/convert.tpl @@ -1,21 +1,21 @@
{{#each scopes}}
- -
- {{{var this ../this}}} -
+ +
+ {{{var this ../this}}} +
{{/each}}
- - + +
diff --git a/frontend/client/modules/crm/res/templates/opportunity/fields/lead-source/edit.tpl b/frontend/client/modules/crm/res/templates/opportunity/fields/lead-source/edit.tpl index 55c7536890..2c752c5ff0 100644 --- a/frontend/client/modules/crm/res/templates/opportunity/fields/lead-source/edit.tpl +++ b/frontend/client/modules/crm/res/templates/opportunity/fields/lead-source/edit.tpl @@ -1,4 +1,4 @@ diff --git a/frontend/client/modules/crm/res/templates/opportunity/fields/lead-source/search.tpl b/frontend/client/modules/crm/res/templates/opportunity/fields/lead-source/search.tpl index ee69c1780b..ead6856bab 100644 --- a/frontend/client/modules/crm/res/templates/opportunity/fields/lead-source/search.tpl +++ b/frontend/client/modules/crm/res/templates/opportunity/fields/lead-source/search.tpl @@ -1,3 +1,3 @@ diff --git a/frontend/client/modules/crm/res/templates/record/panels/activities.tpl b/frontend/client/modules/crm/res/templates/record/panels/activities.tpl index a89701461f..45a1b27cbb 100644 --- a/frontend/client/modules/crm/res/templates/record/panels/activities.tpl +++ b/frontend/client/modules/crm/res/templates/record/panels/activities.tpl @@ -1,11 +1,11 @@
- - {{#each scopeList}} - - {{/each}} + + {{#each scopeList}} + + {{/each}}
- {{{list}}} + {{{list}}}
diff --git a/frontend/client/modules/crm/res/templates/record/panels/tasks.tpl b/frontend/client/modules/crm/res/templates/record/panels/tasks.tpl index 62500d9070..cbef235507 100644 --- a/frontend/client/modules/crm/res/templates/record/panels/tasks.tpl +++ b/frontend/client/modules/crm/res/templates/record/panels/tasks.tpl @@ -1,10 +1,10 @@
- {{#each tabList}} - - {{/each}} + {{#each tabList}} + + {{/each}}
- {{{list}}} + {{{list}}}
diff --git a/frontend/client/modules/crm/res/templates/task/fields/date-end/detail.tpl b/frontend/client/modules/crm/res/templates/task/fields/date-end/detail.tpl index f2d80efd07..1b85e9bf34 100644 --- a/frontend/client/modules/crm/res/templates/task/fields/date-end/detail.tpl +++ b/frontend/client/modules/crm/res/templates/task/fields/date-end/detail.tpl @@ -1,7 +1,7 @@ {{#if isOverdue}} - + {{/if}} {{value}} {{#if isOverdue}} - + {{/if}} diff --git a/frontend/client/modules/crm/src/controllers/calendar.js b/frontend/client/modules/crm/src/controllers/calendar.js index 7e60cdf57b..52bfdc7366 100644 --- a/frontend/client/modules/crm/src/controllers/calendar.js +++ b/frontend/client/modules/crm/src/controllers/calendar.js @@ -20,20 +20,20 @@ ************************************************************************/ Espo.define('Crm:Controllers.Calendar', 'Controller', function (Dep) { - - return Dep.extend({ - - show: function (options) { - this.index(options); - }, - - index: function (options) { - this.main('Crm:CalendarPage', { - date: options.date, - mode: options.mode, - }); - }, - }); + + return Dep.extend({ + + show: function (options) { + this.index(options); + }, + + index: function (options) { + this.main('Crm:CalendarPage', { + date: options.date, + mode: options.mode, + }); + }, + }); }); diff --git a/frontend/client/modules/crm/src/controllers/inbound-email.js b/frontend/client/modules/crm/src/controllers/inbound-email.js index 6e9015f65a..4c3fd58849 100644 --- a/frontend/client/modules/crm/src/controllers/inbound-email.js +++ b/frontend/client/modules/crm/src/controllers/inbound-email.js @@ -20,17 +20,17 @@ ************************************************************************/ Espo.define('Crm:Controllers.InboundEmail', 'Controllers.Record', function (Dep) { - - return Dep.extend({ - - checkAccess: function () { - if (this.getUser().isAdmin()) { - return true; - } - return false; - }, - - }); + + return Dep.extend({ + + checkAccess: function () { + if (this.getUser().isAdmin()) { + return true; + } + return false; + }, + + }); }); diff --git a/frontend/client/modules/crm/src/controllers/lead.js b/frontend/client/modules/crm/src/controllers/lead.js index f40f098106..7d912ed332 100644 --- a/frontend/client/modules/crm/src/controllers/lead.js +++ b/frontend/client/modules/crm/src/controllers/lead.js @@ -20,16 +20,16 @@ ************************************************************************/ Espo.define('Crm:Controllers.Lead', 'Controllers.Record', function (Dep) { - - return Dep.extend({ - - convert: function (id) { - this.main('Crm:Lead.Convert', { - id: id - }); - }, - - }); + + return Dep.extend({ + + convert: function (id) { + this.main('Crm:Lead.Convert', { + id: id + }); + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/account/detail.js b/frontend/client/modules/crm/src/views/account/detail.js index ee858b291d..ab8fa3fc5f 100644 --- a/frontend/client/modules/crm/src/views/account/detail.js +++ b/frontend/client/modules/crm/src/views/account/detail.js @@ -21,20 +21,20 @@ Espo.define('Crm:Views.Account.Detail', 'Views.Detail', function (Dep) { - return Dep.extend({ - - relatedAttributeMap: { - 'contacts': { - 'billingAddressCity': 'addressCity', - 'billingAddressStreet': 'addressStreet', - 'billingAddressPostalCode': 'addressPostalCode', - 'billingAddressState': 'addressState', - 'billingAddressCountry': 'addressCountry', - 'id': 'accountId', - 'name': 'accountName' - }, - }, - - }); + return Dep.extend({ + + relatedAttributeMap: { + 'contacts': { + 'billingAddressCity': 'addressCity', + 'billingAddressStreet': 'addressStreet', + 'billingAddressPostalCode': 'addressPostalCode', + 'billingAddressState': 'addressState', + 'billingAddressCountry': 'addressCountry', + 'id': 'accountId', + 'name': 'accountName' + }, + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/account/fields/shipping-address.js b/frontend/client/modules/crm/src/views/account/fields/shipping-address.js index 3b890b7097..ee4d4298d2 100644 --- a/frontend/client/modules/crm/src/views/account/fields/shipping-address.js +++ b/frontend/client/modules/crm/src/views/account/fields/shipping-address.js @@ -21,32 +21,32 @@ Espo.define('Crm:Views.Account.Fields.ShippingAddress', 'Views.Fields.Address', function (Dep) { - return Dep.extend({ - - copyFrom: 'billingAddress', - - afterRender: function () { - Dep.prototype.afterRender.call(this); - - if (this.mode == 'edit') { - var label = this.translate('Copy Billing', 'labels', 'Accounts'); - $btn = $('').on('click', function () { - this.copy(this.copyFrom); - }.bind(this)); - this.$el.append($btn); - } - }, - - copy: function (fieldFrom) { - var attrList = Object.keys(this.getMetadata().get('fields.address.fields')).forEach(function (attr) { - destField = this.name + Espo.Utils.upperCaseFirst(attr); - sourceField = fieldFrom + Espo.Utils.upperCaseFirst(attr); - - this.model.set(destField, this.model.get(sourceField)); - }, this); - - }, - - }); + return Dep.extend({ + + copyFrom: 'billingAddress', + + afterRender: function () { + Dep.prototype.afterRender.call(this); + + if (this.mode == 'edit') { + var label = this.translate('Copy Billing', 'labels', 'Accounts'); + $btn = $('').on('click', function () { + this.copy(this.copyFrom); + }.bind(this)); + this.$el.append($btn); + } + }, + + copy: function (fieldFrom) { + var attrList = Object.keys(this.getMetadata().get('fields.address.fields')).forEach(function (attr) { + destField = this.name + Espo.Utils.upperCaseFirst(attr); + sourceField = fieldFrom + Espo.Utils.upperCaseFirst(attr); + + this.model.set(destField, this.model.get(sourceField)); + }, this); + + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/calendar-page.js b/frontend/client/modules/crm/src/views/calendar-page.js index 285d50fd69..a66a95e767 100644 --- a/frontend/client/modules/crm/src/views/calendar-page.js +++ b/frontend/client/modules/crm/src/views/calendar-page.js @@ -21,32 +21,32 @@ Espo.define('Crm:Views.CalendarPage', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'crm:calendar-page', - - el: '#main', + template: 'crm:calendar-page', + + el: '#main', - setup: function () { - this.createView('calendar', 'Crm:Calendar.Calendar', { - date: this.options.date, - mode: this.options.mode, - el: '#main > .calendar-container', - }, function (view) { - var first = true; - this.listenTo(view, 'view', function (date, mode) { - if (!first) { - this.getRouter().navigate('#Calendar/show/date=' + date + '&mode=' + mode); - } - first = false; - }.bind(this)); - }.bind(this)); - }, - - updatePageTitle: function () { - this.setPageTitle(this.translate('Calendar', 'scopeNames')); - }, - }); + setup: function () { + this.createView('calendar', 'Crm:Calendar.Calendar', { + date: this.options.date, + mode: this.options.mode, + el: '#main > .calendar-container', + }, function (view) { + var first = true; + this.listenTo(view, 'view', function (date, mode) { + if (!first) { + this.getRouter().navigate('#Calendar/show/date=' + date + '&mode=' + mode); + } + first = false; + }.bind(this)); + }.bind(this)); + }, + + updatePageTitle: function () { + this.setPageTitle(this.translate('Calendar', 'scopeNames')); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/calendar/calendar.js b/frontend/client/modules/crm/src/views/calendar/calendar.js index a65e579f3c..dfba6397b2 100644 --- a/frontend/client/modules/crm/src/views/calendar/calendar.js +++ b/frontend/client/modules/crm/src/views/calendar/calendar.js @@ -20,332 +20,332 @@ ************************************************************************/ Espo.define('Crm:Views.Calendar.Calendar', ['View', 'lib!FullCalendar'], function (Dep, FullCalendar) { - - return Dep.extend({ + + return Dep.extend({ - template: 'crm:calendar.calendar', + template: 'crm:calendar.calendar', - eventAttributes: [], + eventAttributes: [], - colors: { - 'Meeting': '#558BBD', - 'Call': '#cf605d', - 'Task': '#76BA4E', - }, + colors: { + 'Meeting': '#558BBD', + 'Call': '#cf605d', + 'Task': '#76BA4E', + }, - header: true, + header: true, - modeList: ['month', 'agendaWeek', 'agendaDay'], + modeList: ['month', 'agendaWeek', 'agendaDay'], - defaultMode: 'agendaWeek', - - slotMinutes: 30, + defaultMode: 'agendaWeek', + + slotMinutes: 30, - titleFormat: { - month: 'MMMM YYYY', - week: 'MMMM D, YYYY', - day: 'dddd, MMMM D, YYYY' - }, + titleFormat: { + month: 'MMMM YYYY', + week: 'MMMM D, YYYY', + day: 'dddd, MMMM D, YYYY' + }, - data: function () { - return { - mode: this.mode, - modeList: this.modeList, - header: this.header, - }; - }, + data: function () { + return { + mode: this.mode, + modeList: this.modeList, + header: this.header, + }; + }, - events: { - 'click button[data-action="prev"]': function () { - this.$calendar.fullCalendar('prev'); - this.updateDate(); - }, - 'click button[data-action="next"]': function () { - this.$calendar.fullCalendar('next'); - this.updateDate(); - }, - 'click button[data-action="today"]': function () { - this.$calendar.fullCalendar('today'); - this.updateDate(); - }, - 'click button[data-action="mode"]': function (e) { - var mode = $(e.currentTarget).data('mode'); - this.$el.find('button[data-action="mode"]').removeClass('active'); - this.$el.find('button[data-mode="' + mode + '"]').addClass('active'); - this.$calendar.fullCalendar('changeView', mode); - this.updateDate(); - }, - }, + events: { + 'click button[data-action="prev"]': function () { + this.$calendar.fullCalendar('prev'); + this.updateDate(); + }, + 'click button[data-action="next"]': function () { + this.$calendar.fullCalendar('next'); + this.updateDate(); + }, + 'click button[data-action="today"]': function () { + this.$calendar.fullCalendar('today'); + this.updateDate(); + }, + 'click button[data-action="mode"]': function (e) { + var mode = $(e.currentTarget).data('mode'); + this.$el.find('button[data-action="mode"]').removeClass('active'); + this.$el.find('button[data-mode="' + mode + '"]').addClass('active'); + this.$calendar.fullCalendar('changeView', mode); + this.updateDate(); + }, + }, - setup: function () { - this.date = this.options.date || null; - this.mode = this.options.mode || this.defaultMode; - this.header = ('header' in this.options) ? this.options.header : this.header; - this.slotMinutes = this.options.slotMinutes || this.slotMinutes; - }, + setup: function () { + this.date = this.options.date || null; + this.mode = this.options.mode || this.defaultMode; + this.header = ('header' in this.options) ? this.options.header : this.header; + this.slotMinutes = this.options.slotMinutes || this.slotMinutes; + }, - updateDate: function () { - if (!this.header) { - return; - } - var view = this.$calendar.fullCalendar('getView'); - var today = new Date(); - - if (view.start <= today && today < view.end) { - this.$el.find('button[data-action="today"]').addClass('active'); - } else { - this.$el.find('button[data-action="today"]').removeClass('active'); - } + updateDate: function () { + if (!this.header) { + return; + } + var view = this.$calendar.fullCalendar('getView'); + var today = new Date(); + + if (view.start <= today && today < view.end) { + this.$el.find('button[data-action="today"]').addClass('active'); + } else { + this.$el.find('button[data-action="today"]').removeClass('active'); + } - var map = { - 'agendaWeek': 'week', - 'agendaDay': 'day', - 'basicWeek': 'week', - 'basicDay': 'day', - }; + var map = { + 'agendaWeek': 'week', + 'agendaDay': 'day', + 'basicWeek': 'week', + 'basicDay': 'day', + }; - var viewName = map[view.name] || view.name - - var title; - - if (viewName == 'week') { - title = $.fullCalendar.formatRange(view.start, view.end, this.titleFormat[viewName], ' - '); - } else { - title = view.intervalStart.format(this.titleFormat[viewName]); - } - this.$el.find('.date-title h4').text(title); - }, + var viewName = map[view.name] || view.name + + var title; + + if (viewName == 'week') { + title = $.fullCalendar.formatRange(view.start, view.end, this.titleFormat[viewName], ' - '); + } else { + title = view.intervalStart.format(this.titleFormat[viewName]); + } + this.$el.find('.date-title h4').text(title); + }, - convertToFcEvent: function (o) { - var event = { - title: o.name, - scope: o.scope, - id: o.scope + '-' + o.id, - recordId: o.id, - dateStart: o.dateStart, - dateEnd: o.dateEnd, - }; - this.eventAttributes.forEach(function (attr) { - event[attr] = o[attr]; - }); - if (o.dateStart) { - event.start = this.getDateTime().toMoment(o.dateStart); - } - if (o.dateEnd) { - event.end = this.getDateTime().toMoment(o.dateEnd); - } - if (!event.start || !event.end) { - event.allDay = true; - if (event.end) { - event.start = event.end; - } - } else { - var start = new Date(event.start); - var end = new Date(event.end); - if ((start.getDate() != end.getDate()) || (end - start >= 86400000)) { - event.allDay = true; - } else { - event.allDay = false; - if (end - start < 1800000) { - var m = event.start.add('minutes', 30); - event.end = m.format(); - } - } - } + convertToFcEvent: function (o) { + var event = { + title: o.name, + scope: o.scope, + id: o.scope + '-' + o.id, + recordId: o.id, + dateStart: o.dateStart, + dateEnd: o.dateEnd, + }; + this.eventAttributes.forEach(function (attr) { + event[attr] = o[attr]; + }); + if (o.dateStart) { + event.start = this.getDateTime().toMoment(o.dateStart); + } + if (o.dateEnd) { + event.end = this.getDateTime().toMoment(o.dateEnd); + } + if (!event.start || !event.end) { + event.allDay = true; + if (event.end) { + event.start = event.end; + } + } else { + var start = new Date(event.start); + var end = new Date(event.end); + if ((start.getDate() != end.getDate()) || (end - start >= 86400000)) { + event.allDay = true; + } else { + event.allDay = false; + if (end - start < 1800000) { + var m = event.start.add('minutes', 30); + event.end = m.format(); + } + } + } - event.color = this.colors[o.scope]; - return event; - }, + event.color = this.colors[o.scope]; + return event; + }, - convertToFcEvents: function (list) { - var events = []; - list.forEach(function (o) { - event = this.convertToFcEvent(o); - events.push(event) - }.bind(this)); - return events; - }, - - convertTime: function (d) { - var format = this.getDateTime().internalDateTimeFormat; - var timeZone = this.getDateTime().timeZone; - var string = d.format(format); - - var m; - if (timeZone) { - m = moment.tz(string, format, timeZone).utc(); - } else { - m = moment.utc(string, format); - } - - return m.format(format) + ':00'; - }, + convertToFcEvents: function (list) { + var events = []; + list.forEach(function (o) { + event = this.convertToFcEvent(o); + events.push(event) + }.bind(this)); + return events; + }, + + convertTime: function (d) { + var format = this.getDateTime().internalDateTimeFormat; + var timeZone = this.getDateTime().timeZone; + var string = d.format(format); + + var m; + if (timeZone) { + m = moment.tz(string, format, timeZone).utc(); + } else { + m = moment.utc(string, format); + } + + return m.format(format) + ':00'; + }, - afterRender: function () { - var $calendar = this.$calendar = this.$el.find('div.calendar'); + afterRender: function () { + var $calendar = this.$calendar = this.$el.find('div.calendar'); - var options = { - header: false, - axisFormat: this.getDateTime().timeFormat, - timeFormat: this.getDateTime().timeFormat, - defaultView: this.mode, - weekNumbers: true, - editable: true, - aspectRatio: 1.62, - selectable: true, - selectHelper: true, - ignoreTimezone: true, - height: this.options.height || null, - firstDay: this.getPreferences().get('weekStart'), - slotEventOverlap: true, - snapDuration: 15 * 60 * 1000, - timezone: this.getDateTime().timeZone, - select: function (start, end, allDay) { - var dateStart = this.convertTime(start); - var dateEnd = this.convertTime(end); - - this.notify('Loading...'); - this.createView('quickEdit', 'Crm:Calendar.Modals.Edit', { - attributes: { - dateStart: dateStart, - dateEnd: dateEnd, - }, - }, function (view) { - view.render(); - view.notify(false); - }); - $calendar.fullCalendar('unselect'); - }.bind(this), - eventClick: function (event) { - this.notify('Loading...'); - this.createView('quickEdit', 'Crm:Calendar.Modals.Edit', { - scope: event.scope, - id: event.recordId - }, function (view) { - view.render(); - view.notify(false); - }); - }.bind(this), - viewRender: function (view, el) { - var mode = view.name; - var date = this.getDateTime().fromIso(this.$calendar.fullCalendar('getDate')); - - var m = moment(this.$calendar.fullCalendar('getDate')); - this.trigger('view', m.format('YYYY-MM-DD'), mode); - }.bind(this), - events: function (from, to, timezone, callback) { - var fromServer = this.getDateTime().fromIso(from); - var toServer = this.getDateTime().fromIso(to); - - this.fetchEvents(fromServer, toServer, callback); - }.bind(this), - eventDrop: function (event, delta, callback) { - var dateStart = this.convertTime(event.start) || null; - var dateEnd = this.convertTime(event.end) || null; - - var attributes = {}; - if (!event.dateStart && event.dateEnd) { - attributes.dateEnd = dateStart; - event.dateEnd = attributes.dateEnd; - } else { - if (event.dateStart) { - attributes.dateStart = dateStart; - event.dateStart = dateStart; - } - if (event.dateEnd) { - attributes.dateEnd = dateEnd; - event.dateEnd = dateEnd; - } - } + var options = { + header: false, + axisFormat: this.getDateTime().timeFormat, + timeFormat: this.getDateTime().timeFormat, + defaultView: this.mode, + weekNumbers: true, + editable: true, + aspectRatio: 1.62, + selectable: true, + selectHelper: true, + ignoreTimezone: true, + height: this.options.height || null, + firstDay: this.getPreferences().get('weekStart'), + slotEventOverlap: true, + snapDuration: 15 * 60 * 1000, + timezone: this.getDateTime().timeZone, + select: function (start, end, allDay) { + var dateStart = this.convertTime(start); + var dateEnd = this.convertTime(end); + + this.notify('Loading...'); + this.createView('quickEdit', 'Crm:Calendar.Modals.Edit', { + attributes: { + dateStart: dateStart, + dateEnd: dateEnd, + }, + }, function (view) { + view.render(); + view.notify(false); + }); + $calendar.fullCalendar('unselect'); + }.bind(this), + eventClick: function (event) { + this.notify('Loading...'); + this.createView('quickEdit', 'Crm:Calendar.Modals.Edit', { + scope: event.scope, + id: event.recordId + }, function (view) { + view.render(); + view.notify(false); + }); + }.bind(this), + viewRender: function (view, el) { + var mode = view.name; + var date = this.getDateTime().fromIso(this.$calendar.fullCalendar('getDate')); + + var m = moment(this.$calendar.fullCalendar('getDate')); + this.trigger('view', m.format('YYYY-MM-DD'), mode); + }.bind(this), + events: function (from, to, timezone, callback) { + var fromServer = this.getDateTime().fromIso(from); + var toServer = this.getDateTime().fromIso(to); + + this.fetchEvents(fromServer, toServer, callback); + }.bind(this), + eventDrop: function (event, delta, callback) { + var dateStart = this.convertTime(event.start) || null; + var dateEnd = this.convertTime(event.end) || null; + + var attributes = {}; + if (!event.dateStart && event.dateEnd) { + attributes.dateEnd = dateStart; + event.dateEnd = attributes.dateEnd; + } else { + if (event.dateStart) { + attributes.dateStart = dateStart; + event.dateStart = dateStart; + } + if (event.dateEnd) { + attributes.dateEnd = dateEnd; + event.dateEnd = dateEnd; + } + } - if (!(event.dateStart && event.dateEnd)) { - event.allDay = true; - } else { - var start = new Date(event.start); - var end = new Date(event.end); - if ((start.getDate() != end.getDate()) || (end - start >= 86400000)) { - event.allDay = true; - } - } + if (!(event.dateStart && event.dateEnd)) { + event.allDay = true; + } else { + var start = new Date(event.start); + var end = new Date(event.end); + if ((start.getDate() != end.getDate()) || (end - start >= 86400000)) { + event.allDay = true; + } + } - this.$calendar.fullCalendar('renderEvent', event); - - this.notify('Saving...'); - this.getModelFactory().create(event.scope, function (model) { - model.once('sync', function () { - this.notify(false); - }.bind(this)); - model.id = event.recordId; - model.save(attributes, {patch: true}); - }, this); - }.bind(this), - eventResize: function (event) { - var attributes = { - dateEnd: this.convertTime(event.end) - }; - this.notify('Saving...'); - this.getModelFactory().create(event.scope, function (model) { - model.once('sync', function () { - this.notify(false); - }.bind(this)); - model.id = event.recordId; - model.save(attributes, {patch: true}); - }.bind(this)); - }.bind(this), - allDayText: '', - firstHour: 8, - columnFormat: { - week: 'ddd DD', - day: 'ddd DD', - }, - weekNumberTitle: '', - }; + this.$calendar.fullCalendar('renderEvent', event); + + this.notify('Saving...'); + this.getModelFactory().create(event.scope, function (model) { + model.once('sync', function () { + this.notify(false); + }.bind(this)); + model.id = event.recordId; + model.save(attributes, {patch: true}); + }, this); + }.bind(this), + eventResize: function (event) { + var attributes = { + dateEnd: this.convertTime(event.end) + }; + this.notify('Saving...'); + this.getModelFactory().create(event.scope, function (model) { + model.once('sync', function () { + this.notify(false); + }.bind(this)); + model.id = event.recordId; + model.save(attributes, {patch: true}); + }.bind(this)); + }.bind(this), + allDayText: '', + firstHour: 8, + columnFormat: { + week: 'ddd DD', + day: 'ddd DD', + }, + weekNumberTitle: '', + }; - if (this.date) { - options.defaultDate = moment.utc(this.date); - } + if (this.date) { + options.defaultDate = moment.utc(this.date); + } - setTimeout(function () { - $calendar.fullCalendar(options); - this.updateDate(); - }.bind(this), 150); - }, + setTimeout(function () { + $calendar.fullCalendar(options); + this.updateDate(); + }.bind(this), 150); + }, - fetchEvents: function (from, to, callback) { - $.ajax({ - url: 'Activities?from=' + from + '&to=' + to, - success: function (data) { - var events = this.convertToFcEvents(data); - callback(events); - this.notify(false); - }.bind(this) - }); - }, + fetchEvents: function (from, to, callback) { + $.ajax({ + url: 'Activities?from=' + from + '&to=' + to, + success: function (data) { + var events = this.convertToFcEvents(data); + callback(events); + this.notify(false); + }.bind(this) + }); + }, - addModel: function (model) { - var d = model.attributes; - d.scope = model.name; - var event = this.convertToFcEvent(d); - this.$calendar.fullCalendar('renderEvent', event); - }, + addModel: function (model) { + var d = model.attributes; + d.scope = model.name; + var event = this.convertToFcEvent(d); + this.$calendar.fullCalendar('renderEvent', event); + }, - updateModel: function (model) { - var events = this.$calendar.fullCalendar('clientEvents', model.name + '-' + model.id); - events.forEach(function (event) { - var d = model.attributes; - d.scope = model.name; - var data = this.convertToFcEvent(d); - for (var key in data) { - event[key] = data[key]; - } - this.$calendar.fullCalendar('updateEvent', event); - }.bind(this)); - }, - - removeModel: function (model) { - this.$calendar.fullCalendar('removeEvents', model.name + '-' + model.id); - } + updateModel: function (model) { + var events = this.$calendar.fullCalendar('clientEvents', model.name + '-' + model.id); + events.forEach(function (event) { + var d = model.attributes; + d.scope = model.name; + var data = this.convertToFcEvent(d); + for (var key in data) { + event[key] = data[key]; + } + this.$calendar.fullCalendar('updateEvent', event); + }.bind(this)); + }, + + removeModel: function (model) { + this.$calendar.fullCalendar('removeEvents', model.name + '-' + model.id); + } - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/calendar/modals/edit.js b/frontend/client/modules/crm/src/views/calendar/modals/edit.js index bda4df1e97..8b79875fc1 100644 --- a/frontend/client/modules/crm/src/views/calendar/modals/edit.js +++ b/frontend/client/modules/crm/src/views/calendar/modals/edit.js @@ -21,95 +21,95 @@ Espo.define('Crm:Views.Calendar.Modals.Edit', 'Views.Modals.Edit', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'crm:calendar.modals.edit', + template: 'crm:calendar.modals.edit', - scopeList: [ - 'Meeting', - 'Call', - 'Task', - ], - - data: function () { - return { - scopeList: this.scopeList, - scope: this.scope, - isNew: !(this.id) - }; - }, - - events: { - 'change .scope-switcher input[name="scope"]': function () { - this.notify('Loading...'); - var scope = $('.scope-switcher input[name="scope"]:checked').val(); - this.scope = scope; - this.getModelFactory().create(this.scope, function (model) { - model.populateDefaults(); - var attributes = this.getView('edit').fetch(); - attributes = _.extend(attributes, this.getView('edit').model.toJSON()); - model.set(attributes); - this.createEdit(model, function (view) { - view.render(); - view.notify(false); - }); - }.bind(this)); - }, - }, - - disableButtons: function () { - - }, + scopeList: [ + 'Meeting', + 'Call', + 'Task', + ], + + data: function () { + return { + scopeList: this.scopeList, + scope: this.scope, + isNew: !(this.id) + }; + }, + + events: { + 'change .scope-switcher input[name="scope"]': function () { + this.notify('Loading...'); + var scope = $('.scope-switcher input[name="scope"]:checked').val(); + this.scope = scope; + this.getModelFactory().create(this.scope, function (model) { + model.populateDefaults(); + var attributes = this.getView('edit').fetch(); + attributes = _.extend(attributes, this.getView('edit').model.toJSON()); + model.set(attributes); + this.createEdit(model, function (view) { + view.render(); + view.notify(false); + }); + }.bind(this)); + }, + }, + + disableButtons: function () { + + }, - setup: function () { - if (!this.options.id && !this.options.scope) { - this.options.scope = this.getConfig().get('calendarDefaultEntity', this.scopeList[0]); - } - Dep.prototype.setup.call(this); - - if (!this.id) { - this.header = this.translate('Create', 'labels', 'Calendar'); - } - - if (this.id) { - this.buttons.splice(1, 0, { - name: 'remove', - text: this.translate('Remove'), - style: 'danger', - onClick: function (dialog) { - var model = this.getView('edit').model; - - if (confirm(this.translate('removeRecordConfirmation', 'messages'))) { - var $buttons = dialog.$el.find('.modal-footer button'); - $buttons.addClass('disabled'); - model.destroy({ - success: function () { - this.trigger('after:destroy', model); - dialog.close(); - }.bind(this), - error: function () { - $buttons.removeClass('disabled'); - }, - }); - } - }.bind(this) - }); - } - - this.once('after:save', function (model) { - var parentView = this.getParentView(); - if (!this.id) { - parentView.addModel.call(parentView, model); - } else { - parentView.updateModel.call(parentView, model); - } - }.bind(this)); - - this.once('after:destroy', function (model) { - var parentView = this.getParentView(); - parentView.removeModel.call(parentView, model); - }.bind(this)); - }, - }); + setup: function () { + if (!this.options.id && !this.options.scope) { + this.options.scope = this.getConfig().get('calendarDefaultEntity', this.scopeList[0]); + } + Dep.prototype.setup.call(this); + + if (!this.id) { + this.header = this.translate('Create', 'labels', 'Calendar'); + } + + if (this.id) { + this.buttons.splice(1, 0, { + name: 'remove', + text: this.translate('Remove'), + style: 'danger', + onClick: function (dialog) { + var model = this.getView('edit').model; + + if (confirm(this.translate('removeRecordConfirmation', 'messages'))) { + var $buttons = dialog.$el.find('.modal-footer button'); + $buttons.addClass('disabled'); + model.destroy({ + success: function () { + this.trigger('after:destroy', model); + dialog.close(); + }.bind(this), + error: function () { + $buttons.removeClass('disabled'); + }, + }); + } + }.bind(this) + }); + } + + this.once('after:save', function (model) { + var parentView = this.getParentView(); + if (!this.id) { + parentView.addModel.call(parentView, model); + } else { + parentView.updateModel.call(parentView, model); + } + }.bind(this)); + + this.once('after:destroy', function (model) { + var parentView = this.getParentView(); + parentView.removeModel.call(parentView, model); + }.bind(this)); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/call/detail.js b/frontend/client/modules/crm/src/views/call/detail.js index f7dea828f2..9810249da2 100644 --- a/frontend/client/modules/crm/src/views/call/detail.js +++ b/frontend/client/modules/crm/src/views/call/detail.js @@ -21,81 +21,81 @@ Espo.define('Crm:Views.Call.Detail', 'Views.Detail', function (Dep) { - return Dep.extend({ + return Dep.extend({ - setup: function () { - Dep.prototype.setup.call(this); - if (['Held', 'Not Held'].indexOf(this.model.get('status')) == -1) { - if (this.getAcl().checkModel(this.model, 'edit')) { - this.menu.buttons.push({ - 'label': 'Send Invitations', - 'action': 'sendInvitations', - icon: 'glyphicon glyphicon-send', - 'acl': 'edit', - }); - this.menu.dropdown.push({ - 'label': 'Set Held', - 'action': 'setHeld', - 'acl': 'edit' - }); - this.menu.dropdown.push({ - 'label': 'Set Not Held', - 'action': 'setNotHeld', - 'acl': 'edit' - }); - } - } - }, - - actionSendInvitations: function () { - if (confirm(this.translate('confirmation', 'messages'))) { - this.$el.find('[data-action="sendInvitations"]').addClass('disabled'); - this.notify('Sending...'); - $.ajax({ - url: 'Call/action/sendInvitations', - type: 'POST', - data: JSON.stringify({ - id: this.model.id - }), - success: function () { - this.notify('Sent', 'success'); - this.$el.find('[data-action="sendInvitations"]').removeClass('disabled'); - }.bind(this), - error: function () { - this.$el.find('[data-action="sendInvitations"]').removeClass('disabled'); - }.bind(this), - }); - } - }, - - actionSetHeld: function () { - this.model.save({ - status: 'Held' - }, { - patch: true, - success: function () { - this.notify('Saved', 'success'); - this.$el.find('[data-action="sendInvitations"]').remove(); - this.$el.find('[data-action="setHeld"]').remove(); - this.$el.find('[data-action="setNotHeld"]').remove(); - }.bind(this), - }); - }, - - actionSetNotHeld: function () { - this.model.save({ - status: 'Not Held' - }, { - patch: true, - success: function () { - this.notify('Saved', 'success'); - this.$el.find('[data-action="sendInvitations"]').remove(); - this.$el.find('[data-action="setHeld"]').remove(); - this.$el.find('[data-action="setNotHeld"]').remove(); - }.bind(this), - }); - }, + setup: function () { + Dep.prototype.setup.call(this); + if (['Held', 'Not Held'].indexOf(this.model.get('status')) == -1) { + if (this.getAcl().checkModel(this.model, 'edit')) { + this.menu.buttons.push({ + 'label': 'Send Invitations', + 'action': 'sendInvitations', + icon: 'glyphicon glyphicon-send', + 'acl': 'edit', + }); + this.menu.dropdown.push({ + 'label': 'Set Held', + 'action': 'setHeld', + 'acl': 'edit' + }); + this.menu.dropdown.push({ + 'label': 'Set Not Held', + 'action': 'setNotHeld', + 'acl': 'edit' + }); + } + } + }, + + actionSendInvitations: function () { + if (confirm(this.translate('confirmation', 'messages'))) { + this.$el.find('[data-action="sendInvitations"]').addClass('disabled'); + this.notify('Sending...'); + $.ajax({ + url: 'Call/action/sendInvitations', + type: 'POST', + data: JSON.stringify({ + id: this.model.id + }), + success: function () { + this.notify('Sent', 'success'); + this.$el.find('[data-action="sendInvitations"]').removeClass('disabled'); + }.bind(this), + error: function () { + this.$el.find('[data-action="sendInvitations"]').removeClass('disabled'); + }.bind(this), + }); + } + }, + + actionSetHeld: function () { + this.model.save({ + status: 'Held' + }, { + patch: true, + success: function () { + this.notify('Saved', 'success'); + this.$el.find('[data-action="sendInvitations"]').remove(); + this.$el.find('[data-action="setHeld"]').remove(); + this.$el.find('[data-action="setNotHeld"]').remove(); + }.bind(this), + }); + }, + + actionSetNotHeld: function () { + this.model.save({ + status: 'Not Held' + }, { + patch: true, + success: function () { + this.notify('Saved', 'success'); + this.$el.find('[data-action="sendInvitations"]').remove(); + this.$el.find('[data-action="setHeld"]').remove(); + this.$el.find('[data-action="setNotHeld"]').remove(); + }.bind(this), + }); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/call/list.js b/frontend/client/modules/crm/src/views/call/list.js index f5177c0fc9..2a7ff4b1c5 100644 --- a/frontend/client/modules/crm/src/views/call/list.js +++ b/frontend/client/modules/crm/src/views/call/list.js @@ -18,55 +18,55 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - + Espo.define('Crm:Views.Call.List', 'Views.List', function (Dep) { - return Dep.extend({ - - actionSetHeld: function (data) { - var id = data.id; - if (!id) { - return; - } - var model = this.collection.get(id); - if (!model) { - return; - } - - model.set('status', 'Held'); - - this.listenToOnce(model, 'sync', function () { - this.notify(false); - this.collection.fetch(); - }, this); - - this.notify('Saving...'); - model.save(); - - }, - - actionSetNotHeld: function (data) { - var id = data.id; - if (!id) { - return; - } - var model = this.collection.get(id); - if (!model) { - return; - } - - model.set('status', 'Not Held'); - - this.listenToOnce(model, 'sync', function () { - this.notify(false); - this.collection.fetch(); - }, this); - - this.notify('Saving...'); - model.save(); - - }, - - }); - + return Dep.extend({ + + actionSetHeld: function (data) { + var id = data.id; + if (!id) { + return; + } + var model = this.collection.get(id); + if (!model) { + return; + } + + model.set('status', 'Held'); + + this.listenToOnce(model, 'sync', function () { + this.notify(false); + this.collection.fetch(); + }, this); + + this.notify('Saving...'); + model.save(); + + }, + + actionSetNotHeld: function (data) { + var id = data.id; + if (!id) { + return; + } + var model = this.collection.get(id); + if (!model) { + return; + } + + model.set('status', 'Not Held'); + + this.listenToOnce(model, 'sync', function () { + this.notify(false); + this.collection.fetch(); + }, this); + + this.notify('Saving...'); + model.save(); + + }, + + }); + }); diff --git a/frontend/client/modules/crm/src/views/call/record/list.js b/frontend/client/modules/crm/src/views/call/record/list.js index d50d221f44..70b3a23960 100644 --- a/frontend/client/modules/crm/src/views/call/record/list.js +++ b/frontend/client/modules/crm/src/views/call/record/list.js @@ -18,13 +18,13 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - + Espo.define('Crm:Views.Call.Record.List', 'Views.Record.List', function (Dep) { - return Dep.extend({ - - rowActionsView: 'Crm:Call.Record.RowActions.Default', - - }); - + return Dep.extend({ + + rowActionsView: 'Crm:Call.Record.RowActions.Default', + + }); + }); diff --git a/frontend/client/modules/crm/src/views/call/record/row-actions/default.js b/frontend/client/modules/crm/src/views/call/record/row-actions/default.js index 31b3c9e933..fee53d6c0e 100644 --- a/frontend/client/modules/crm/src/views/call/record/row-actions/default.js +++ b/frontend/client/modules/crm/src/views/call/record/row-actions/default.js @@ -18,33 +18,33 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - + Espo.define('Crm:Views.Call.Record.RowActions.Default', 'Views.Record.RowActions.Default', function (Dep) { - return Dep.extend({ - - getActions: function () { - var actions = Dep.prototype.getActions.call(this); - - if (this.options.acl.edit && !~['Held', 'Not Held'].indexOf(this.model.get('status'))) { - actions.push({ - action: 'setHeld', - label: 'Set Held', - data: { - id: this.model.id - } - }); - actions.push({ - action: 'setNotHeld', - label: 'Set Not Held', - data: { - id: this.model.id - } - }); - } - - return actions; - }, - }); - + return Dep.extend({ + + getActions: function () { + var actions = Dep.prototype.getActions.call(this); + + if (this.options.acl.edit && !~['Held', 'Not Held'].indexOf(this.model.get('status'))) { + actions.push({ + action: 'setHeld', + label: 'Set Held', + data: { + id: this.model.id + } + }); + actions.push({ + action: 'setNotHeld', + label: 'Set Not Held', + data: { + id: this.model.id + } + }); + } + + return actions; + }, + }); + }); diff --git a/frontend/client/modules/crm/src/views/case/record/panels/activities.js b/frontend/client/modules/crm/src/views/case/record/panels/activities.js index 4adf5aa2f4..ea0537bb65 100644 --- a/frontend/client/modules/crm/src/views/case/record/panels/activities.js +++ b/frontend/client/modules/crm/src/views/case/record/panels/activities.js @@ -21,38 +21,38 @@ Espo.define('Crm:Views.Case.Record.Panels.Activities', 'Crm:Views.Record.Panels.Activities', function (Dep) { - return Dep.extend({ - - getComposeEmailAttributes: function (data, callback) { - data = data || {}; - var attributes = { - status: 'Draft', - name: '[#' + this.model.get('number') + '] ' + this.model.get('name') - }; - - if (this.model.get('contactId')) { - this.getModelFactory().create('Contact', function (contact) { - contact.id = this.model.get('contactId'); - - this.listenToOnce(contact, 'sync', function () { - var emailAddress = contact.get('emailAddress'); - if (emailAddress) { - attributes.to = emailAddress; - } - - callback.call(this, attributes); - }); - contact.fetch({ - error: function () { - callback.call(this, attributes); - }.bind(this) - }); - }, this); - } else { - callback.call(this, attributes); - } - }, - - }); + return Dep.extend({ + + getComposeEmailAttributes: function (data, callback) { + data = data || {}; + var attributes = { + status: 'Draft', + name: '[#' + this.model.get('number') + '] ' + this.model.get('name') + }; + + if (this.model.get('contactId')) { + this.getModelFactory().create('Contact', function (contact) { + contact.id = this.model.get('contactId'); + + this.listenToOnce(contact, 'sync', function () { + var emailAddress = contact.get('emailAddress'); + if (emailAddress) { + attributes.to = emailAddress; + } + + callback.call(this, attributes); + }); + contact.fetch({ + error: function () { + callback.call(this, attributes); + }.bind(this) + }); + }, this); + } else { + callback.call(this, attributes); + } + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/contact/detail.js b/frontend/client/modules/crm/src/views/contact/detail.js index daa66d50ee..a0ee0c9a34 100644 --- a/frontend/client/modules/crm/src/views/contact/detail.js +++ b/frontend/client/modules/crm/src/views/contact/detail.js @@ -21,48 +21,48 @@ Espo.define('Crm:Views.Contact.Detail', 'Views.Detail', function (Dep) { - return Dep.extend({ + return Dep.extend({ - relatedAttributeMap: { - 'opportunities': { - 'accountId': 'accountId', - 'accountName': 'accountName' - }, - 'cases': { - 'accountId': 'accountId', - 'accountName': 'accountName' - }, - }, - - selectRelatedFilters: { - 'cases': { - 'account': function () { - if (this.model.get('accountId')) { - return { - field: 'accountId', - type: 'equals', - value: this.model.get('accountId'), - valueName: this.model.get('accountName') - }; - } - }, - - }, - 'opportunities': { - 'account': function () { - if (this.model.get('accountId')) { - return { - field: 'accountId', - type: 'equals', - value: this.model.get('accountId'), - valueName: this.model.get('accountName') - }; - } - }, - - }, - }, - - }); + relatedAttributeMap: { + 'opportunities': { + 'accountId': 'accountId', + 'accountName': 'accountName' + }, + 'cases': { + 'accountId': 'accountId', + 'accountName': 'accountName' + }, + }, + + selectRelatedFilters: { + 'cases': { + 'account': function () { + if (this.model.get('accountId')) { + return { + field: 'accountId', + type: 'equals', + value: this.model.get('accountId'), + valueName: this.model.get('accountName') + }; + } + }, + + }, + 'opportunities': { + 'account': function () { + if (this.model.get('accountId')) { + return { + field: 'accountId', + type: 'equals', + value: this.model.get('accountId'), + valueName: this.model.get('accountName') + }; + } + }, + + }, + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/contact/fields/accounts.js b/frontend/client/modules/crm/src/views/contact/fields/accounts.js index 95e1297567..da771f5d1b 100644 --- a/frontend/client/modules/crm/src/views/contact/fields/accounts.js +++ b/frontend/client/modules/crm/src/views/contact/fields/accounts.js @@ -21,144 +21,144 @@ Espo.define('Crm:Views.Contact.Fields.Accounts', 'Views.Fields.LinkMultipleWithRole', function (Dep) { - return Dep.extend({ - - roleType: 'varchar', - - events: { - 'click [data-action="switchPrimary"]': function (e) { - $target = $(e.currentTarget); - var id = $target.data('id'); - - if (!$target.hasClass('active')) { - this.$el.find('button[data-action="switchPrimary"]').removeClass('active').children().addClass('text-muted'); - $target.addClass('active').children().removeClass('text-muted'); - this.setPrimaryId(id); - } - } - }, - - getAttributeList: function () { - var list = Dep.prototype.getAttributeList.call(this); - list.push('accountId'); - list.push('accountName'); - list.push('title'); - return list; - }, - - setup: function () { - Dep.prototype.setup.call(this); - - this.primaryIdFieldName = 'accountId'; - this.primaryNameFieldName = 'accountName'; - this.primaryRoleFieldName = 'title'; - - this.primaryId = this.model.get(this.primaryIdFieldName); - this.primaryName = this.model.get(this.primaryNameFieldName); - - this.listenTo(this.model, 'change:' + this.primaryIdFieldName, function () { - this.primaryId = this.model.get(this.primaryIdFieldName); - this.primaryName = this.model.get(this.primaryNameFieldName); - }.bind(this)); - }, - - setPrimaryId: function (id) { - this.primaryId = id; - if (id) { - this.primaryName = this.nameHash[id]; - } else { - this.primaryName = null; - } - - this.trigger('change'); - }, - - renderLinks: function () { - if (this.primaryId) { - this.addLinkHtml(this.primaryId, this.primaryName); - } - this.ids.forEach(function (id) { - if (id != this.primaryId) { - this.addLinkHtml(id, this.nameHash[id]); - } - }, this); - }, - - getValueForDisplay: function () { - if (this.mode == 'detail' || this.mode == 'list') { - var names = []; - if (this.primaryId) { - names.push(this.getDetailLinkHtml(this.primaryId, this.primaryName)); - } - this.ids.forEach(function (id) { - if (id != this.primaryId) { - names.push(this.getDetailLinkHtml(id)); - } - }, this); - return names.join(''); - } - }, - - deleteLink: function (id) { - if (id == this.primaryId) { - this.setPrimaryId(null); - } - Dep.prototype.deleteLink.call(this, id); - }, - - deleteLinkHtml: function (id) { - Dep.prototype.deleteLinkHtml.call(this, id); - this.managePrimaryButton(); - }, - - addLinkHtml: function (id, name) { - if (this.mode == 'search') { - return Dep.prototype.addLinkHtml.call(this, id, name); - } - - $el = Dep.prototype.addLinkHtml.call(this, id, name); - - var isPrimary = (id == this.primaryId); - - var iconHtml = ''; - var title = this.translate('Primary'); - - var $primary = $(''); - $primary.insertAfter($el.children().first().children().first()); - this.managePrimaryButton(); - }, - - afterRender: function () { - Dep.prototype.afterRender.call(this); - }, - - managePrimaryButton: function () { - var $primary = this.$el.find('button[data-action="switchPrimary"]'); - if ($primary.size() > 1) { - $primary.removeClass('hidden'); - } else { - $primary.addClass('hidden'); - } - - if ($primary.filter('.active').size() == 0) { - var $first = $primary.first(); - if ($first.size()) { - $first.addClass('active').children().removeClass('text-muted'); - this.setPrimaryId($first.data('id')); - } - } - }, - - fetch: function () { - var data = Dep.prototype.fetch.call(this); - - data[this.primaryIdFieldName] = this.primaryId; - data[this.primaryNameFieldName] = this.primaryName; - data[this.primaryRoleFieldName] = (this.columns[this.primaryId] || {}).role || ''; - - return data; - }, + return Dep.extend({ + + roleType: 'varchar', + + events: { + 'click [data-action="switchPrimary"]': function (e) { + $target = $(e.currentTarget); + var id = $target.data('id'); + + if (!$target.hasClass('active')) { + this.$el.find('button[data-action="switchPrimary"]').removeClass('active').children().addClass('text-muted'); + $target.addClass('active').children().removeClass('text-muted'); + this.setPrimaryId(id); + } + } + }, + + getAttributeList: function () { + var list = Dep.prototype.getAttributeList.call(this); + list.push('accountId'); + list.push('accountName'); + list.push('title'); + return list; + }, + + setup: function () { + Dep.prototype.setup.call(this); + + this.primaryIdFieldName = 'accountId'; + this.primaryNameFieldName = 'accountName'; + this.primaryRoleFieldName = 'title'; + + this.primaryId = this.model.get(this.primaryIdFieldName); + this.primaryName = this.model.get(this.primaryNameFieldName); + + this.listenTo(this.model, 'change:' + this.primaryIdFieldName, function () { + this.primaryId = this.model.get(this.primaryIdFieldName); + this.primaryName = this.model.get(this.primaryNameFieldName); + }.bind(this)); + }, + + setPrimaryId: function (id) { + this.primaryId = id; + if (id) { + this.primaryName = this.nameHash[id]; + } else { + this.primaryName = null; + } + + this.trigger('change'); + }, + + renderLinks: function () { + if (this.primaryId) { + this.addLinkHtml(this.primaryId, this.primaryName); + } + this.ids.forEach(function (id) { + if (id != this.primaryId) { + this.addLinkHtml(id, this.nameHash[id]); + } + }, this); + }, + + getValueForDisplay: function () { + if (this.mode == 'detail' || this.mode == 'list') { + var names = []; + if (this.primaryId) { + names.push(this.getDetailLinkHtml(this.primaryId, this.primaryName)); + } + this.ids.forEach(function (id) { + if (id != this.primaryId) { + names.push(this.getDetailLinkHtml(id)); + } + }, this); + return names.join(''); + } + }, + + deleteLink: function (id) { + if (id == this.primaryId) { + this.setPrimaryId(null); + } + Dep.prototype.deleteLink.call(this, id); + }, + + deleteLinkHtml: function (id) { + Dep.prototype.deleteLinkHtml.call(this, id); + this.managePrimaryButton(); + }, + + addLinkHtml: function (id, name) { + if (this.mode == 'search') { + return Dep.prototype.addLinkHtml.call(this, id, name); + } + + $el = Dep.prototype.addLinkHtml.call(this, id, name); + + var isPrimary = (id == this.primaryId); + + var iconHtml = ''; + var title = this.translate('Primary'); + + var $primary = $(''); + $primary.insertAfter($el.children().first().children().first()); + this.managePrimaryButton(); + }, + + afterRender: function () { + Dep.prototype.afterRender.call(this); + }, + + managePrimaryButton: function () { + var $primary = this.$el.find('button[data-action="switchPrimary"]'); + if ($primary.size() > 1) { + $primary.removeClass('hidden'); + } else { + $primary.addClass('hidden'); + } + + if ($primary.filter('.active').size() == 0) { + var $first = $primary.first(); + if ($first.size()) { + $first.addClass('active').children().removeClass('text-muted'); + this.setPrimaryId($first.data('id')); + } + } + }, + + fetch: function () { + var data = Dep.prototype.fetch.call(this); + + data[this.primaryIdFieldName] = this.primaryId; + data[this.primaryNameFieldName] = this.primaryName; + data[this.primaryRoleFieldName] = (this.columns[this.primaryId] || {}).role || ''; + + return data; + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/abstract/chart.js b/frontend/client/modules/crm/src/views/dashlets/abstract/chart.js index 24349963aa..5f7980df49 100644 --- a/frontend/client/modules/crm/src/views/dashlets/abstract/chart.js +++ b/frontend/client/modules/crm/src/views/dashlets/abstract/chart.js @@ -21,95 +21,95 @@ Espo.define('Crm:Views.Dashlets.Abstract.Chart', ['Views.Dashlets.Abstract.Base','lib!Flotr'], function (Dep, Flotr) { - return Dep.extend({ - - _template: '
', - - decimalMark: '.', - - thousandSeparator: ',', - - colors: ['#6FA8D6', '#4E6CAD', '#EDC555', '#ED8F42', '#DE6666', '#7CC4A4', '#8A7CC2', '#D4729B'], - - successColor: '#5ABD37', - - init: function () { - Dep.prototype.init.call(this); - - this.flotr = Flotr; - - if (this.getPreferences().has('decimalMark')) { - this.decimalMark = this.getPreferences().get('decimalMark') - } else { - if (this.getConfig().has('decimalMark')) { - this.decimalMark = this.getConfig().get('decimalMark') - } - } - if (this.getPreferences().has('thousandSeparator')) { - this.thousandSeparator = this.getPreferences().get('thousandSeparator') - } else { - if (this.getConfig().has('thousandSeparator')) { - this.thousandSeparator = this.getConfig().get('thousandSeparator') - } - } - - this.once('after:render', function () { - $(window).on('resize.chart' + this.name, function () { - this.drow(); - }.bind(this)); - }, this); - - this.once('remove', function () { - $(window).off('resize.chart' + this.name) - }, this); - }, - - formatNumber: function (value) { - if (value !== null) { - var parts = value.toString().split("."); - parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandSeparator); - if (parts[1] == 0) { - parts.splice(1, 1); - } - return parts.join(this.decimalMark); - } - return ''; - }, - - afterRender: function () { - this.fetch(function (data) { - this.chartData = this.prepareData(data); - - var $container = this.$container = this.$el.find('.chart-container'); - - var height = '245px'; - if (this.chartData.length > 5) { - height = '215px'; - } - $container.css('height', height); - - setTimeout(function () { - this.drow(); - }.bind(this), 1); - }); - }, - - url: function () {}, - - prepareData: function (response) { - return response; - }, - - fetch: function (callback) { - $.ajax({ - type: 'get', - url: this.url(), - success: function (response) { - callback.call(this, response); - }.bind(this) - }); - }, + return Dep.extend({ + + _template: '
', + + decimalMark: '.', + + thousandSeparator: ',', + + colors: ['#6FA8D6', '#4E6CAD', '#EDC555', '#ED8F42', '#DE6666', '#7CC4A4', '#8A7CC2', '#D4729B'], + + successColor: '#5ABD37', + + init: function () { + Dep.prototype.init.call(this); + + this.flotr = Flotr; + + if (this.getPreferences().has('decimalMark')) { + this.decimalMark = this.getPreferences().get('decimalMark') + } else { + if (this.getConfig().has('decimalMark')) { + this.decimalMark = this.getConfig().get('decimalMark') + } + } + if (this.getPreferences().has('thousandSeparator')) { + this.thousandSeparator = this.getPreferences().get('thousandSeparator') + } else { + if (this.getConfig().has('thousandSeparator')) { + this.thousandSeparator = this.getConfig().get('thousandSeparator') + } + } + + this.once('after:render', function () { + $(window).on('resize.chart' + this.name, function () { + this.drow(); + }.bind(this)); + }, this); + + this.once('remove', function () { + $(window).off('resize.chart' + this.name) + }, this); + }, + + formatNumber: function (value) { + if (value !== null) { + var parts = value.toString().split("."); + parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandSeparator); + if (parts[1] == 0) { + parts.splice(1, 1); + } + return parts.join(this.decimalMark); + } + return ''; + }, + + afterRender: function () { + this.fetch(function (data) { + this.chartData = this.prepareData(data); + + var $container = this.$container = this.$el.find('.chart-container'); + + var height = '245px'; + if (this.chartData.length > 5) { + height = '215px'; + } + $container.css('height', height); + + setTimeout(function () { + this.drow(); + }.bind(this), 1); + }); + }, + + url: function () {}, + + prepareData: function (response) { + return response; + }, + + fetch: function (callback) { + $.ajax({ + type: 'get', + url: this.url(), + success: function (response) { + callback.call(this, response); + }.bind(this) + }); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/calendar.js b/frontend/client/modules/crm/src/views/dashlets/calendar.js index 8e78b5b5ee..2337dd950d 100644 --- a/frontend/client/modules/crm/src/views/dashlets/calendar.js +++ b/frontend/client/modules/crm/src/views/dashlets/calendar.js @@ -21,22 +21,22 @@ Espo.define('Crm:Views.Dashlets.Calendar', 'Views.Dashlets.Abstract.Base', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'Calendar', + name: 'Calendar', - _template: '
{{{calendar}}}
', + _template: '
{{{calendar}}}
', - setup: function () { - this.createView('calendar', 'Crm:Calendar.Calendar', { - mode: 'agendaWeek', - el: this.$el.selector + ' > .calendar-container', - header: false, - height: 296, - }); - }, + setup: function () { + this.createView('calendar', 'Crm:Calendar.Calendar', { + mode: 'agendaWeek', + el: this.$el.selector + ' > .calendar-container', + header: false, + height: 296, + }); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/calls.js b/frontend/client/modules/crm/src/views/dashlets/calls.js index 033257ac54..127eae16d9 100644 --- a/frontend/client/modules/crm/src/views/dashlets/calls.js +++ b/frontend/client/modules/crm/src/views/dashlets/calls.js @@ -21,63 +21,63 @@ Espo.define('Crm:Views.Dashlets.Calls', 'Views.Dashlets.Abstract.RecordList', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'Calls', + name: 'Calls', - scope: 'Call', + scope: 'Call', - defaultOptions: { - sortBy: 'createdAt', - asc: false, - displayRecords: 5, - columnLayout: [ - { - name: 'name', - link: true, - sortable: false, - width: 40, - }, - { - name: 'status', - sortable: false, - }, - { - name: 'dateStart', - sortable: false, - } - ], - expandedLayout: { - rows: [ - [ - { - name: 'name', - link: true, - } - ], - [ - { - name: 'status' - }, - { - name: 'dateStart' - } - ] - ] - }, - searchData: { - bool: { - onlyMy: true, - }, - advanced: { - status: { - type: 'notIn', - value: ['Held', 'Not Held'] - } - } - }, - }, + defaultOptions: { + sortBy: 'createdAt', + asc: false, + displayRecords: 5, + columnLayout: [ + { + name: 'name', + link: true, + sortable: false, + width: 40, + }, + { + name: 'status', + sortable: false, + }, + { + name: 'dateStart', + sortable: false, + } + ], + expandedLayout: { + rows: [ + [ + { + name: 'name', + link: true, + } + ], + [ + { + name: 'status' + }, + { + name: 'dateStart' + } + ] + ] + }, + searchData: { + bool: { + onlyMy: true, + }, + advanced: { + status: { + type: 'notIn', + value: ['Held', 'Not Held'] + } + } + }, + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/cases.js b/frontend/client/modules/crm/src/views/dashlets/cases.js index 1a895a3ee0..56b986ce9c 100644 --- a/frontend/client/modules/crm/src/views/dashlets/cases.js +++ b/frontend/client/modules/crm/src/views/dashlets/cases.js @@ -22,56 +22,56 @@ Espo.define('Crm:Views.Dashlets.Cases', 'Views.Dashlets.Abstract.RecordList', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'Cases', + name: 'Cases', - scope: 'Case', + scope: 'Case', - defaultOptions: { - sortBy: 'number', - asc: false, - displayRecords: 5, - expandedLayout: { - rows: [ - [ - { - name: 'name', - link: true, - }, - { - name: 'number', - }, - { - name: 'type', - }, - ], - [ - { - name: 'status' - }, - { - name: 'priority' - } - ] - ] - }, - searchData: { - bool: { - onlyMy: true, - open: true, - }, - advanced: { - status: { - type: 'notIn', - value: ['Duplicate', 'Rejected', 'Closed'] - }, - }, + defaultOptions: { + sortBy: 'number', + asc: false, + displayRecords: 5, + expandedLayout: { + rows: [ + [ + { + name: 'name', + link: true, + }, + { + name: 'number', + }, + { + name: 'type', + }, + ], + [ + { + name: 'status' + }, + { + name: 'priority' + } + ] + ] + }, + searchData: { + bool: { + onlyMy: true, + open: true, + }, + advanced: { + status: { + type: 'notIn', + value: ['Duplicate', 'Rejected', 'Closed'] + }, + }, - }, - }, + }, + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/leads.js b/frontend/client/modules/crm/src/views/dashlets/leads.js index ac68692be2..cc2c6fd39e 100644 --- a/frontend/client/modules/crm/src/views/dashlets/leads.js +++ b/frontend/client/modules/crm/src/views/dashlets/leads.js @@ -21,51 +21,51 @@ Espo.define('Crm:Views.Dashlets.Leads', 'Views.Dashlets.Abstract.RecordList', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'Leads', + name: 'Leads', - scope: 'Lead', + scope: 'Lead', - defaultOptions: { - sortBy: 'createdAt', - asc: false, - displayRecords: 5, - expandedLayout: { - rows: [ - [ - { - name: 'name', - link: true, - }, - { - name: 'addressCity' - } - ], - [ - { - name: 'status' - }, - { - name: 'source' - } - ] - ] - }, - searchData: { - bool: { - onlyMy: true, - }, - advanced: { - status: { - type: 'notIn', - value: ['Converted', 'Hoax', 'Dead'] - }, - }, + defaultOptions: { + sortBy: 'createdAt', + asc: false, + displayRecords: 5, + expandedLayout: { + rows: [ + [ + { + name: 'name', + link: true, + }, + { + name: 'addressCity' + } + ], + [ + { + name: 'status' + }, + { + name: 'source' + } + ] + ] + }, + searchData: { + bool: { + onlyMy: true, + }, + advanced: { + status: { + type: 'notIn', + value: ['Converted', 'Hoax', 'Dead'] + }, + }, - }, - }, + }, + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/meetings.js b/frontend/client/modules/crm/src/views/dashlets/meetings.js index e91ea4128b..9a367d6c20 100644 --- a/frontend/client/modules/crm/src/views/dashlets/meetings.js +++ b/frontend/client/modules/crm/src/views/dashlets/meetings.js @@ -21,47 +21,47 @@ Espo.define('Crm:Views.Dashlets.Meetings', 'Views.Dashlets.Abstract.RecordList', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'Meetings', + name: 'Meetings', - scope: 'Meeting', + scope: 'Meeting', - defaultOptions: { - sortBy: 'createdAt', - asc: false, - displayRecords: 5, - expandedLayout: { - rows: [ - [ - { - name: 'name', - link: true, - } - ], - [ - { - name: 'status' - }, - { - name: 'dateStart' - } - ] - ] - }, - searchData: { - bool: { - onlyMy: true, - }, - advanced: { - status: { - type: 'notIn', - value: ['Held', 'Not Held'] - } - } - }, - }, + defaultOptions: { + sortBy: 'createdAt', + asc: false, + displayRecords: 5, + expandedLayout: { + rows: [ + [ + { + name: 'name', + link: true, + } + ], + [ + { + name: 'status' + }, + { + name: 'dateStart' + } + ] + ] + }, + searchData: { + bool: { + onlyMy: true, + }, + advanced: { + status: { + type: 'notIn', + value: ['Held', 'Not Held'] + } + } + }, + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/opportunities-by-lead-source.js b/frontend/client/modules/crm/src/views/dashlets/opportunities-by-lead-source.js index e8a407bb2f..665c07c965 100644 --- a/frontend/client/modules/crm/src/views/dashlets/opportunities-by-lead-source.js +++ b/frontend/client/modules/crm/src/views/dashlets/opportunities-by-lead-source.js @@ -21,95 +21,95 @@ Espo.define('Crm:Views.Dashlets.OpportunitiesByLeadSource', 'Crm:Views.Dashlets.Abstract.Chart', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'OpportunitiesByLeadSource', - - - optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { - 'dateFrom': { - type: 'date', - required: true, - }, - 'dateTo': { - type: 'date', - required: true, - } - }), - - defaultOptions: { - dateFrom: function () { - return moment().format('YYYY') + '-01-01' - }, - dateTo: function () { - return moment().format('YYYY') + '-12-31' - }, - }, - - url: function () { - return 'Opportunity/action/reportByLeadSource?dateFrom=' + this.getOption('dateFrom') + '&dateTo=' + this.getOption('dateTo'); - }, - - prepareData: function (response) { - var data = []; - for (var label in response) { - var value = response[label]; - data.push({ - label: this.getLanguage().translateOption(label, 'leadSource', 'Opportunity'), - data: [[0, value]] - }); - } - return data; - }, - - setup: function () { - this.currency = this.getConfig().get('defaultCurrency'); - this.currencySymbol = ''; - }, - - drow: function () { - var self = this; - this.flotr.draw(this.$container.get(0), this.chartData, { - colors: this.colors, - shadowSize: false, - pie: { - show: true, - explode: 4, - lineWidth: 1, - fillOpacity: 1, - sizeRatio: 0.8, - }, - grid: { - horizontalLines: false, - verticalLines: false, - outline: 's' - }, - yaxis: { - showLabels: false, - }, - xaxis: { - showLabels: false, - }, - legend: { - show: false, - }, - mouse: { - track: true, - relative: true, - trackFormatter: function (obj) { - return self.formatNumber(obj.y) + ' ' + self.currency; - }, - }, - legend: { - show: true, - noColumns: 8, - container: this.$el.find('.legend-container'), - labelBoxMargin: 0 - }, - }); - }, + name: 'OpportunitiesByLeadSource', + + + optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { + 'dateFrom': { + type: 'date', + required: true, + }, + 'dateTo': { + type: 'date', + required: true, + } + }), + + defaultOptions: { + dateFrom: function () { + return moment().format('YYYY') + '-01-01' + }, + dateTo: function () { + return moment().format('YYYY') + '-12-31' + }, + }, + + url: function () { + return 'Opportunity/action/reportByLeadSource?dateFrom=' + this.getOption('dateFrom') + '&dateTo=' + this.getOption('dateTo'); + }, + + prepareData: function (response) { + var data = []; + for (var label in response) { + var value = response[label]; + data.push({ + label: this.getLanguage().translateOption(label, 'leadSource', 'Opportunity'), + data: [[0, value]] + }); + } + return data; + }, + + setup: function () { + this.currency = this.getConfig().get('defaultCurrency'); + this.currencySymbol = ''; + }, + + drow: function () { + var self = this; + this.flotr.draw(this.$container.get(0), this.chartData, { + colors: this.colors, + shadowSize: false, + pie: { + show: true, + explode: 4, + lineWidth: 1, + fillOpacity: 1, + sizeRatio: 0.8, + }, + grid: { + horizontalLines: false, + verticalLines: false, + outline: 's' + }, + yaxis: { + showLabels: false, + }, + xaxis: { + showLabels: false, + }, + legend: { + show: false, + }, + mouse: { + track: true, + relative: true, + trackFormatter: function (obj) { + return self.formatNumber(obj.y) + ' ' + self.currency; + }, + }, + legend: { + show: true, + noColumns: 8, + container: this.$el.find('.legend-container'), + labelBoxMargin: 0 + }, + }); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/opportunities-by-stage.js b/frontend/client/modules/crm/src/views/dashlets/opportunities-by-stage.js index ce9139c119..4ba224befe 100644 --- a/frontend/client/modules/crm/src/views/dashlets/opportunities-by-stage.js +++ b/frontend/client/modules/crm/src/views/dashlets/opportunities-by-stage.js @@ -21,117 +21,117 @@ Espo.define('Crm:Views.Dashlets.OpportunitiesByStage', 'Crm:Views.Dashlets.Abstract.Chart', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'OpportunitiesByStage', - - optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { - 'dateFrom': { - type: 'date', - required: true, - }, - 'dateTo': { - type: 'date', - required: true, - } - }), - - defaultOptions: { - dateFrom: function () { - return moment().format('YYYY') + '-01-01' - }, - dateTo: function () { - return moment().format('YYYY') + '-12-31' - }, - }, - - url: function () { - return 'Opportunity/action/reportByStage?dateFrom=' + this.getOption('dateFrom') + '&dateTo=' + this.getOption('dateTo'); - }, - - prepareData: function (response) { - var d = []; - for (var label in response) { - var value = response[label]; - d.push({ - stage: label, - value: value - }); - } - - this.stageList = []; - - var data = []; - var i = 0; - d.forEach(function (item) { - var o = { - data: [[item.value, d.length - i]], - label: this.getLanguage().translateOption(item.stage, 'stage', 'Opportunity'), - } - if (item.stage == 'Closed Won') { - o.color = this.successColor; - } - data.push(o); - this.stageList.push(this.getLanguage().translateOption(item.stage, 'stage', 'Opportunity')); - i++; - }, this); - - return data; - }, - - setup: function () { - this.currency = this.getConfig().get('defaultCurrency'); - this.currencySymbol = ''; - }, - - drow: function () { - var self = this; - this.flotr.draw(this.$container.get(0), this.chartData, { - colors: this.colors, - shadowSize: false, - bars: { - show: true, - horizontal: true, - shadowSize: 0, - lineWidth: 1, - fillOpacity: 1, - barWidth: 0.5, - }, - grid: { - horizontalLines: false, - outline: 'sw' - }, - yaxis: { - min: 0, - showLabels: false, - }, - xaxis: { - min: 0, - tickFormatter: function (value) { - if (value != 0) { - return self.formatNumber(value) + ' ' + self.currency; - } - return ''; - }, - }, - mouse: { - track: true, - relative: true, - position: 's', - trackFormatter: function (obj) { - return self.formatNumber(obj.x) + ' ' + self.currency; - }, - }, - legend: { - show: true, - noColumns: 5, - container: this.$el.find('.legend-container'), - labelBoxMargin: 0 - }, - }); - }, + name: 'OpportunitiesByStage', + + optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { + 'dateFrom': { + type: 'date', + required: true, + }, + 'dateTo': { + type: 'date', + required: true, + } + }), + + defaultOptions: { + dateFrom: function () { + return moment().format('YYYY') + '-01-01' + }, + dateTo: function () { + return moment().format('YYYY') + '-12-31' + }, + }, + + url: function () { + return 'Opportunity/action/reportByStage?dateFrom=' + this.getOption('dateFrom') + '&dateTo=' + this.getOption('dateTo'); + }, + + prepareData: function (response) { + var d = []; + for (var label in response) { + var value = response[label]; + d.push({ + stage: label, + value: value + }); + } + + this.stageList = []; + + var data = []; + var i = 0; + d.forEach(function (item) { + var o = { + data: [[item.value, d.length - i]], + label: this.getLanguage().translateOption(item.stage, 'stage', 'Opportunity'), + } + if (item.stage == 'Closed Won') { + o.color = this.successColor; + } + data.push(o); + this.stageList.push(this.getLanguage().translateOption(item.stage, 'stage', 'Opportunity')); + i++; + }, this); + + return data; + }, + + setup: function () { + this.currency = this.getConfig().get('defaultCurrency'); + this.currencySymbol = ''; + }, + + drow: function () { + var self = this; + this.flotr.draw(this.$container.get(0), this.chartData, { + colors: this.colors, + shadowSize: false, + bars: { + show: true, + horizontal: true, + shadowSize: 0, + lineWidth: 1, + fillOpacity: 1, + barWidth: 0.5, + }, + grid: { + horizontalLines: false, + outline: 'sw' + }, + yaxis: { + min: 0, + showLabels: false, + }, + xaxis: { + min: 0, + tickFormatter: function (value) { + if (value != 0) { + return self.formatNumber(value) + ' ' + self.currency; + } + return ''; + }, + }, + mouse: { + track: true, + relative: true, + position: 's', + trackFormatter: function (obj) { + return self.formatNumber(obj.x) + ' ' + self.currency; + }, + }, + legend: { + show: true, + noColumns: 5, + container: this.$el.find('.legend-container'), + labelBoxMargin: 0 + }, + }); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/opportunities.js b/frontend/client/modules/crm/src/views/dashlets/opportunities.js index bd57dda1d3..c32c263735 100644 --- a/frontend/client/modules/crm/src/views/dashlets/opportunities.js +++ b/frontend/client/modules/crm/src/views/dashlets/opportunities.js @@ -21,46 +21,46 @@ Espo.define('Crm:Views.Dashlets.Opportunities', 'Views.Dashlets.Abstract.RecordList', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'Opportunities', + name: 'Opportunities', - scope: 'Opportunity', + scope: 'Opportunity', - defaultOptions: { - sortBy: 'createdAt', - asc: false, - displayRecords: 5, - expandedLayout: { - rows: [ - [ - { - name: 'name', - link: true, - }, - { - name: 'account' - } - ], - [ - { - name: 'stage' - }, - { - name: 'amount' - } - ] - ] - }, - searchData: { - bool: { - onlyMy: true, - open: true, - } - }, - }, + defaultOptions: { + sortBy: 'createdAt', + asc: false, + displayRecords: 5, + expandedLayout: { + rows: [ + [ + { + name: 'name', + link: true, + }, + { + name: 'account' + } + ], + [ + { + name: 'stage' + }, + { + name: 'amount' + } + ] + ] + }, + searchData: { + bool: { + onlyMy: true, + open: true, + } + }, + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/sales-by-month.js b/frontend/client/modules/crm/src/views/dashlets/sales-by-month.js index 97d5d5a169..369c30ff77 100644 --- a/frontend/client/modules/crm/src/views/dashlets/sales-by-month.js +++ b/frontend/client/modules/crm/src/views/dashlets/sales-by-month.js @@ -21,118 +21,118 @@ Espo.define('Crm:Views.Dashlets.SalesByMonth', 'Crm:Views.Dashlets.Abstract.Chart', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'SalesByMonth', - - optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { - 'dateFrom': { - type: 'date', - required: true, - }, - 'dateTo': { - type: 'date', - required: true, - } - }), - - defaultOptions: { - dateFrom: function () { - return moment().format('YYYY') + '-01-01' - }, - dateTo: function () { - return moment().format('YYYY') + '-12-31' - }, - }, - - url: function () { - return 'Opportunity/action/reportSalesByMonth?dateFrom=' + this.getOption('dateFrom') + '&dateTo=' + this.getOption('dateTo'); - }, - - prepareData: function (response) { - var months = this.months = Object.keys(response).sort(); - - var values = []; - - for (var month in response) { - values.push(response[month]); - } - - this.chartData = []; - - var mid = 0; - if (values.length) { - mid = values.reduce(function(a, b) {return a + b}) / values.length; - } - - var data = []; - - values.forEach(function (value, i) { - data.push({ - data: [[i, value]], - color: (value >= mid) ? this.successColor : this.colorBad - }); - }, this); - - return data; - }, - - setup: function () { - this.currency = this.getConfig().get('defaultCurrency'); - this.currencySymbol = ''; - - this.colorBad = this.successColor; - }, - - drow: function () { - var self = this; - this.flotr.draw(this.$container.get(0), this.chartData, { - shadowSize: false, - bars: { - show: true, - horizontal: false, - shadowSize: 0, - lineWidth: 1, - fillOpacity: 1, - barWidth: 0.5, - }, - grid: { - horizontalLines: true, - verticalLines: false, - outline: 'sw' - }, - yaxis: { - min: 0, - showLabels: true, - tickFormatter: function (value) { - if (value == 0) { - return ''; - } - return self.formatNumber(value) + ' ' + self.currency; - }, - }, - xaxis: { - min: 0, - tickFormatter: function (value) { - if (value % 1 == 0) { - var i = parseInt(value); - if (i in self.months) { - return moment(self.months[i] + '-01').format('MMM YYYY'); - } - } - return ''; - }, - }, - mouse: { - track: true, - relative: true, - trackFormatter: function (obj) { - return self.formatNumber(obj.y) + ' ' + self.currency; - }, - }, - }); - }, - }); + name: 'SalesByMonth', + + optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { + 'dateFrom': { + type: 'date', + required: true, + }, + 'dateTo': { + type: 'date', + required: true, + } + }), + + defaultOptions: { + dateFrom: function () { + return moment().format('YYYY') + '-01-01' + }, + dateTo: function () { + return moment().format('YYYY') + '-12-31' + }, + }, + + url: function () { + return 'Opportunity/action/reportSalesByMonth?dateFrom=' + this.getOption('dateFrom') + '&dateTo=' + this.getOption('dateTo'); + }, + + prepareData: function (response) { + var months = this.months = Object.keys(response).sort(); + + var values = []; + + for (var month in response) { + values.push(response[month]); + } + + this.chartData = []; + + var mid = 0; + if (values.length) { + mid = values.reduce(function(a, b) {return a + b}) / values.length; + } + + var data = []; + + values.forEach(function (value, i) { + data.push({ + data: [[i, value]], + color: (value >= mid) ? this.successColor : this.colorBad + }); + }, this); + + return data; + }, + + setup: function () { + this.currency = this.getConfig().get('defaultCurrency'); + this.currencySymbol = ''; + + this.colorBad = this.successColor; + }, + + drow: function () { + var self = this; + this.flotr.draw(this.$container.get(0), this.chartData, { + shadowSize: false, + bars: { + show: true, + horizontal: false, + shadowSize: 0, + lineWidth: 1, + fillOpacity: 1, + barWidth: 0.5, + }, + grid: { + horizontalLines: true, + verticalLines: false, + outline: 'sw' + }, + yaxis: { + min: 0, + showLabels: true, + tickFormatter: function (value) { + if (value == 0) { + return ''; + } + return self.formatNumber(value) + ' ' + self.currency; + }, + }, + xaxis: { + min: 0, + tickFormatter: function (value) { + if (value % 1 == 0) { + var i = parseInt(value); + if (i in self.months) { + return moment(self.months[i] + '-01').format('MMM YYYY'); + } + } + return ''; + }, + }, + mouse: { + track: true, + relative: true, + trackFormatter: function (obj) { + return self.formatNumber(obj.y) + ' ' + self.currency; + }, + }, + }); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/sales-pipeline.js b/frontend/client/modules/crm/src/views/dashlets/sales-pipeline.js index f5eae726aa..6279dbf346 100644 --- a/frontend/client/modules/crm/src/views/dashlets/sales-pipeline.js +++ b/frontend/client/modules/crm/src/views/dashlets/sales-pipeline.js @@ -21,184 +21,184 @@ Espo.define('Crm:Views.Dashlets.SalesPipeline', 'Crm:Views.Dashlets.Abstract.Chart', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'SalesPipeline', - - optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { - 'dateFrom': { - type: 'date', - required: true, - }, - 'dateTo': { - type: 'date', - required: true, - } - }), - - defaultOptions: { - dateFrom: function () { - return moment().format('YYYY') + '-01-01' - }, - dateTo: function () { - return moment().format('YYYY') + '-12-31' - }, - }, - - url: function () { - return 'Opportunity/action/reportSalesPipeline?dateFrom=' + this.getOption('dateFrom') + '&dateTo=' + this.getOption('dateTo'); - }, - - prepareData: function (response) { - var d = []; - for (var label in response) { - var value = response[label]; - d.push({ - stage: this.getLanguage().translateOption(label, 'stage', 'Opportunity'), - value: value - }); - } - - var data = []; - for (var i = 0; i < d.length; i++) { - var item = d[i]; - var value = item.value; - var nextValue = ((i + 1) < d.length) ? d[i + 1].value : value; - data.push({ - data: [[i, value], [i + 1, nextValue]], - label: item.stage - }); - } - - this.maxY = 1000; - if (d.length) { - for (var i = 0; i < d.length; i++) { - var y = d[i].value + (d[i].value / 20); - if (y > this.maxY) { - this.maxY = y; - } - } - - } - - return data; - }, - - setup: function () { - this.currency = this.getConfig().get('defaultCurrency'); - this.currencySymbol = ''; - - var data = [ - { - value: 12000, - stage: 'Prospecting' - }, - { - value: 5050, - stage: 'Qualification' - }, - { - value: 4050, - stage: 'Needs Analysis' - }, - { - value: 3230, - stage: 'Value Proposition' - }, - { - value: 2000, - stage: 'Proposal/Price Quote' - }, - { - value: 1200.5, - stage: 'Negotiation/Review' - }, - { - value: 700, - stage: 'Closed Won' - }, - ]; - - this.chartData = []; - - for (var i = 0; i < data.length; i++) { - var item = data[i]; - var value = item.value; - var nextValue = ((i + 1) < data.length) ? data[i + 1].value : value; - var o = { - data: [[i, value], [i + 1, nextValue]], - label: item.stage - }; + name: 'SalesPipeline', + + optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { + 'dateFrom': { + type: 'date', + required: true, + }, + 'dateTo': { + type: 'date', + required: true, + } + }), + + defaultOptions: { + dateFrom: function () { + return moment().format('YYYY') + '-01-01' + }, + dateTo: function () { + return moment().format('YYYY') + '-12-31' + }, + }, + + url: function () { + return 'Opportunity/action/reportSalesPipeline?dateFrom=' + this.getOption('dateFrom') + '&dateTo=' + this.getOption('dateTo'); + }, + + prepareData: function (response) { + var d = []; + for (var label in response) { + var value = response[label]; + d.push({ + stage: this.getLanguage().translateOption(label, 'stage', 'Opportunity'), + value: value + }); + } + + var data = []; + for (var i = 0; i < d.length; i++) { + var item = d[i]; + var value = item.value; + var nextValue = ((i + 1) < d.length) ? d[i + 1].value : value; + data.push({ + data: [[i, value], [i + 1, nextValue]], + label: item.stage + }); + } + + this.maxY = 1000; + if (d.length) { + for (var i = 0; i < d.length; i++) { + var y = d[i].value + (d[i].value / 20); + if (y > this.maxY) { + this.maxY = y; + } + } + + } + + return data; + }, + + setup: function () { + this.currency = this.getConfig().get('defaultCurrency'); + this.currencySymbol = ''; + + var data = [ + { + value: 12000, + stage: 'Prospecting' + }, + { + value: 5050, + stage: 'Qualification' + }, + { + value: 4050, + stage: 'Needs Analysis' + }, + { + value: 3230, + stage: 'Value Proposition' + }, + { + value: 2000, + stage: 'Proposal/Price Quote' + }, + { + value: 1200.5, + stage: 'Negotiation/Review' + }, + { + value: 700, + stage: 'Closed Won' + }, + ]; + + this.chartData = []; + + for (var i = 0; i < data.length; i++) { + var item = data[i]; + var value = item.value; + var nextValue = ((i + 1) < data.length) ? data[i + 1].value : value; + var o = { + data: [[i, value], [i + 1, nextValue]], + label: item.stage + }; - this.chartData.push(o); - } - - this.maxY = 1000; - if (data.length) { - this.maxY = data[0].value + (data[0].value / 20); - } - }, - - drow: function () { - var self = this; - - var colors = Espo.Utils.clone(this.colors); - - this.chartData.forEach(function (item, i) { - if (i + 1 > colors.length) { - colors.push('#164'); - } - if (this.chartData.length == i + 1) { - colors[i] = this.successColor; - } - }, this); - - - this.flotr.draw(this.$container.get(0), this.chartData, { - colors: colors, - shadowSize: false, - lines: { - show: true, - fill: true, - fillOpacity: 1, - }, - points: { - show: true, - }, - grid: { - horizontalLines: false, - outline: 'sw' - }, - yaxis: { - min: 0, - max: this.maxY, - showLabels: false, - }, - xaxis: { - min: 0, - showLabels: false, - }, - mouse: { - track: true, - relative: true, - position: 'ne', - trackFormatter: function (obj) { - if (obj.x >= self.chartData.length) { - return null; - } - return self.formatNumber(obj.y) + ' ' + self.currency; - }, - }, - legend: { - show: true, - noColumns: 5, - container: this.$el.find('.legend-container'), - labelBoxMargin: 0 - }, - }); - }, + this.chartData.push(o); + } + + this.maxY = 1000; + if (data.length) { + this.maxY = data[0].value + (data[0].value / 20); + } + }, + + drow: function () { + var self = this; + + var colors = Espo.Utils.clone(this.colors); + + this.chartData.forEach(function (item, i) { + if (i + 1 > colors.length) { + colors.push('#164'); + } + if (this.chartData.length == i + 1) { + colors[i] = this.successColor; + } + }, this); + + + this.flotr.draw(this.$container.get(0), this.chartData, { + colors: colors, + shadowSize: false, + lines: { + show: true, + fill: true, + fillOpacity: 1, + }, + points: { + show: true, + }, + grid: { + horizontalLines: false, + outline: 'sw' + }, + yaxis: { + min: 0, + max: this.maxY, + showLabels: false, + }, + xaxis: { + min: 0, + showLabels: false, + }, + mouse: { + track: true, + relative: true, + position: 'ne', + trackFormatter: function (obj) { + if (obj.x >= self.chartData.length) { + return null; + } + return self.formatNumber(obj.y) + ' ' + self.currency; + }, + }, + legend: { + show: true, + noColumns: 5, + container: this.$el.find('.legend-container'), + labelBoxMargin: 0 + }, + }); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/dashlets/tasks.js b/frontend/client/modules/crm/src/views/dashlets/tasks.js index d8495b4bea..78c72ca651 100644 --- a/frontend/client/modules/crm/src/views/dashlets/tasks.js +++ b/frontend/client/modules/crm/src/views/dashlets/tasks.js @@ -21,49 +21,49 @@ Espo.define('Crm:Views.Dashlets.Tasks', 'Views.Dashlets.Abstract.RecordList', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'Tasks', + name: 'Tasks', - scope: 'Task', + scope: 'Task', - defaultOptions: { - sortBy: 'createdAt', - asc: false, - displayRecords: 5, - expandedLayout: { - rows: [ - [ - { - name: 'name', - link: true, - } - ], - [ - { - name: 'status' - }, - { - name: 'dateEnd' - } - ] - ] - }, - searchData: { - bool: { - onlyMy: true, - open: true, - }, - advanced: { - status: { - type: 'notIn', - value: ['Completed', 'Canceled'] - }, - }, + defaultOptions: { + sortBy: 'createdAt', + asc: false, + displayRecords: 5, + expandedLayout: { + rows: [ + [ + { + name: 'name', + link: true, + } + ], + [ + { + name: 'status' + }, + { + name: 'dateEnd' + } + ] + ] + }, + searchData: { + bool: { + onlyMy: true, + open: true, + }, + advanced: { + status: { + type: 'notIn', + value: ['Completed', 'Canceled'] + }, + }, - }, - }, + }, + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/document/fields/file-short.js b/frontend/client/modules/crm/src/views/document/fields/file-short.js index d497f67193..ca1a4ca925 100644 --- a/frontend/client/modules/crm/src/views/document/fields/file-short.js +++ b/frontend/client/modules/crm/src/views/document/fields/file-short.js @@ -21,22 +21,22 @@ Espo.define('Crm:Views.Document.Fields.FileShort', 'Views.Fields.File', function (Dep) { - return Dep.extend({ - - getValueForDisplay: function () { - if (this.mode == 'detail' || this.mode == 'list') { - var name = this.model.get(this.nameName); - var type = this.model.get(this.typeName) || this.defaultType; - var id = this.model.get(this.idName); - - if (!id) { - return false; - } + return Dep.extend({ + + getValueForDisplay: function () { + if (this.mode == 'detail' || this.mode == 'list') { + var name = this.model.get(this.nameName); + var type = this.model.get(this.typeName) || this.defaultType; + var id = this.model.get(this.idName); + + if (!id) { + return false; + } - return ''; - } - }, - - }); + return ''; + } + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/document/fields/name.js b/frontend/client/modules/crm/src/views/document/fields/name.js index 23a33e9a5a..edb3546e73 100644 --- a/frontend/client/modules/crm/src/views/document/fields/name.js +++ b/frontend/client/modules/crm/src/views/document/fields/name.js @@ -21,17 +21,17 @@ Espo.define('Crm:Views.Document.Fields.Name', 'Views.Fields.Varchar', function (Dep) { - return Dep.extend({ - - setup: function () { - Dep.prototype.setup.call(this); - if (this.model.isNew()) { - this.listenTo(this.model, 'change:fileName', function () { - this.model.set('name', this.model.get('fileName')); - }, this); - } - }, - - }); + return Dep.extend({ + + setup: function () { + Dep.prototype.setup.call(this); + if (this.model.isNew()) { + this.listenTo(this.model, 'change:fileName', function () { + this.model.set('name', this.model.get('fileName')); + }, this); + } + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/fields/ico.js b/frontend/client/modules/crm/src/views/fields/ico.js index a68ce9487a..faafb5fde7 100644 --- a/frontend/client/modules/crm/src/views/fields/ico.js +++ b/frontend/client/modules/crm/src/views/fields/ico.js @@ -20,27 +20,27 @@ ************************************************************************/ Espo.define('Crm:Views.Fields.Ico', 'Views.Fields.Base', function (Dep) { - return Dep.extend({ - - //detailTemplate: '', + return Dep.extend({ + + //detailTemplate: '', - setup: function () { - var tpl; - - switch (this.model.name) { - case 'Meeting': - tpl = ''; - break; - case 'Call': - tpl = ''; - break; - case 'Email': - tpl = ''; - break; - } - this._template = tpl; - }, + setup: function () { + var tpl; + + switch (this.model.name) { + case 'Meeting': + tpl = ''; + break; + case 'Call': + tpl = ''; + break; + case 'Email': + tpl = ''; + break; + } + this._template = tpl; + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/inbound-email/fields/folder.js b/frontend/client/modules/crm/src/views/inbound-email/fields/folder.js index 0c099930f1..8c503c7bc0 100644 --- a/frontend/client/modules/crm/src/views/inbound-email/fields/folder.js +++ b/frontend/client/modules/crm/src/views/inbound-email/fields/folder.js @@ -21,58 +21,58 @@ Espo.define('Crm:Views.InboundEmail.Fields.Folder', 'Views.Fields.Base', function (Dep) { - return Dep.extend({ - - editTemplate: 'crm:inbound-email.fields.folder.edit', - - events: { - 'click [data-action="selectFolder"]': function () { - var self = this; - - this.notify('Please wait...'); - - var data = { - host: this.model.get('host'), - port: this.model.get('port'), - ssl: this.model.get('ssl'), - username: this.model.get('username'), - }; - - if (this.model.has('password')) { - data.password = this.model.get('password'); - } else { - if (!this.model.isNew()) { - data.id = this.model.id; - } - } - - - $.ajax({ - type: 'GET', - url: 'InboundEmail/action/getFolders', - data: data, - error: function (xhr) { - Espo.Ui.error(self.translate('couldNotConnectToImap', 'messages', 'InboundEmail')); - xhr.errorIsHandled = true; - }, - }).done(function (folders) { - this.createView('modal', 'Crm:InboundEmail.Modals.SelectFolder', { - folders: folders - }, function (view) { - self.notify(false); - view.render(); - - self.listenToOnce(view, 'select', function (folder) { - view.close(); - self.addFolder(folder); - }); - }); - }.bind(this)); - } - }, - - addFolder: function (folder) { - this.$element.val(folder); - }, - }); + return Dep.extend({ + + editTemplate: 'crm:inbound-email.fields.folder.edit', + + events: { + 'click [data-action="selectFolder"]': function () { + var self = this; + + this.notify('Please wait...'); + + var data = { + host: this.model.get('host'), + port: this.model.get('port'), + ssl: this.model.get('ssl'), + username: this.model.get('username'), + }; + + if (this.model.has('password')) { + data.password = this.model.get('password'); + } else { + if (!this.model.isNew()) { + data.id = this.model.id; + } + } + + + $.ajax({ + type: 'GET', + url: 'InboundEmail/action/getFolders', + data: data, + error: function (xhr) { + Espo.Ui.error(self.translate('couldNotConnectToImap', 'messages', 'InboundEmail')); + xhr.errorIsHandled = true; + }, + }).done(function (folders) { + this.createView('modal', 'Crm:InboundEmail.Modals.SelectFolder', { + folders: folders + }, function (view) { + self.notify(false); + view.render(); + + self.listenToOnce(view, 'select', function (folder) { + view.close(); + self.addFolder(folder); + }); + }); + }.bind(this)); + } + }, + + addFolder: function (folder) { + this.$element.val(folder); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/inbound-email/fields/folders.js b/frontend/client/modules/crm/src/views/inbound-email/fields/folders.js index 8e9de5b89d..85fad8396e 100644 --- a/frontend/client/modules/crm/src/views/inbound-email/fields/folders.js +++ b/frontend/client/modules/crm/src/views/inbound-email/fields/folders.js @@ -21,20 +21,20 @@ Espo.define('Crm:Views.InboundEmail.Fields.Folders', 'Crm:Views.InboundEmail.Fields.Folder', function (Dep) { - return Dep.extend({ - - addFolder: function (folder) { - var value = this.$element.val(); - - var folders = []; - if (value != '') { - folders = value.split(','); - } - - if (!~folders.indexOf(folder)) { - folders.push(folder); - } - this.$element.val(folders.join(',')); - }, - }); + return Dep.extend({ + + addFolder: function (folder) { + var value = this.$element.val(); + + var folders = []; + if (value != '') { + folders = value.split(','); + } + + if (!~folders.indexOf(folder)) { + folders.push(folder); + } + this.$element.val(folders.join(',')); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/inbound-email/modals/select-folder.js b/frontend/client/modules/crm/src/views/inbound-email/modals/select-folder.js index 95a1c9eac7..868a42937d 100644 --- a/frontend/client/modules/crm/src/views/inbound-email/modals/select-folder.js +++ b/frontend/client/modules/crm/src/views/inbound-email/modals/select-folder.js @@ -21,39 +21,39 @@ Espo.define('Crm:Views.InboundEmail.Modals.SelectFolder', 'Views.Modal', function (Dep) { - return Dep.extend({ - - cssName: 'select-folder-modal', - - template: 'crm:inbound-email.modals.select-folder', - - data: function () { - return { - folders: this.options.folders, - }; - }, - - events: { - 'click button[data-action="select"]': function (e) { - var value = $(e.currentTarget).data('value'); - this.trigger('select', value); - }, - }, - - setup: function () { - - this.buttons = [ - { - name: 'cancel', - label: 'Cancel', - onClick: function (dialog) { - dialog.close(); - } - } - ]; + return Dep.extend({ + + cssName: 'select-folder-modal', + + template: 'crm:inbound-email.modals.select-folder', + + data: function () { + return { + folders: this.options.folders, + }; + }, + + events: { + 'click button[data-action="select"]': function (e) { + var value = $(e.currentTarget).data('value'); + this.trigger('select', value); + }, + }, + + setup: function () { + + this.buttons = [ + { + name: 'cancel', + label: 'Cancel', + onClick: function (dialog) { + dialog.close(); + } + } + ]; - }, + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/inbound-email/record/detail.js b/frontend/client/modules/crm/src/views/inbound-email/record/detail.js index b00392a2b3..bb49d83b20 100644 --- a/frontend/client/modules/crm/src/views/inbound-email/record/detail.js +++ b/frontend/client/modules/crm/src/views/inbound-email/record/detail.js @@ -21,49 +21,49 @@ Espo.define('Crm:Views.InboundEmail.Record.Detail', 'Views.Record.Detail', function (Dep) { - return Dep.extend({ + return Dep.extend({ - setup: function () { - Dep.prototype.setup.call(this); - this.handleDistributionField(); - }, + setup: function () { + Dep.prototype.setup.call(this); + this.handleDistributionField(); + }, - afterRender: function () { - Dep.prototype.afterRender.call(this); - this.initSslFieldListening(); - }, + afterRender: function () { + Dep.prototype.afterRender.call(this); + this.initSslFieldListening(); + }, - handleDistributionField: function () { - var handleRequirement = function (model) { - if (model.get('createCase') && ['Round-Robin', 'Least-Busy'].indexOf(model.get('caseDistribution')) != -1) { - this.getFieldView('team').setRequired(); - } else { - this.getFieldView('team').setNotRequired(); - } - }.bind(this); + handleDistributionField: function () { + var handleRequirement = function (model) { + if (model.get('createCase') && ['Round-Robin', 'Least-Busy'].indexOf(model.get('caseDistribution')) != -1) { + this.getFieldView('team').setRequired(); + } else { + this.getFieldView('team').setNotRequired(); + } + }.bind(this); - this.on('render', function () { - handleRequirement(this.model); - }, this); + this.on('render', function () { + handleRequirement(this.model); + }, this); - this.listenTo(this.model, 'change:caseDistribution', function (model) { - handleRequirement(model); - }); - }, + this.listenTo(this.model, 'change:caseDistribution', function (model) { + handleRequirement(model); + }); + }, - initSslFieldListening: function () { - var sslField = this.getFieldView('ssl'); - this.listenTo(sslField, 'change', function () { - var ssl = sslField.fetch()['ssl']; - if (ssl) { - this.model.set('port', '993'); - } else { - this.model.set('port', '143'); - } - }, this); - } + initSslFieldListening: function () { + var sslField = this.getFieldView('ssl'); + this.listenTo(sslField, 'change', function () { + var ssl = sslField.fetch()['ssl']; + if (ssl) { + this.model.set('port', '993'); + } else { + this.model.set('port', '143'); + } + }, this); + } - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/inbound-email/record/edit.js b/frontend/client/modules/crm/src/views/inbound-email/record/edit.js index 23b27925fe..b9c2710539 100644 --- a/frontend/client/modules/crm/src/views/inbound-email/record/edit.js +++ b/frontend/client/modules/crm/src/views/inbound-email/record/edit.js @@ -21,19 +21,19 @@ Espo.define('Crm:Views.InboundEmail.Record.Edit', ['Views.Record.Edit', 'Crm:Views.InboundEmail.Record.Detail'], function (Dep, Detail) { - return Dep.extend({ + return Dep.extend({ - setup: function () { - Dep.prototype.setup.call(this); - Detail.prototype.handleDistributionField.call(this); + setup: function () { + Dep.prototype.setup.call(this); + Detail.prototype.handleDistributionField.call(this); - }, + }, - afterRender: function () { - Dep.prototype.afterRender.call(this); - Detail.prototype.initSslFieldListening.call(this); - }, + afterRender: function () { + Dep.prototype.afterRender.call(this); + Detail.prototype.initSslFieldListening.call(this); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/inbound-email/record/list.js b/frontend/client/modules/crm/src/views/inbound-email/record/list.js index b9f33cda87..ff0b5685bf 100644 --- a/frontend/client/modules/crm/src/views/inbound-email/record/list.js +++ b/frontend/client/modules/crm/src/views/inbound-email/record/list.js @@ -18,14 +18,14 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Crm:Views.InboundEmail.Record.List', 'Views.Record.List', function (Dep) { + +Espo.define('Crm:Views.InboundEmail.Record.List', 'Views.Record.List', function (Dep) { - return Dep.extend({ - - allowQuickEdit: false, - - }); - + return Dep.extend({ + + allowQuickEdit: false, + + }); + }); diff --git a/frontend/client/modules/crm/src/views/lead/convert.js b/frontend/client/modules/crm/src/views/lead/convert.js index 8aa9833563..ef6c22ed0d 100644 --- a/frontend/client/modules/crm/src/views/lead/convert.js +++ b/frontend/client/modules/crm/src/views/lead/convert.js @@ -21,157 +21,157 @@ Espo.define('Crm:Views.Lead.Convert', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'crm:lead.convert', + template: 'crm:lead.convert', - data: function () { - return { - scopes: this.scopes, - scope: this.model.name, - }; - }, + data: function () { + return { + scopes: this.scopes, + scope: this.model.name, + }; + }, - events: { - 'change input.check-scope': function (e) { - var scope = $(e.currentTarget).data('scope'); - var $div = this.$el.find('.edit-container-' + Espo.Utils.toDom(scope)); - if (e.currentTarget.checked) { - $div.removeClass('hide'); - } else { - $div.addClass('hide'); - } - }, - 'click button[data-action="convert"]': function (e) { - this.convert(); - }, - 'click button[data-action="cancel"]': function (e) { - this.getRouter().navigate('#Lead/view/' + this.id, {trigger: true}); - }, - }, + events: { + 'change input.check-scope': function (e) { + var scope = $(e.currentTarget).data('scope'); + var $div = this.$el.find('.edit-container-' + Espo.Utils.toDom(scope)); + if (e.currentTarget.checked) { + $div.removeClass('hide'); + } else { + $div.addClass('hide'); + } + }, + 'click button[data-action="convert"]': function (e) { + this.convert(); + }, + 'click button[data-action="cancel"]': function (e) { + this.getRouter().navigate('#Lead/view/' + this.id, {trigger: true}); + }, + }, - setup: function () { - this.wait(true); - this.id = this.options.id; - - this.notify('Loading...'); + setup: function () { + this.wait(true); + this.id = this.options.id; + + this.notify('Loading...'); - this.getModelFactory().create('Lead', function (model) { - this.model = model; - model.id = this.id; + this.getModelFactory().create('Lead', function (model) { + this.model = model; + model.id = this.id; - this.listenToOnce(model, 'sync', function () { - this.build(); - }.bind(this)); - model.fetch(); - }.bind(this)); + this.listenToOnce(model, 'sync', function () { + this.build(); + }.bind(this)); + model.fetch(); + }.bind(this)); - }, + }, - build: function () { - var scopes = this.scopes = []; - for (var scope in this.model.defs.convertFields) { - if (this.getAcl().check(scope, 'edit')) { - scopes.push(scope); - } - } - var i = 0; - - var attributeList = this.getFieldManager().getEntityAttributes(this.model.name); - var ignoreAttributeList = ['createdAt', 'modifiedAt', 'modifiedById', 'modifiedByName', 'createdById', 'createdByName']; - - scopes.forEach(function (scope) { - this.getModelFactory().create(scope, function (model) { - model.populateDefaults(); - - this.getFieldManager().getEntityAttributes(model.name).forEach(function (attr) { - if (~attributeList.indexOf(attr) && !~ignoreAttributeList.indexOf(attr)) { - model.set(attr, this.model.get(attr), {silent: true}); - } - }, this); - - for (var field in this.model.defs.convertFields[scope]) { - var leadField = this.model.defs.convertFields[scope][field]; - var leadAttrs = this.getFieldManager().getAttributes(this.model.getFieldParam(leadField, 'type'), leadField); - var attrs = this.getFieldManager().getAttributes(model.getFieldParam(field, 'type'), field); + build: function () { + var scopes = this.scopes = []; + for (var scope in this.model.defs.convertFields) { + if (this.getAcl().check(scope, 'edit')) { + scopes.push(scope); + } + } + var i = 0; + + var attributeList = this.getFieldManager().getEntityAttributes(this.model.name); + var ignoreAttributeList = ['createdAt', 'modifiedAt', 'modifiedById', 'modifiedByName', 'createdById', 'createdByName']; + + scopes.forEach(function (scope) { + this.getModelFactory().create(scope, function (model) { + model.populateDefaults(); + + this.getFieldManager().getEntityAttributes(model.name).forEach(function (attr) { + if (~attributeList.indexOf(attr) && !~ignoreAttributeList.indexOf(attr)) { + model.set(attr, this.model.get(attr), {silent: true}); + } + }, this); + + for (var field in this.model.defs.convertFields[scope]) { + var leadField = this.model.defs.convertFields[scope][field]; + var leadAttrs = this.getFieldManager().getAttributes(this.model.getFieldParam(leadField, 'type'), leadField); + var attrs = this.getFieldManager().getAttributes(model.getFieldParam(field, 'type'), field); - attrs.forEach(function (attr, i) { - var leadAttr = leadAttrs[i]; - model.set(attr, this.model.get(leadAttr)); - }.bind(this)); - } + attrs.forEach(function (attr, i) { + var leadAttr = leadAttrs[i]; + model.set(attr, this.model.get(leadAttr)); + }.bind(this)); + } - this.createView(scope, 'Record.Edit', { - model: model, - el: '#main .edit-container-' + Espo.Utils.toDom(scope), - buttonsPosition: false, - layoutName: 'detailConvert', - exit: function () {}, - }, function (view) { - i++; - if (i == scopes.length) { - this.wait(false); - this.notify(false); - } - }.bind(this)); - }, this); - }, this); - }, + this.createView(scope, 'Record.Edit', { + model: model, + el: '#main .edit-container-' + Espo.Utils.toDom(scope), + buttonsPosition: false, + layoutName: 'detailConvert', + exit: function () {}, + }, function (view) { + i++; + if (i == scopes.length) { + this.wait(false); + this.notify(false); + } + }.bind(this)); + }, this); + }, this); + }, - convert: function () { - - var scopes = []; + convert: function () { + + var scopes = []; - this.scopes.forEach(function (scope) { - var el = this.$el.find('input[data-scope="' + scope + '"]').get(0); - if (el && el.checked) { - scopes.push(scope); - } - }.bind(this)); + this.scopes.forEach(function (scope) { + var el = this.$el.find('input[data-scope="' + scope + '"]').get(0); + if (el && el.checked) { + scopes.push(scope); + } + }.bind(this)); - if (scopes.length == 0) { - this.notify('Select one or more checkboxes', 'error'); - return; - } + if (scopes.length == 0) { + this.notify('Select one or more checkboxes', 'error'); + return; + } - var notValid = false; - scopes.forEach(function (scope) { - var editView = this.getView(scope); - editView.model.set(editView.fetch()); - notValid = editView.validate() || notValid; - }.bind(this)); - - var self = this; - - var data = { - id: self.model.id, - records: {} - }; - scopes.forEach(function (scope) { - data.records[scope] = self.getView(scope).model.attributes; - }); - + var notValid = false; + scopes.forEach(function (scope) { + var editView = this.getView(scope); + editView.model.set(editView.fetch()); + notValid = editView.validate() || notValid; + }.bind(this)); + + var self = this; + + var data = { + id: self.model.id, + records: {} + }; + scopes.forEach(function (scope) { + data.records[scope] = self.getView(scope).model.attributes; + }); + - if (!notValid) { - this.$el.find('[data-action="convert"]').addClass('disabled'); - this.notify('Please wait...'); - $.ajax({ - url: 'Lead/action/convert', - data: JSON.stringify(data), - type: 'POST', - success: function () { - self.getRouter().navigate('#Lead/view/' + self.model.id, {trigger: true}); - self.notify('Converted', 'success'); - }, - error: function () { - self.$el.find('[data-action="convert"]').removeClass('disabled'); - } - }); - } else { - this.notify('Not Valid', 'error'); - } - }, + if (!notValid) { + this.$el.find('[data-action="convert"]').addClass('disabled'); + this.notify('Please wait...'); + $.ajax({ + url: 'Lead/action/convert', + data: JSON.stringify(data), + type: 'POST', + success: function () { + self.getRouter().navigate('#Lead/view/' + self.model.id, {trigger: true}); + self.notify('Converted', 'success'); + }, + error: function () { + self.$el.find('[data-action="convert"]').removeClass('disabled'); + } + }); + } else { + this.notify('Not Valid', 'error'); + } + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/lead/detail.js b/frontend/client/modules/crm/src/views/lead/detail.js index 97697cc1cc..55c3122c74 100644 --- a/frontend/client/modules/crm/src/views/lead/detail.js +++ b/frontend/client/modules/crm/src/views/lead/detail.js @@ -21,24 +21,24 @@ Espo.define('Crm:Views.Lead.Detail', 'Views.Detail', function (Dep) { - return Dep.extend({ + return Dep.extend({ - setup: function () { - Dep.prototype.setup.call(this); - - if (['Converted', 'Dead'].indexOf(this.model.get('status')) == -1) { - this.menu.buttons.push({ - label: 'Convert', - action: 'convert', - acl: 'edit', - }); - } - }, - - actionConvert: function () { - this.getRouter().navigate(this.model.name + '/convert/' + this.model.id , {trigger: true}); - }, - }); + setup: function () { + Dep.prototype.setup.call(this); + + if (['Converted', 'Dead'].indexOf(this.model.get('status')) == -1) { + this.menu.buttons.push({ + label: 'Convert', + action: 'convert', + acl: 'edit', + }); + } + }, + + actionConvert: function () { + this.getRouter().navigate(this.model.name + '/convert/' + this.model.id , {trigger: true}); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/lead/record/detail-side.js b/frontend/client/modules/crm/src/views/lead/record/detail-side.js index cf7077a59d..efc31c6c4d 100644 --- a/frontend/client/modules/crm/src/views/lead/record/detail-side.js +++ b/frontend/client/modules/crm/src/views/lead/record/detail-side.js @@ -21,34 +21,34 @@ Espo.define('Crm:Views.Lead.Record.DetailSide', 'Views.Record.DetailSide', function (Dep) { - return Dep.extend({ + return Dep.extend({ - setup: function () { - if (this.model.get('status') == 'Converted') { - var panel = { - name: 'convertedTo', - label: 'Converted To', - view: 'Record.Panels.Side', - options: { - fields: [], - mode: 'detail', - } - }; - if (this.model.get('createdAccountId')) { - panel.options.fields.push('createdAccount'); - } - if (this.model.get('createdContactId')) { - panel.options.fields.push('createdContact'); - } - if (this.model.get('createdOpportunityId')) { - panel.options.fields.push('createdOpportunity'); - } - if (panel.options.fields.length) { - this.panels.splice(1, 0, panel); - } - } - Dep.prototype.setup.call(this); - }, - }); + setup: function () { + if (this.model.get('status') == 'Converted') { + var panel = { + name: 'convertedTo', + label: 'Converted To', + view: 'Record.Panels.Side', + options: { + fields: [], + mode: 'detail', + } + }; + if (this.model.get('createdAccountId')) { + panel.options.fields.push('createdAccount'); + } + if (this.model.get('createdContactId')) { + panel.options.fields.push('createdContact'); + } + if (this.model.get('createdOpportunityId')) { + panel.options.fields.push('createdOpportunity'); + } + if (panel.options.fields.length) { + this.panels.splice(1, 0, panel); + } + } + Dep.prototype.setup.call(this); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/lead/record/detail.js b/frontend/client/modules/crm/src/views/lead/record/detail.js index 68c9b5a198..4e146c1935 100644 --- a/frontend/client/modules/crm/src/views/lead/record/detail.js +++ b/frontend/client/modules/crm/src/views/lead/record/detail.js @@ -22,11 +22,11 @@ Espo.define('Crm:Views.Lead.Record.Detail', 'Views.Record.Detail', function (Dep) { - return Dep.extend({ - - sideView: 'Crm:Lead.Record.DetailSide', + return Dep.extend({ + + sideView: 'Crm:Lead.Record.DetailSide', - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/meeting/detail.js b/frontend/client/modules/crm/src/views/meeting/detail.js index 89facf28b5..046cd545ee 100644 --- a/frontend/client/modules/crm/src/views/meeting/detail.js +++ b/frontend/client/modules/crm/src/views/meeting/detail.js @@ -21,81 +21,81 @@ Espo.define('Crm:Views.Meeting.Detail', 'Views.Detail', function (Dep) { - return Dep.extend({ + return Dep.extend({ - setup: function () { - Dep.prototype.setup.call(this); - if (['Held', 'Not Held'].indexOf(this.model.get('status')) == -1) { - if (this.getAcl().checkModel(this.model, 'edit')) { - this.menu.buttons.push({ - 'label': 'Send Invitations', - 'action': 'sendInvitations', - icon: 'glyphicon glyphicon-send', - 'acl': 'edit', - }); - this.menu.dropdown.push({ - 'label': 'Set Held', - 'action': 'setHeld', - 'acl': 'edit' - }); - this.menu.dropdown.push({ - 'label': 'Set Not Held', - 'action': 'setNotHeld', - 'acl': 'edit' - }); - } - } - }, - - actionSendInvitations: function () { - if (confirm(this.translate('confirmation', 'messages'))) { - this.$el.find('button[data-action="sendInvitations"]').addClass('disabled'); - this.notify('Sending...'); - $.ajax({ - url: 'Meeting/action/sendInvitations', - type: 'POST', - data: JSON.stringify({ - id: this.model.id - }), - success: function () { - this.notify('Sent', 'success'); - this.$el.find('[data-action="sendInvitations"]').removeClass('disabled'); - }.bind(this), - error: function () { - this.$el.find('[data-action="sendInvitations"]').removeClass('disabled'); - }.bind(this), - }); - } - }, - - actionSetHeld: function () { - this.model.save({ - status: 'Held' - }, { - patch: true, - success: function () { - Espo.Ui.success(this.translate('Saved', 'labels', 'Meeting')); - this.$el.find('[data-action="sendInvitations"]').remove(); - this.$el.find('[data-action="setHeld"]').remove(); - this.$el.find('[data-action="setNotHeld"]').remove(); - }.bind(this), - }); - }, - - actionSetNotHeld: function () { - this.model.save({ - status: 'Not Held' - }, { - patch: true, - success: function () { - Espo.Ui.success(this.translate('Saved', 'labels', 'Meeting')); - this.$el.find('[data-action="sendInvitations"]').remove(); - this.$el.find('[data-action="setHeld"]').remove(); - this.$el.find('[data-action="setNotHeld"]').remove(); - }.bind(this), - }); - }, + setup: function () { + Dep.prototype.setup.call(this); + if (['Held', 'Not Held'].indexOf(this.model.get('status')) == -1) { + if (this.getAcl().checkModel(this.model, 'edit')) { + this.menu.buttons.push({ + 'label': 'Send Invitations', + 'action': 'sendInvitations', + icon: 'glyphicon glyphicon-send', + 'acl': 'edit', + }); + this.menu.dropdown.push({ + 'label': 'Set Held', + 'action': 'setHeld', + 'acl': 'edit' + }); + this.menu.dropdown.push({ + 'label': 'Set Not Held', + 'action': 'setNotHeld', + 'acl': 'edit' + }); + } + } + }, + + actionSendInvitations: function () { + if (confirm(this.translate('confirmation', 'messages'))) { + this.$el.find('button[data-action="sendInvitations"]').addClass('disabled'); + this.notify('Sending...'); + $.ajax({ + url: 'Meeting/action/sendInvitations', + type: 'POST', + data: JSON.stringify({ + id: this.model.id + }), + success: function () { + this.notify('Sent', 'success'); + this.$el.find('[data-action="sendInvitations"]').removeClass('disabled'); + }.bind(this), + error: function () { + this.$el.find('[data-action="sendInvitations"]').removeClass('disabled'); + }.bind(this), + }); + } + }, + + actionSetHeld: function () { + this.model.save({ + status: 'Held' + }, { + patch: true, + success: function () { + Espo.Ui.success(this.translate('Saved', 'labels', 'Meeting')); + this.$el.find('[data-action="sendInvitations"]').remove(); + this.$el.find('[data-action="setHeld"]').remove(); + this.$el.find('[data-action="setNotHeld"]').remove(); + }.bind(this), + }); + }, + + actionSetNotHeld: function () { + this.model.save({ + status: 'Not Held' + }, { + patch: true, + success: function () { + Espo.Ui.success(this.translate('Saved', 'labels', 'Meeting')); + this.$el.find('[data-action="sendInvitations"]').remove(); + this.$el.find('[data-action="setHeld"]').remove(); + this.$el.find('[data-action="setNotHeld"]').remove(); + }.bind(this), + }); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/meeting/fields/attendees.js b/frontend/client/modules/crm/src/views/meeting/fields/attendees.js index 54459626b1..5758840e39 100644 --- a/frontend/client/modules/crm/src/views/meeting/fields/attendees.js +++ b/frontend/client/modules/crm/src/views/meeting/fields/attendees.js @@ -21,12 +21,12 @@ Espo.define('Crm:Views.Meeting.Fields.Attendees', 'Views.Fields.LinkMultipleWithRole', function (Dep) { - return Dep.extend({ - - columnName: 'status', - - roleFieldIsForeign: false, - - }); + return Dep.extend({ + + columnName: 'status', + + roleFieldIsForeign: false, + + }); }); diff --git a/frontend/client/modules/crm/src/views/meeting/fields/contacts.js b/frontend/client/modules/crm/src/views/meeting/fields/contacts.js index 9d54715a7b..dcf4a7d409 100644 --- a/frontend/client/modules/crm/src/views/meeting/fields/contacts.js +++ b/frontend/client/modules/crm/src/views/meeting/fields/contacts.js @@ -21,20 +21,20 @@ Espo.define('Crm:Views.Meeting.Fields.Contacts', 'Crm:Views.Meeting.Fields.Attendees', function (Dep) { - return Dep.extend({ - - getSelectFilters: function () { - if (this.model.get('parentType') == 'Account' && this.model.get('parentId')) { - return { - 'account': { - type: 'equals', - field: 'accountId', - value: this.model.get('parentId'), - valueName: this.model.get('parentName'), - } - }; - } - }, - }); + return Dep.extend({ + + getSelectFilters: function () { + if (this.model.get('parentType') == 'Account' && this.model.get('parentId')) { + return { + 'account': { + type: 'equals', + field: 'accountId', + value: this.model.get('parentId'), + valueName: this.model.get('parentName'), + } + }; + } + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/opportunity/detail.js b/frontend/client/modules/crm/src/views/opportunity/detail.js index dfcd196657..e498e5cc22 100644 --- a/frontend/client/modules/crm/src/views/opportunity/detail.js +++ b/frontend/client/modules/crm/src/views/opportunity/detail.js @@ -21,31 +21,31 @@ Espo.define('Crm:Views.Opportunity.Detail', 'Views.Detail', function (Dep) { - return Dep.extend({ + return Dep.extend({ - relatedAttributeMap: { - 'contacts': { - 'accountId': 'accountId', - 'accountName': 'accountName' - }, - }, - - selectRelatedFilters: { - 'contacts': { - 'account': function () { - if (this.model.get('accountId')) { - return { - field: 'accountId', - type: 'equals', - value: this.model.get('accountId'), - valueName: this.model.get('accountName') - }; - } - }, - - }, - }, - - }); + relatedAttributeMap: { + 'contacts': { + 'accountId': 'accountId', + 'accountName': 'accountName' + }, + }, + + selectRelatedFilters: { + 'contacts': { + 'account': function () { + if (this.model.get('accountId')) { + return { + field: 'accountId', + type: 'equals', + value: this.model.get('accountId'), + valueName: this.model.get('accountName') + }; + } + }, + + }, + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/opportunity/fields/contacts.js b/frontend/client/modules/crm/src/views/opportunity/fields/contacts.js index 80c7309e01..ae2874d0cf 100644 --- a/frontend/client/modules/crm/src/views/opportunity/fields/contacts.js +++ b/frontend/client/modules/crm/src/views/opportunity/fields/contacts.js @@ -21,20 +21,20 @@ Espo.define('Crm:Views.Opportunity.Fields.Contacts', 'Views.Fields.LinkMultipleWithRole', function (Dep) { - return Dep.extend({ - - getSelectFilters: function () { - if (this.model.get('accountId')) { - return { - 'account': { - type: 'equals', - field: 'accountId', - value: this.model.get('accountId'), - valueName: this.model.get('accountName'), - } - }; - } - }, - }); + return Dep.extend({ + + getSelectFilters: function () { + if (this.model.get('accountId')) { + return { + 'account': { + type: 'equals', + field: 'accountId', + value: this.model.get('accountId'), + valueName: this.model.get('accountName'), + } + }; + } + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/opportunity/fields/lead-source.js b/frontend/client/modules/crm/src/views/opportunity/fields/lead-source.js index 3f7d7fcd50..5fe76254e9 100644 --- a/frontend/client/modules/crm/src/views/opportunity/fields/lead-source.js +++ b/frontend/client/modules/crm/src/views/opportunity/fields/lead-source.js @@ -21,21 +21,21 @@ Espo.define('Crm:Views.Opportunity.Fields.LeadSource', 'Views.Fields.Enum', function (Dep) { - return Dep.extend({ - - listTemplate: 'crm:opportunity.fields.lead-source.detail', + return Dep.extend({ + + listTemplate: 'crm:opportunity.fields.lead-source.detail', - detailTemplate: 'crm:opportunity.fields.lead-source.detail', + detailTemplate: 'crm:opportunity.fields.lead-source.detail', - editTemplate: 'crm:opportunity.fields.lead-source.edit', + editTemplate: 'crm:opportunity.fields.lead-source.edit', - searchTemplate: 'crm:opportunity.fields.lead-source.search', - - setup: function () { - Dep.prototype.setup.call(this); - this.params.options = this.getMetadata().get('entityDefs.Lead.fields.source.options'); - }, - - }); + searchTemplate: 'crm:opportunity.fields.lead-source.search', + + setup: function () { + Dep.prototype.setup.call(this); + this.params.options = this.getMetadata().get('entityDefs.Lead.fields.source.options'); + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/opportunity/fields/stage.js b/frontend/client/modules/crm/src/views/opportunity/fields/stage.js index 4fdc109df3..c83615c47a 100644 --- a/frontend/client/modules/crm/src/views/opportunity/fields/stage.js +++ b/frontend/client/modules/crm/src/views/opportunity/fields/stage.js @@ -21,48 +21,48 @@ Espo.define('Crm:Views.Opportunity.Fields.Stage', 'Views.Fields.Enum', function (Dep) { - return Dep.extend({ - - listTemplate: 'fields.enum-styled.detail', - - detailTemplate: 'fields.enum-styled.detail', - - data: function () { - var style = 'default'; - var stage = this.model.get('stage'); - if (stage == 'Closed Won') { - style = 'success'; - } else if (stage == 'Closed Lost') { - style = 'danger'; - } - return _.extend({ - style: style, - }, Dep.prototype.data.call(this)); - }, + return Dep.extend({ + + listTemplate: 'fields.enum-styled.detail', + + detailTemplate: 'fields.enum-styled.detail', + + data: function () { + var style = 'default'; + var stage = this.model.get('stage'); + if (stage == 'Closed Won') { + style = 'success'; + } else if (stage == 'Closed Lost') { + style = 'danger'; + } + return _.extend({ + style: style, + }, Dep.prototype.data.call(this)); + }, - setup: function () { - Dep.prototype.setup.call(this); - - this.probabilityMap = this.getMetadata().get('entityDefs.Opportunity.probabilityMap') || {}; - - if (this.mode != 'list') { - if (!this.model.has('probability') && this.model.has('stage')) { - this.model.set('probability', this.probabilityMap[this.model.get('stage')]); - } + setup: function () { + Dep.prototype.setup.call(this); + + this.probabilityMap = this.getMetadata().get('entityDefs.Opportunity.probabilityMap') || {}; + + if (this.mode != 'list') { + if (!this.model.has('probability') && this.model.has('stage')) { + this.model.set('probability', this.probabilityMap[this.model.get('stage')]); + } - this.on('change', function () { - this.model.set('probability', this.probabilityMap[this.model.get(this.name)]); - }, this); - } - }, + this.on('change', function () { + this.model.set('probability', this.probabilityMap[this.model.get(this.name)]); + }, this); + } + }, - fetch: function () { - var data = Dep.prototype.fetch.call(this); - if (this.probabilityChanged) { - data['probability'] = this.model.get('probability'); - } - return data; - }, - }); + fetch: function () { + var data = Dep.prototype.fetch.call(this); + if (this.probabilityChanged) { + data['probability'] = this.model.get('probability'); + } + return data; + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/record/panels/activities.js b/frontend/client/modules/crm/src/views/record/panels/activities.js index dad8f10e27..95ca058517 100644 --- a/frontend/client/modules/crm/src/views/record/panels/activities.js +++ b/frontend/client/modules/crm/src/views/record/panels/activities.js @@ -21,266 +21,266 @@ Espo.define('Crm:Views.Record.Panels.Activities', 'Views.Record.Panels.Relationship', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'activities', + name: 'activities', - template: 'crm:record.panels.activities', + template: 'crm:record.panels.activities', - scopeList: ['Meeting', 'Call'], + scopeList: ['Meeting', 'Call'], - sortBy: 'dateStart', + sortBy: 'dateStart', - asc: false, - - actions: [ - { - action: 'createActivity', - label: 'Schedule Meeting', - data: { - link: 'meetings', - status: 'Planned', - }, - acl: 'edit', - aclScope: 'Meeting', - }, - { - action: 'createActivity', - label: 'Schedule Call', - data: { - link: 'calls', - status: 'Planned', - }, - acl: 'edit', - aclScope: 'Call', - }, - { - action: 'composeEmail', - label: 'Compose Email', - acl: 'edit', - aclScope: 'Email', - } - ], + asc: false, + + actions: [ + { + action: 'createActivity', + label: 'Schedule Meeting', + data: { + link: 'meetings', + status: 'Planned', + }, + acl: 'edit', + aclScope: 'Meeting', + }, + { + action: 'createActivity', + label: 'Schedule Call', + data: { + link: 'calls', + status: 'Planned', + }, + acl: 'edit', + aclScope: 'Call', + }, + { + action: 'composeEmail', + label: 'Compose Email', + acl: 'edit', + aclScope: 'Email', + } + ], - listLayout: { - 'Meeting': { - rows: [ - [ - {name: 'ico', view: 'Crm:Fields.Ico'}, - { - name: 'name', - link: true, - }, - ], - [ - {name: 'assignedUser'}, - {name: 'dateStart'}, - ] - ] - }, - 'Call': { - rows: [ - [ - {name: 'ico', view: 'Crm:Fields.Ico'}, - { - name: 'name', - link: true, - }, - ], - [ - {name: 'assignedUser'}, - {name: 'dateStart'}, - ] - ] - } - }, + listLayout: { + 'Meeting': { + rows: [ + [ + {name: 'ico', view: 'Crm:Fields.Ico'}, + { + name: 'name', + link: true, + }, + ], + [ + {name: 'assignedUser'}, + {name: 'dateStart'}, + ] + ] + }, + 'Call': { + rows: [ + [ + {name: 'ico', view: 'Crm:Fields.Ico'}, + { + name: 'name', + link: true, + }, + ], + [ + {name: 'assignedUser'}, + {name: 'dateStart'}, + ] + ] + } + }, - where: { - scope: false, - }, - - events: _.extend({ - 'click button.scope-switcher': function (e) { - var $target = $(e.currentTarget); - this.$el.find('button.scope-switcher').removeClass('active'); - $target.addClass('active'); - this.where.scope = $target.data('scope') || false; - - this.listenToOnce(this.collection, 'sync', function () { - this.notify(false); - }.bind(this)); - this.notify('Loading...'); - this.collection.fetch(); - - this.currentTab = this.where.scope || 'all'; - this.getStorage().set('state', this.getStorageKey(), this.currentTab); - } - }, Dep.prototype.events), + where: { + scope: false, + }, + + events: _.extend({ + 'click button.scope-switcher': function (e) { + var $target = $(e.currentTarget); + this.$el.find('button.scope-switcher').removeClass('active'); + $target.addClass('active'); + this.where.scope = $target.data('scope') || false; + + this.listenToOnce(this.collection, 'sync', function () { + this.notify(false); + }.bind(this)); + this.notify('Loading...'); + this.collection.fetch(); + + this.currentTab = this.where.scope || 'all'; + this.getStorage().set('state', this.getStorageKey(), this.currentTab); + } + }, Dep.prototype.events), - data: function () { - return { - currentTab: this.currentTab, - scopeList: this.scopeList - }; - }, - - getStorageKey: function () { - return 'activities-' + this.model.name + '-' + this.name; - }, + data: function () { + return { + currentTab: this.currentTab, + scopeList: this.scopeList + }; + }, + + getStorageKey: function () { + return 'activities-' + this.model.name + '-' + this.name; + }, - setup: function () { - - this.currentTab = this.getStorage().get('state', this.getStorageKey()) || 'all'; - - if (this.currentTab != 'all') { - this.where = {scope: this.currentTab}; - } - - this.seeds = {}; + setup: function () { + + this.currentTab = this.getStorage().get('state', this.getStorageKey()) || 'all'; + + if (this.currentTab != 'all') { + this.where = {scope: this.currentTab}; + } + + this.seeds = {}; - this.wait(true); - var i = 0; - this.scopeList.forEach(function (scope) { - this.getModelFactory().getSeed(scope, function (seed) { - this.seeds[scope] = seed; - i++; - if (i == this.scopeList.length) { - this.wait(false); - } - }.bind(this)); - }.bind(this)); - }, + this.wait(true); + var i = 0; + this.scopeList.forEach(function (scope) { + this.getModelFactory().getSeed(scope, function (seed) { + this.seeds[scope] = seed; + i++; + if (i == this.scopeList.length) { + this.wait(false); + } + }.bind(this)); + }.bind(this)); + }, - afterRender: function () { - var url = 'Activities/' + this.model.name + '/' + this.model.id + '/' + this.name; + afterRender: function () { + var url = 'Activities/' + this.model.name + '/' + this.model.id + '/' + this.name; - this.collection = new Espo.MultiCollection(); - this.collection.seeds = this.seeds; - this.collection.url = url; - this.collection.where = this.where; - this.collection.sortBy = this.sortBy; - this.collection.asc = this.asc; - this.collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; + this.collection = new Espo.MultiCollection(); + this.collection.seeds = this.seeds; + this.collection.url = url; + this.collection.where = this.where; + this.collection.sortBy = this.sortBy; + this.collection.asc = this.asc; + this.collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; - this.listenToOnce(this.collection, 'sync', function () { - this.createView('list', 'Record.ListExpanded', { - el: this.$el.selector + ' > .list-container', - pagination: false, - type: 'listRelationship', - rowActionsView: 'Record.RowActions.RelationshipNoUnlink', - checkboxes: false, - collection: this.collection, - listLayout: this.listLayout, - }, function (view) { - view.render(); - }); - }.bind(this)); - this.collection.fetch(); - }, - - getCreateActivityAttributes: function (data, callback) { - data = data || {}; - - var attributes = { - status: data.status - }; - - if (this.model.name == 'Contact') { - if (this.model.get('accountId')) { - attributes.parentType = 'Account', - attributes.parentId = this.model.get('accountId'); - attributes.parentName = this.model.get('accountName'); - } - } else if (this.model.name == 'Lead') { - attributes.parentType = 'Lead', - attributes.parentId = this.model.id - attributes.parentName = this.model.get('name'); - } - if (this.model.name != 'Account' && this.model.has('contactsIds')) { - attributes.contactsIds = this.model.get('contactsIds'); - attributes.contactsNames = this.model.get('contactsNames'); - } - - callback.call(this, attributes); - }, + this.listenToOnce(this.collection, 'sync', function () { + this.createView('list', 'Record.ListExpanded', { + el: this.$el.selector + ' > .list-container', + pagination: false, + type: 'listRelationship', + rowActionsView: 'Record.RowActions.RelationshipNoUnlink', + checkboxes: false, + collection: this.collection, + listLayout: this.listLayout, + }, function (view) { + view.render(); + }); + }.bind(this)); + this.collection.fetch(); + }, + + getCreateActivityAttributes: function (data, callback) { + data = data || {}; + + var attributes = { + status: data.status + }; + + if (this.model.name == 'Contact') { + if (this.model.get('accountId')) { + attributes.parentType = 'Account', + attributes.parentId = this.model.get('accountId'); + attributes.parentName = this.model.get('accountName'); + } + } else if (this.model.name == 'Lead') { + attributes.parentType = 'Lead', + attributes.parentId = this.model.id + attributes.parentName = this.model.get('name'); + } + if (this.model.name != 'Account' && this.model.has('contactsIds')) { + attributes.contactsIds = this.model.get('contactsIds'); + attributes.contactsNames = this.model.get('contactsNames'); + } + + callback.call(this, attributes); + }, - actionCreateActivity: function (data) { - var self = this; - var link = data.link; - var scope = this.model.defs['links'][link].entity; - var foreignLink = this.model.defs['links'][link].foreign; + actionCreateActivity: function (data) { + var self = this; + var link = data.link; + var scope = this.model.defs['links'][link].entity; + var foreignLink = this.model.defs['links'][link].foreign; - this.notify('Loading...'); - - this.getCreateActivityAttributes(data, function (attributes) { - this.createView('quickCreate', 'Modals.Edit', { - scope: scope, - relate: { - model: this.model, - link: foreignLink, - }, - attributes: attributes, - }, function (view) { - view.render(); - view.notify(false); - view.once('after:save', function () { - self.collection.fetch(); - }); - }); - }); + this.notify('Loading...'); + + this.getCreateActivityAttributes(data, function (attributes) { + this.createView('quickCreate', 'Modals.Edit', { + scope: scope, + relate: { + model: this.model, + link: foreignLink, + }, + attributes: attributes, + }, function (view) { + view.render(); + view.notify(false); + view.once('after:save', function () { + self.collection.fetch(); + }); + }); + }); - }, - - getComposeEmailAttributes: function (data, callback) { - data = data || {}; - var attributes = { - status: 'Draft', - to: this.model.get('emailAddress') - }; - callback.call(this, attributes); - }, - - actionComposeEmail: function () { - var self = this; - var link = 'emails'; - var scope = 'Email'; - - var relate = null; - if ('emails' in this.model.defs['links']) { - relate = { - model: this.model, - link: this.model.defs['links']['emails'].foreign - }; - } + }, + + getComposeEmailAttributes: function (data, callback) { + data = data || {}; + var attributes = { + status: 'Draft', + to: this.model.get('emailAddress') + }; + callback.call(this, attributes); + }, + + actionComposeEmail: function () { + var self = this; + var link = 'emails'; + var scope = 'Email'; + + var relate = null; + if ('emails' in this.model.defs['links']) { + relate = { + model: this.model, + link: this.model.defs['links']['emails'].foreign + }; + } - this.notify('Loading...'); - - this.getComposeEmailAttributes(null, function (attributes) { - if (this.model.name == 'Contact') { - if (this.model.get('accountId')) { - attributes.parentType = 'Account', - attributes.parentId = this.model.get('accountId'); - attributes.parentName = this.model.get('accountName'); - } - } else if (this.model.name == 'Lead') { - attributes.parentType = 'Lead', - attributes.parentId = this.model.id - attributes.parentName = this.model.get('name'); - } + this.notify('Loading...'); + + this.getComposeEmailAttributes(null, function (attributes) { + if (this.model.name == 'Contact') { + if (this.model.get('accountId')) { + attributes.parentType = 'Account', + attributes.parentId = this.model.get('accountId'); + attributes.parentName = this.model.get('accountName'); + } + } else if (this.model.name == 'Lead') { + attributes.parentType = 'Lead', + attributes.parentId = this.model.id + attributes.parentName = this.model.get('name'); + } - this.createView('quickCreate', 'Modals.ComposeEmail', { - relate: relate, - attributes: attributes - }, function (view) { - view.render(); - view.notify(false); - view.once('after:save', function () { - self.collection.fetch(); - }); - }); - }); + this.createView('quickCreate', 'Modals.ComposeEmail', { + relate: relate, + attributes: attributes + }, function (view) { + view.render(); + view.notify(false); + view.once('after:save', function () { + self.collection.fetch(); + }); + }); + }); - }, - }); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/record/panels/history.js b/frontend/client/modules/crm/src/views/record/panels/history.js index 512bf71edb..0554a0dd96 100644 --- a/frontend/client/modules/crm/src/views/record/panels/history.js +++ b/frontend/client/modules/crm/src/views/record/panels/history.js @@ -21,154 +21,154 @@ Espo.define('Crm:Views.Record.Panels.History', 'Crm:Views.Record.Panels.Activities', function (Dep) { - return Dep.extend({ - - name: 'history', + return Dep.extend({ + + name: 'history', - scopeList: ['Meeting', 'Call', 'Email'], - - sortBy: 'dateStart', - - asc: false, - - actions: [ - { - action: 'createActivity', - label: 'Log Meeting', - data: { - link: 'meetings', - status: 'Held', - }, - acl: 'edit', - aclScope: 'Meeting', - }, - { - action: 'createActivity', - label: 'Log Call', - data: { - link: 'calls', - status: 'Held', - }, - acl: 'edit', - aclScope: 'Call', - }, - { - action: 'archiveEmail', - label: 'Archive Email', - acl: 'edit', - aclScope: 'Email', - }, - ], - - listLayout: { - 'Meeting': { - rows: [ - [ - {name: 'ico', view: 'Crm:Fields.Ico'}, - { - name: 'name', - link: true, - }, - {name: 'status'}, - ], - [ - {name: 'assignedUser'}, - {name: 'dateStart'}, - ] - ] - }, - 'Call': { - rows: [ - [ - {name: 'ico', view: 'Crm:Fields.Ico'}, - { - name: 'name', - link: true, - }, - {name: 'status'}, - ], - [ - {name: 'assignedUser'}, - {name: 'dateStart'}, - ] - ] - }, - 'Email': { - rows: [ - [ - {name: 'ico', view: 'Crm:Fields.Ico'}, - { - name: 'name', - link: true, - }, - ], - [ - {name: 'assignedUser'}, - {name: 'status'}, - {name: 'dateSent'}, - ] - ] - }, - }, - - where: { - scope: false, - }, - - getArchiveEmailAttributes: function (data, callback) { - data = data || {}; - var attributes = { - dateSent: this.getDateTime().getNow(15), - status: 'Archived', - from: this.model.get('emailAddress'), - to: this.getUser().get('emailAddress') - }; - - if (this.model.name == 'Contact') { - if (this.model.get('accountId')) { - attributes.parentType = 'Account', - attributes.parentId = this.model.get('accountId'); - attributes.parentName = this.model.get('accountName'); - } - } else if (this.model.name == 'Lead') { - attributes.parentType = 'Lead', - attributes.parentId = this.model.id - attributes.parentName = this.model.get('name'); - } - callback.call(this, attributes); - }, - - actionArchiveEmail: function (data) { - var self = this; - var link = 'emails'; - var scope = 'Email'; - - var relate = null; - if ('emails' in this.model.defs['links']) { - relate = { - model: this.model, - link: this.model.defs['links']['emails'].foreign - }; - } + scopeList: ['Meeting', 'Call', 'Email'], + + sortBy: 'dateStart', + + asc: false, + + actions: [ + { + action: 'createActivity', + label: 'Log Meeting', + data: { + link: 'meetings', + status: 'Held', + }, + acl: 'edit', + aclScope: 'Meeting', + }, + { + action: 'createActivity', + label: 'Log Call', + data: { + link: 'calls', + status: 'Held', + }, + acl: 'edit', + aclScope: 'Call', + }, + { + action: 'archiveEmail', + label: 'Archive Email', + acl: 'edit', + aclScope: 'Email', + }, + ], + + listLayout: { + 'Meeting': { + rows: [ + [ + {name: 'ico', view: 'Crm:Fields.Ico'}, + { + name: 'name', + link: true, + }, + {name: 'status'}, + ], + [ + {name: 'assignedUser'}, + {name: 'dateStart'}, + ] + ] + }, + 'Call': { + rows: [ + [ + {name: 'ico', view: 'Crm:Fields.Ico'}, + { + name: 'name', + link: true, + }, + {name: 'status'}, + ], + [ + {name: 'assignedUser'}, + {name: 'dateStart'}, + ] + ] + }, + 'Email': { + rows: [ + [ + {name: 'ico', view: 'Crm:Fields.Ico'}, + { + name: 'name', + link: true, + }, + ], + [ + {name: 'assignedUser'}, + {name: 'status'}, + {name: 'dateSent'}, + ] + ] + }, + }, + + where: { + scope: false, + }, + + getArchiveEmailAttributes: function (data, callback) { + data = data || {}; + var attributes = { + dateSent: this.getDateTime().getNow(15), + status: 'Archived', + from: this.model.get('emailAddress'), + to: this.getUser().get('emailAddress') + }; + + if (this.model.name == 'Contact') { + if (this.model.get('accountId')) { + attributes.parentType = 'Account', + attributes.parentId = this.model.get('accountId'); + attributes.parentName = this.model.get('accountName'); + } + } else if (this.model.name == 'Lead') { + attributes.parentType = 'Lead', + attributes.parentId = this.model.id + attributes.parentName = this.model.get('name'); + } + callback.call(this, attributes); + }, + + actionArchiveEmail: function (data) { + var self = this; + var link = 'emails'; + var scope = 'Email'; + + var relate = null; + if ('emails' in this.model.defs['links']) { + relate = { + model: this.model, + link: this.model.defs['links']['emails'].foreign + }; + } - this.notify('Loading...'); - - this.getArchiveEmailAttributes(data, function (attributes) { - this.createView('quickCreate', 'Modals.Edit', { - scope: scope, - relate: relate, - attributes: attributes - }, function (view) { - view.render(); - view.notify(false); - view.once('after:save', function () { - self.collection.fetch(); - }); - }); - }); + this.notify('Loading...'); + + this.getArchiveEmailAttributes(data, function (attributes) { + this.createView('quickCreate', 'Modals.Edit', { + scope: scope, + relate: relate, + attributes: attributes + }, function (view) { + view.render(); + view.notify(false); + view.once('after:save', function () { + self.collection.fetch(); + }); + }); + }); - }, - }); + }, + }); }); diff --git a/frontend/client/modules/crm/src/views/record/panels/tasks.js b/frontend/client/modules/crm/src/views/record/panels/tasks.js index 7955b0772b..686a7c94a4 100644 --- a/frontend/client/modules/crm/src/views/record/panels/tasks.js +++ b/frontend/client/modules/crm/src/views/record/panels/tasks.js @@ -21,147 +21,147 @@ Espo.define('Crm:Views.Record.Panels.Tasks', 'Views.Record.Panels.Relationship', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'tasks', + name: 'tasks', - template: 'crm:record.panels.tasks', + template: 'crm:record.panels.tasks', - tabList: ['Active', 'Inactive'], + tabList: ['Active', 'Inactive'], - sortBy: 'createdAt', + sortBy: 'createdAt', - asc: false, - - actions: [ - { - action: 'createTask', - label: 'Create Task', - acl: 'edit', - aclScope: 'Task', - } - ], + asc: false, + + actions: [ + { + action: 'createTask', + label: 'Create Task', + acl: 'edit', + aclScope: 'Task', + } + ], - listLayout: { - rows: [ - [ - { - name: 'name', - link: true, - }, - { - name: 'isOverdue' - } - ], - [ - {name: 'assignedUser'}, - {name: 'status'}, - {name: 'dateEnd'}, - ] - ] - }, + listLayout: { + rows: [ + [ + { + name: 'name', + link: true, + }, + { + name: 'isOverdue' + } + ], + [ + {name: 'assignedUser'}, + {name: 'status'}, + {name: 'dateEnd'}, + ] + ] + }, - - events: _.extend({ - 'click button.tab-switcher': function (e) { - var $target = $(e.currentTarget); - this.$el.find('button.tab-switcher').removeClass('active'); - $target.addClass('active'); - - this.currentTab = $target.data('tab'); - - this.collection.where = this.where = [ - { - type: 'boolFilters', - value: [this.currentTab] - } - ]; - - this.listenToOnce(this.collection, 'sync', function () { - this.notify(false); - }.bind(this)); - this.notify('Loading...'); - this.collection.fetch(); - - this.getStorage().set('state', this.getStorageKey(), this.currentTab); - } - }, Dep.prototype.events), + + events: _.extend({ + 'click button.tab-switcher': function (e) { + var $target = $(e.currentTarget); + this.$el.find('button.tab-switcher').removeClass('active'); + $target.addClass('active'); + + this.currentTab = $target.data('tab'); + + this.collection.where = this.where = [ + { + type: 'boolFilters', + value: [this.currentTab] + } + ]; + + this.listenToOnce(this.collection, 'sync', function () { + this.notify(false); + }.bind(this)); + this.notify('Loading...'); + this.collection.fetch(); + + this.getStorage().set('state', this.getStorageKey(), this.currentTab); + } + }, Dep.prototype.events), - data: function () { - return { - currentTab: this.currentTab, - tabList: this.tabList - }; - }, - - getStorageKey: function () { - return 'tasks-' + this.model.name + '-' + this.name; - }, + data: function () { + return { + currentTab: this.currentTab, + tabList: this.tabList + }; + }, + + getStorageKey: function () { + return 'tasks-' + this.model.name + '-' + this.name; + }, - setup: function () { - this.currentTab = this.getStorage().get('state', this.getStorageKey()) || 'Active'; - - this.where = [ - { - type: 'boolFilters', - value: [this.currentTab] - } - ]; - }, + setup: function () { + this.currentTab = this.getStorage().get('state', this.getStorageKey()) || 'Active'; + + this.where = [ + { + type: 'boolFilters', + value: [this.currentTab] + } + ]; + }, - afterRender: function () { - var url = this.model.name + '/' + this.model.id + '/tasks'; + afterRender: function () { + var url = this.model.name + '/' + this.model.id + '/tasks'; - this.getCollectionFactory().create('Task', function (collection) { - this.collection = collection; - collection.seeds = this.seeds; - collection.url = url; - collection.where = this.where; - collection.sortBy = this.sortBy; - collection.asc = this.asc; - collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; + this.getCollectionFactory().create('Task', function (collection) { + this.collection = collection; + collection.seeds = this.seeds; + collection.url = url; + collection.where = this.where; + collection.sortBy = this.sortBy; + collection.asc = this.asc; + collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; - this.listenToOnce(this.collection, 'sync', function () { - this.createView('list', 'Record.ListExpanded', { - el: this.$el.selector + ' > .list-container', - pagination: false, - type: 'listRelationship', - rowActionsView: 'Record.RowActions.RelationshipNoUnlink', - checkboxes: false, - collection: collection, - listLayout: this.listLayout, - }, function (view) { - view.render(); - }); - }.bind(this)); - this.collection.fetch(); - }, this); - }, - - actionCreateTask: function (data) { - var self = this; - var link = 'tasks'; - var scope = 'Task'; - var foreignLink = this.model.defs['links'][link].foreign; + this.listenToOnce(this.collection, 'sync', function () { + this.createView('list', 'Record.ListExpanded', { + el: this.$el.selector + ' > .list-container', + pagination: false, + type: 'listRelationship', + rowActionsView: 'Record.RowActions.RelationshipNoUnlink', + checkboxes: false, + collection: collection, + listLayout: this.listLayout, + }, function (view) { + view.render(); + }); + }.bind(this)); + this.collection.fetch(); + }, this); + }, + + actionCreateTask: function (data) { + var self = this; + var link = 'tasks'; + var scope = 'Task'; + var foreignLink = this.model.defs['links'][link].foreign; - this.notify('Loading...'); - this.getModelFactory().create(scope, function (model) { - this.createView('quickCreate', 'Modals.Edit', { - scope: scope, - relate: { - model: this.model, - link: foreignLink, - } - }, function (view) { - view.render(); - view.notify(false); - view.once('after:save', function () { - self.collection.fetch(); - }); - }); - }.bind(this)); - }, + this.notify('Loading...'); + this.getModelFactory().create(scope, function (model) { + this.createView('quickCreate', 'Modals.Edit', { + scope: scope, + relate: { + model: this.model, + link: foreignLink, + } + }, function (view) { + view.render(); + view.notify(false); + view.once('after:save', function () { + self.collection.fetch(); + }); + }); + }.bind(this)); + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/target/detail.js b/frontend/client/modules/crm/src/views/target/detail.js index 306a0eccaa..a2b5699ed1 100644 --- a/frontend/client/modules/crm/src/views/target/detail.js +++ b/frontend/client/modules/crm/src/views/target/detail.js @@ -21,26 +21,26 @@ Espo.define('Crm:Views.Target.Detail', 'Views.Detail', function (Dep) { - return Dep.extend({ + return Dep.extend({ - actionConvertToLead: function () { - var id = this.model.id; - var self = this; - - if (confirm(this.translate('confirmation', 'messages'))) { - self.notify('Please wait...'); - $.ajax({ - url: 'Target/action/convert', - data: JSON.stringify({id: id}), - type: 'POST', - success: function (data) { - self.getRouter().navigate('#Lead/view/' + data.id, {trigger: true}); - self.notify('Converted', 'success'); - } - }); - } - }, + actionConvertToLead: function () { + var id = this.model.id; + var self = this; + + if (confirm(this.translate('confirmation', 'messages'))) { + self.notify('Please wait...'); + $.ajax({ + url: 'Target/action/convert', + data: JSON.stringify({id: id}), + type: 'POST', + success: function (data) { + self.getRouter().navigate('#Lead/view/' + data.id, {trigger: true}); + self.notify('Converted', 'success'); + } + }); + } + }, - }); + }); }); diff --git a/frontend/client/modules/crm/src/views/task/detail.js b/frontend/client/modules/crm/src/views/task/detail.js index 37a6b5b2a4..15f3331339 100644 --- a/frontend/client/modules/crm/src/views/task/detail.js +++ b/frontend/client/modules/crm/src/views/task/detail.js @@ -18,40 +18,40 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - + Espo.define('Crm:Views.Task.Detail', 'Views.Detail', function (Dep) { - return Dep.extend({ - - setup: function () { - Dep.prototype.setup.call(this); - if (!~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { - if (this.getAcl().checkModel(this.model, 'edit')) { - this.menu.buttons.push({ - 'label': 'Complete', - 'action': 'setCompleted', - icon: 'glyphicon glyphicon-ok', - 'acl': 'edit', - }); - } - } - }, - - actionSetCompleted: function (data) { - var id = data.id; - - this.model.save({ - status: 'Completed' - }, { - patch: true, - success: function () { - Espo.Ui.success(this.translate('Saved')); - this.$el.find('[data-action="setCompleted"]').remove(); - }.bind(this), - }); - - }, - - }); - + return Dep.extend({ + + setup: function () { + Dep.prototype.setup.call(this); + if (!~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { + if (this.getAcl().checkModel(this.model, 'edit')) { + this.menu.buttons.push({ + 'label': 'Complete', + 'action': 'setCompleted', + icon: 'glyphicon glyphicon-ok', + 'acl': 'edit', + }); + } + } + }, + + actionSetCompleted: function (data) { + var id = data.id; + + this.model.save({ + status: 'Completed' + }, { + patch: true, + success: function () { + Espo.Ui.success(this.translate('Saved')); + this.$el.find('[data-action="setCompleted"]').remove(); + }.bind(this), + }); + + }, + + }); + }); diff --git a/frontend/client/modules/crm/src/views/task/fields/date-end.js b/frontend/client/modules/crm/src/views/task/fields/date-end.js index 5345478778..1de6f1c406 100644 --- a/frontend/client/modules/crm/src/views/task/fields/date-end.js +++ b/frontend/client/modules/crm/src/views/task/fields/date-end.js @@ -21,31 +21,31 @@ Espo.define('Crm:Views.Task.Fields.DateEnd', 'Views.Fields.Datetime', function (Dep) { - return Dep.extend({ - - detailTemplate: 'crm:task.fields.date-end.detail', - - listTemplate: 'crm:task.fields.date-end.detail', - - data: function () { - var data = Dep.prototype.data.call(this); - - if (!~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { - if (this.mode == 'list' || this.mode == 'detail') { - var value = this.model.get(this.name); - if (value) { - var d = this.getDateTime().toMoment(value); - var now = moment().tz(this.getDateTime().timeZone || 'UTC'); - if (d.unix() < now.unix()) { - data.isOverdue = true; - } - } - } - } - - return data; - }, - - }); + return Dep.extend({ + + detailTemplate: 'crm:task.fields.date-end.detail', + + listTemplate: 'crm:task.fields.date-end.detail', + + data: function () { + var data = Dep.prototype.data.call(this); + + if (!~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { + if (this.mode == 'list' || this.mode == 'detail') { + var value = this.model.get(this.name); + if (value) { + var d = this.getDateTime().toMoment(value); + var now = moment().tz(this.getDateTime().timeZone || 'UTC'); + if (d.unix() < now.unix()) { + data.isOverdue = true; + } + } + } + } + + return data; + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/task/fields/is-overdue.js b/frontend/client/modules/crm/src/views/task/fields/is-overdue.js index e2201418e8..da014aa8e8 100644 --- a/frontend/client/modules/crm/src/views/task/fields/is-overdue.js +++ b/frontend/client/modules/crm/src/views/task/fields/is-overdue.js @@ -20,29 +20,29 @@ ************************************************************************/ Espo.define('Crm:Views.Task.Fields.IsOverdue', 'Views.Fields.Base', function (Dep) { - - return Dep.extend({ - - readOnly: true, - - _template: '{{#if isOverdue}}{{translate "overdue"}}{{/if}}', - - data: function () { - var isOverdue = false; - if (['Completed', 'Canceled'].indexOf(this.model.get('status')) == -1) { - if (this.model.has('dateEnd')) { - isOverdue = moment.utc().unix() > moment.utc(this.model.get('dateEnd')).unix(); - } - } - return { - isOverdue: isOverdue - }; - }, - - setup: function () { - this.mode = 'detail'; - }, - - }); + + return Dep.extend({ + + readOnly: true, + + _template: '{{#if isOverdue}}{{translate "overdue"}}{{/if}}', + + data: function () { + var isOverdue = false; + if (['Completed', 'Canceled'].indexOf(this.model.get('status')) == -1) { + if (this.model.has('dateEnd')) { + isOverdue = moment.utc().unix() > moment.utc(this.model.get('dateEnd')).unix(); + } + } + return { + isOverdue: isOverdue + }; + }, + + setup: function () { + this.mode = 'detail'; + }, + + }); }); diff --git a/frontend/client/modules/crm/src/views/task/list.js b/frontend/client/modules/crm/src/views/task/list.js index 7283e7611d..8852420860 100644 --- a/frontend/client/modules/crm/src/views/task/list.js +++ b/frontend/client/modules/crm/src/views/task/list.js @@ -18,33 +18,33 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - + Espo.define('Crm:Views.Task.List', 'Views.List', function (Dep) { - return Dep.extend({ - - actionSetCompleted: function (data) { - var id = data.id; - if (!id) { - return; - } - var model = this.collection.get(id); - if (!model) { - return; - } - - model.set('status', 'Completed'); - - this.listenToOnce(model, 'sync', function () { - this.notify(false); - this.collection.fetch(); - }, this); - - this.notify('Saving...'); - model.save(); - - }, - - }); - + return Dep.extend({ + + actionSetCompleted: function (data) { + var id = data.id; + if (!id) { + return; + } + var model = this.collection.get(id); + if (!model) { + return; + } + + model.set('status', 'Completed'); + + this.listenToOnce(model, 'sync', function () { + this.notify(false); + this.collection.fetch(); + }, this); + + this.notify('Saving...'); + model.save(); + + }, + + }); + }); diff --git a/frontend/client/modules/crm/src/views/task/record/list.js b/frontend/client/modules/crm/src/views/task/record/list.js index 7315c31628..5470adf2bd 100644 --- a/frontend/client/modules/crm/src/views/task/record/list.js +++ b/frontend/client/modules/crm/src/views/task/record/list.js @@ -18,13 +18,13 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - + Espo.define('Crm:Views.Task.Record.List', 'Views.Record.List', function (Dep) { - return Dep.extend({ - - rowActionsView: 'Crm:Task.Record.RowActions.Default', - - }); - + return Dep.extend({ + + rowActionsView: 'Crm:Task.Record.RowActions.Default', + + }); + }); diff --git a/frontend/client/modules/crm/src/views/task/record/row-actions/default.js b/frontend/client/modules/crm/src/views/task/record/row-actions/default.js index fd1f82def1..95d8989c63 100644 --- a/frontend/client/modules/crm/src/views/task/record/row-actions/default.js +++ b/frontend/client/modules/crm/src/views/task/record/row-actions/default.js @@ -18,26 +18,26 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - + Espo.define('Crm:Views.Task.Record.RowActions.Default', 'Views.Record.RowActions.Default', function (Dep) { - return Dep.extend({ - - getActions: function () { - var actions = Dep.prototype.getActions.call(this); - - if (this.options.acl.edit && !~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { - actions.push({ - action: 'setCompleted', - label: 'Complete', - data: { - id: this.model.id - } - }); - } - - return actions; - }, - }); - + return Dep.extend({ + + getActions: function () { + var actions = Dep.prototype.getActions.call(this); + + if (this.options.acl.edit && !~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { + actions.push({ + action: 'setCompleted', + label: 'Complete', + data: { + id: this.model.id + } + }); + } + + return actions; + }, + }); + }); diff --git a/frontend/client/res/layout-types/columns-2.tpl b/frontend/client/res/layout-types/columns-2.tpl index 3372bdd032..db2ad4433e 100644 --- a/frontend/client/res/layout-types/columns-2.tpl +++ b/frontend/client/res/layout-types/columns-2.tpl @@ -1,22 +1,22 @@ - + <% _.each(layout, function (row, rowNumber) { %> -
- <% _.each(row, function (defs, key) { %> - <% - var tag = 'tag' in defs ? defs.tag : 'div'; - print( '<' + tag); - if ('id' in defs) { - print(' id="'+defs.id+'"'); - } - print(' class="'); - if ('class' in defs) { - print(defs.class); - }; - print('"'); - print('>'); - %> - {{{<%= defs.name %>}}} - <%= '' %> - <% }); %> -
+
+ <% _.each(row, function (defs, key) { %> + <% + var tag = 'tag' in defs ? defs.tag : 'div'; + print( '<' + tag); + if ('id' in defs) { + print(' id="'+defs.id+'"'); + } + print(' class="'); + if ('class' in defs) { + print(defs.class); + }; + print('"'); + print('>'); + %> + {{{<%= defs.name %>}}} + <%= '' %> + <% }); %> +
<% }); %> diff --git a/frontend/client/res/layout-types/default.tpl b/frontend/client/res/layout-types/default.tpl index 1ce0001080..707706aa35 100644 --- a/frontend/client/res/layout-types/default.tpl +++ b/frontend/client/res/layout-types/default.tpl @@ -1,15 +1,15 @@ - + <% _.each(layout, function (defs, key) { - var tag = 'tag' in defs ? defs.tag : 'div'; - print( '<' + tag); - if ('id' in defs) { - print(' id="'+defs.id+'"'); - } - if ('class' in defs) { - print(' class="'+defs.class+'"'); - } - print('>'); - %> - {{{<%= defs.name %>}}} - <%= '' %> + var tag = 'tag' in defs ? defs.tag : 'div'; + print( '<' + tag); + if ('id' in defs) { + print(' id="'+defs.id+'"'); + } + if ('class' in defs) { + print(' class="'+defs.class+'"'); + } + print('>'); + %> + {{{<%= defs.name %>}}} + <%= '' %> <% }); %> diff --git a/frontend/client/res/layout-types/list-row-expanded.tpl b/frontend/client/res/layout-types/list-row-expanded.tpl index 6a0802b5c2..1e8621c9f3 100644 --- a/frontend/client/res/layout-types/list-row-expanded.tpl +++ b/frontend/client/res/layout-types/list-row-expanded.tpl @@ -1,30 +1,30 @@ -
  • +
  • <% if (layout.right) { %>
    - {{{<%= layout.right.name %>}}} -
    + {{{<%= layout.right.name %>}}} +
  • <% } %> <% _.each(layout.rows, function (row, key) { %> -
    - <% _.each(row, function (defs, key) { %> - <% - var tag = 'tag' in defs ? defs.tag : false; - if (tag) { - print( '<' + tag); - if ('id' in defs) { - print(' id="'+defs.id+'"'); - } - if ('class' in defs) { - print(' class="'+defs.class+'"'); - }; - print('>'); - } - %>{{{<%= defs.name %>}}}<% - if (tag) { - print( ''); - } - %> - <% }); %> -
    +
    + <% _.each(row, function (defs, key) { %> + <% + var tag = 'tag' in defs ? defs.tag : false; + if (tag) { + print( '<' + tag); + if ('id' in defs) { + print(' id="'+defs.id+'"'); + } + if ('class' in defs) { + print(' class="'+defs.class+'"'); + }; + print('>'); + } + %>{{{<%= defs.name %>}}}<% + if (tag) { + print( ''); + } + %> + <% }); %> +
    <% }); %> diff --git a/frontend/client/res/layout-types/list-row.tpl b/frontend/client/res/layout-types/list-row.tpl index 3f2cb213f2..bd4dc62a2b 100644 --- a/frontend/client/res/layout-types/list-row.tpl +++ b/frontend/client/res/layout-types/list-row.tpl @@ -1,33 +1,33 @@
    <% _.each(layout, function (defs, key) { %> - <% - var width = ''; - if (defs.options && defs.options.defs && defs.options.defs.params) { - width = defs.options.defs.params.width || ''; - } - var align = false; - if (defs.options && defs.options.defs && defs.options.defs.params) { - align = defs.options.defs.params.align || false; - } - %> - + <% + var width = ''; + if (defs.options && defs.options.defs && defs.options.defs.params) { + width = defs.options.defs.params.width || ''; + } + var align = false; + if (defs.options && defs.options.defs && defs.options.defs.params) { + align = defs.options.defs.params.align || false; + } + %> + <% }); %> diff --git a/frontend/client/res/layout-types/record.tpl b/frontend/client/res/layout-types/record.tpl index 13155a4b27..ef7611c056 100644 --- a/frontend/client/res/layout-types/record.tpl +++ b/frontend/client/res/layout-types/record.tpl @@ -1,41 +1,41 @@ <% _.each(layout, function (panel, columnNumber) { %> -
    > - {{#if "<%= panel.label %>"}} -

    <%= "{{translate \"" + panel.label + "\" scope=\""+model.name+"\"}}" %>

    - {{/if}} -
    - <% _.each(panel.rows, function (row, rowNumber) { %> -
    - <% _.each(row, function (cell, cellNumber) { %> - <% if (cell != false) { %> -
    - -
    - <% - if ('customCode' in cell) { - print (cell.customCode); - } else { - print ("{{{"+cell.name+"}}}"); - } - %> -
    -
    - <% } else { %> -
    - <% } %> - <% }); %> -
    - <% }); %> -
    -
    +
    > + {{#if "<%= panel.label %>"}} +

    <%= "{{translate \"" + panel.label + "\" scope=\""+model.name+"\"}}" %>

    + {{/if}} +
    + <% _.each(panel.rows, function (row, rowNumber) { %> +
    + <% _.each(row, function (cell, cellNumber) { %> + <% if (cell != false) { %> +
    + +
    + <% + if ('customCode' in cell) { + print (cell.customCode); + } else { + print ("{{{"+cell.name+"}}}"); + } + %> +
    +
    + <% } else { %> +
    + <% } %> + <% }); %> +
    + <% }); %> +
    +
    <% }); %> diff --git a/frontend/client/res/templates/about.tpl b/frontend/client/res/templates/about.tpl index ae6b472003..05d8a48386 100644 --- a/frontend/client/res/templates/about.tpl +++ b/frontend/client/res/templates/about.tpl @@ -1,27 +1,27 @@
    -
    -

    - Version {{version}} -

    -

    - Copyright © 2014 EspoCRM: 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. -

    -
    +
    +

    + Version {{version}} +

    +

    + Copyright © 2014 EspoCRM: 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. +

    +
    diff --git a/frontend/client/res/templates/admin/extensions/done.tpl b/frontend/client/res/templates/admin/extensions/done.tpl index 5bebd05fc6..21465c8413 100644 --- a/frontend/client/res/templates/admin/extensions/done.tpl +++ b/frontend/client/res/templates/admin/extensions/done.tpl @@ -1,5 +1,5 @@

    - {{{text}}} + {{{text}}}

    diff --git a/frontend/client/res/templates/admin/extensions/index.tpl b/frontend/client/res/templates/admin/extensions/index.tpl index fd3f20f1e0..4e9cdc3549 100644 --- a/frontend/client/res/templates/admin/extensions/index.tpl +++ b/frontend/client/res/templates/admin/extensions/index.tpl @@ -1,18 +1,18 @@
    -
    -

    {{translate 'selectExtensionPackage' category='messages' scope='Admin'}}

    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +

    {{translate 'selectExtensionPackage' category='messages' scope='Admin'}}

    +
    +
    +
    + +
    +
    +
    + +
    +
    diff --git a/frontend/client/res/templates/admin/extensions/ready.tpl b/frontend/client/res/templates/admin/extensions/ready.tpl index 030262da6d..76d39c0cab 100644 --- a/frontend/client/res/templates/admin/extensions/ready.tpl +++ b/frontend/client/res/templates/admin/extensions/ready.tpl @@ -1,5 +1,5 @@

    - {{{text}}} + {{{text}}}

    diff --git a/frontend/client/res/templates/admin/field-manager/edit.tpl b/frontend/client/res/templates/admin/field-manager/edit.tpl index 79bcc6d09d..35a3bcac5b 100644 --- a/frontend/client/res/templates/admin/field-manager/edit.tpl +++ b/frontend/client/res/templates/admin/field-manager/edit.tpl @@ -1,30 +1,30 @@
    - - + +
    -
    -
    - -
    {{translate type scope='Admin' category='fieldTypes'}}
    -
    -
    - -
    {{{name}}}
    -
    -
    - -
    {{{label}}}
    -
    - - {{#each params}} - {{#unless hidden}} -
    - -
    {{{var ../name ../../this}}}
    -
    - {{/unless}} - {{/each}} -
    +
    +
    + +
    {{translate type scope='Admin' category='fieldTypes'}}
    +
    +
    + +
    {{{name}}}
    +
    +
    + +
    {{{label}}}
    +
    + + {{#each params}} + {{#unless hidden}} +
    + +
    {{{var ../name ../../this}}}
    +
    + {{/unless}} + {{/each}} +
    diff --git a/frontend/client/res/templates/admin/field-manager/index.tpl b/frontend/client/res/templates/admin/field-manager/index.tpl index 148d99f717..0b315febaa 100644 --- a/frontend/client/res/templates/admin/field-manager/index.tpl +++ b/frontend/client/res/templates/admin/field-manager/index.tpl @@ -1,20 +1,20 @@
    -
    - -
    +
    + +
    -
    -

    -
    - {{{content}}} -
    -
    +
    +

    +
    + {{{content}}} +
    +
    diff --git a/frontend/client/res/templates/admin/field-manager/list.tpl b/frontend/client/res/templates/admin/field-manager/list.tpl index 52945494c3..fa5e810f81 100644 --- a/frontend/client/res/templates/admin/field-manager/list.tpl +++ b/frontend/client/res/templates/admin/field-manager/list.tpl @@ -1,29 +1,29 @@
    -
    - - -
    +
    + + +
    > - <% - var tag = 'tag' in defs ? defs.tag : false; - if (tag) { - print( '<' + tag); - if ('id' in defs) { - print(' id="'+defs.id+'"'); - } - if ('class' in defs) { - print(' class="'+defs.class+'"'); - }; - print('>'); - } - %>{{{<%= defs.name %>}}}<% - if (tag) { - print( ''); - } - %> - > + <% + var tag = 'tag' in defs ? defs.tag : false; + if (tag) { + print( '<' + tag); + if ('id' in defs) { + print(' id="'+defs.id+'"'); + } + if ('class' in defs) { + print(' class="'+defs.class+'"'); + }; + print('>'); + } + %>{{{<%= defs.name %>}}}<% + if (tag) { + print( ''); + } + %> +
    - - - - {{#each fieldDefsArray}} - - - - - - - {{/each}} - + + + + {{#each fieldDefsArray}} + + + + + + + {{/each}} +
    {{translate 'Name'}} - {{translate 'Label'}} - {{translate 'Type'}} - -
    {{name}}{{translate name scope=../scope category='fields'}}{{translate type category='fieldTypes' scope='Admin'}}{{#if isCustom}}remove{{/if}}
    {{translate 'Name'}} + {{translate 'Label'}} + {{translate 'Type'}} + +
    {{name}}{{translate name scope=../scope category='fields'}}{{translate type category='fieldTypes' scope='Admin'}}{{#if isCustom}}remove{{/if}}
    diff --git a/frontend/client/res/templates/admin/index.tpl b/frontend/client/res/templates/admin/index.tpl index 879d6bd370..1c4e92ab96 100644 --- a/frontend/client/res/templates/admin/index.tpl +++ b/frontend/client/res/templates/admin/index.tpl @@ -3,14 +3,14 @@ {{#each links}}

    {{translate label scope='Admin'}}

    - {{#each items}} - - - - - {{/each}} + {{#each items}} + + + + + {{/each}}
    - {{translate label scope='Admin' category='labels'}} - {{translate description scope='Admin' category='descriptions'}}
    + {{translate label scope='Admin' category='labels'}} + {{translate description scope='Admin' category='descriptions'}}
    {{/each}} diff --git a/frontend/client/res/templates/admin/integrations/edit.tpl b/frontend/client/res/templates/admin/integrations/edit.tpl index 74c17e7faa..97a3497f13 100644 --- a/frontend/client/res/templates/admin/integrations/edit.tpl +++ b/frontend/client/res/templates/admin/integrations/edit.tpl @@ -1,26 +1,26 @@
    - - + +
    -
    -
    - -
    {{{enabled}}}
    -
    - {{#each dataFieldList}} -
    - -
    {{{var this ../this}}}
    -
    - {{/each}} -
    -
    - {{#if helpText}} -
    - {{{../helpText}}} -
    - {{/if}} -
    +
    +
    + +
    {{{enabled}}}
    +
    + {{#each dataFieldList}} +
    + +
    {{{var this ../this}}}
    +
    + {{/each}} +
    +
    + {{#if helpText}} +
    + {{{../helpText}}} +
    + {{/if}} +
    diff --git a/frontend/client/res/templates/admin/integrations/index.tpl b/frontend/client/res/templates/admin/integrations/index.tpl index 4de3328d50..96d71c1eb1 100644 --- a/frontend/client/res/templates/admin/integrations/index.tpl +++ b/frontend/client/res/templates/admin/integrations/index.tpl @@ -1,20 +1,20 @@
    -
    -
      - {{#each integrationList}} -
    • {{./this}}
    • - {{/each}} -
    -
    +
    +
      + {{#each integrationList}} +
    • {{./this}}
    • + {{/each}} +
    +
    -
    -

    -
    - {{{content}}} -
    -
    +
    +

    +
    + {{{content}}} +
    +
    diff --git a/frontend/client/res/templates/admin/integrations/oauth2.tpl b/frontend/client/res/templates/admin/integrations/oauth2.tpl index f661420a58..90b510bb5e 100644 --- a/frontend/client/res/templates/admin/integrations/oauth2.tpl +++ b/frontend/client/res/templates/admin/integrations/oauth2.tpl @@ -1,32 +1,32 @@
    - - + +
    -
    -
    - -
    {{{enabled}}}
    -
    - {{#each dataFieldList}} -
    - -
    {{{var this ../this}}}
    -
    - {{/each}} -
    - -
    - -
    -
    -
    -
    - {{#if helpText}} -
    - {{{../helpText}}} -
    - {{/if}} -
    +
    +
    + +
    {{{enabled}}}
    +
    + {{#each dataFieldList}} +
    + +
    {{{var this ../this}}}
    +
    + {{/each}} +
    + +
    + +
    +
    +
    +
    + {{#if helpText}} +
    + {{{../helpText}}} +
    + {{/if}} +
    diff --git a/frontend/client/res/templates/admin/layouts/grid.tpl b/frontend/client/res/templates/admin/layouts/grid.tpl index 1f8e49b725..c3e4990f33 100644 --- a/frontend/client/res/templates/admin/layouts/grid.tpl +++ b/frontend/client/res/templates/admin/layouts/grid.tpl @@ -1,220 +1,220 @@
    {{#each buttons}} - {{button name label=label scope='Admin' style=style}} + {{button name label=label scope='Admin' style=style}} {{/each}}
    - -
    -
    -
    {{translate 'Available Fields' scope='Admin'}}
    -
      - {{#each disabledFields}} -
    • {{translate this scope=../scope category='fields'}} -   -
    • - {{/each}} -
    -
    -
    + +
    +
    +
    {{translate 'Available Fields' scope='Admin'}}
    +
      + {{#each disabledFields}} +
    • {{translate this scope=../scope category='fields'}} +   +
    • + {{/each}} +
    +
    +
    diff --git a/frontend/client/res/templates/admin/layouts/index.tpl b/frontend/client/res/templates/admin/layouts/index.tpl index fa76cc9a33..4771a0725d 100644 --- a/frontend/client/res/templates/admin/layouts/index.tpl +++ b/frontend/client/res/templates/admin/layouts/index.tpl @@ -1,35 +1,35 @@
    -
    -
    - {{#each layoutScopeDataList}} -
    - -
    -
    -
      - {{#each typeList}} -
    • - -
    • - {{/each}} -
    -
    -
    -
    - {{/each}} -
    -
    +
    +
    + {{#each layoutScopeDataList}} +
    + +
    +
    +
      + {{#each typeList}} +
    • + +
    • + {{/each}} +
    +
    +
    +
    + {{/each}} +
    +
    -
    -

    -
    - {{{content}}} -
    -
    +
    +

    +
    + {{{content}}} +
    +
    diff --git a/frontend/client/res/templates/admin/layouts/rows.tpl b/frontend/client/res/templates/admin/layouts/rows.tpl index b4e46ca5ae..141ea30a7b 100644 --- a/frontend/client/res/templates/admin/layouts/rows.tpl +++ b/frontend/client/res/templates/admin/layouts/rows.tpl @@ -1,121 +1,121 @@
    {{#each buttons}} - {{button name label=label scope='Admin' style=style}} + {{button name label=label scope='Admin' style=style}} {{/each}}
    -
    -
    -
    {{translate 'Enabled' scope='Admin'}}
    -
      - {{#each layout}} -
    • -
      - -
      - {{#if ../editable}} -
      - {{/if}} -
    • - {{/each}} -
    -
    -
    -
    -
    -
    {{translate 'Disabled' scope='Admin'}}
    -
      - {{#each disabledFields}} -
    • -
      - -
      - {{#if ../editable}} -
      - {{/if}} -
    • - {{/each}} -
    -
    -
    +
    +
    +
    {{translate 'Enabled' scope='Admin'}}
    +
      + {{#each layout}} +
    • +
      + +
      + {{#if ../editable}} +
      + {{/if}} +
    • + {{/each}} +
    +
    +
    +
    +
    +
    {{translate 'Disabled' scope='Admin'}}
    +
      + {{#each disabledFields}} +
    • +
      + +
      + {{#if ../editable}} +
      + {{/if}} +
    • + {{/each}} +
    +
    +
    diff --git a/frontend/client/res/templates/admin/upgrade/index.tpl b/frontend/client/res/templates/admin/upgrade/index.tpl index 1792c4ecb5..e1650ad9dc 100644 --- a/frontend/client/res/templates/admin/upgrade/index.tpl +++ b/frontend/client/res/templates/admin/upgrade/index.tpl @@ -1,30 +1,30 @@
    -
    -

    - {{backupsMsg}} -

    -
    +
    +

    + {{backupsMsg}} +

    +
    -
    -

    {{translate 'selectUpgradePackage' scope='Admin' category="messages"}}

    -
    -
    - -

    - {{{translate 'downloadUpgradePackage' scope='Admin' category="messages"}}} -

    -
    - -
    -
    -
    - -
    -
    +
    +

    {{translate 'selectUpgradePackage' scope='Admin' category="messages"}}

    +
    +
    + +

    + {{{translate 'downloadUpgradePackage' scope='Admin' category="messages"}}} +

    +
    + +
    +
    +
    + +
    +
    diff --git a/frontend/client/res/templates/dashboard.tpl b/frontend/client/res/templates/dashboard.tpl index b499dc887c..68c6fbde2a 100644 --- a/frontend/client/res/templates/dashboard.tpl +++ b/frontend/client/res/templates/dashboard.tpl @@ -1,11 +1,11 @@
    {{{dashlets}}}
    diff --git a/frontend/client/res/templates/dashlet.tpl b/frontend/client/res/templates/dashlet.tpl index 7c9f1e42e9..8ada50de8d 100644 --- a/frontend/client/res/templates/dashlet.tpl +++ b/frontend/client/res/templates/dashlet.tpl @@ -1,14 +1,14 @@ diff --git a/frontend/client/res/templates/dashlets/options/base.tpl b/frontend/client/res/templates/dashlets/options/base.tpl index 50ee81b290..b13282d25f 100644 --- a/frontend/client/res/templates/dashlets/options/base.tpl +++ b/frontend/client/res/templates/dashlets/options/base.tpl @@ -1,3 +1,3 @@
    -
    {{{record}}}
    +
    {{{record}}}
    diff --git a/frontend/client/res/templates/dashlets/options/record-list.tpl b/frontend/client/res/templates/dashlets/options/record-list.tpl index b9e3c96612..450258838b 100644 --- a/frontend/client/res/templates/dashlets/options/record-list.tpl +++ b/frontend/client/res/templates/dashlets/options/record-list.tpl @@ -1,17 +1,17 @@
    -
    -
    - - -
    -
    - - -
    -
    +
    +
    + + +
    +
    + + +
    +
    diff --git a/frontend/client/res/templates/email-account/fields/folder/edit.tpl b/frontend/client/res/templates/email-account/fields/folder/edit.tpl index bb60aadcb5..88c42c50c4 100644 --- a/frontend/client/res/templates/email-account/fields/folder/edit.tpl +++ b/frontend/client/res/templates/email-account/fields/folder/edit.tpl @@ -1,8 +1,8 @@
    - - + + - +
    diff --git a/frontend/client/res/templates/email-account/modals/select-folder.tpl b/frontend/client/res/templates/email-account/modals/select-folder.tpl index 5bb8d78c3f..f62dd3f962 100644 --- a/frontend/client/res/templates/email-account/modals/select-folder.tpl +++ b/frontend/client/res/templates/email-account/modals/select-folder.tpl @@ -1,11 +1,11 @@ {{#unless folders}} - {{translate 'No Data'}} + {{translate 'No Data'}} {{/unless}}
      {{#each folders}} -
    • - {{./this}} - -
    • +
    • + {{./this}} + +
    • {{/each}}
    diff --git a/frontend/client/res/templates/email-template/fields/insert-field/edit.tpl b/frontend/client/res/templates/email-template/fields/insert-field/edit.tpl index 8483fd0262..32afb27381 100644 --- a/frontend/client/res/templates/email-template/fields/insert-field/edit.tpl +++ b/frontend/client/res/templates/email-template/fields/insert-field/edit.tpl @@ -1,11 +1,11 @@
    -
    - -
    -
    - -
    -
    - -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/frontend/client/res/templates/email/fields/compose-from-address/edit.tpl b/frontend/client/res/templates/email/fields/compose-from-address/edit.tpl index 441aa1c98e..1c295096e7 100644 --- a/frontend/client/res/templates/email/fields/compose-from-address/edit.tpl +++ b/frontend/client/res/templates/email/fields/compose-from-address/edit.tpl @@ -1,5 +1,5 @@ diff --git a/frontend/client/res/templates/email/fields/email-address-varchar/detail.tpl b/frontend/client/res/templates/email/fields/email-address-varchar/detail.tpl index 765bd46cbc..25060bd18e 100644 --- a/frontend/client/res/templates/email/fields/email-address-varchar/detail.tpl +++ b/frontend/client/res/templates/email/fields/email-address-varchar/detail.tpl @@ -1,5 +1,5 @@ {{#if value}} - {{{value}}} + {{{value}}} {{else}} - {{{translate 'None'}}} + {{{translate 'None'}}} {{/if}} diff --git a/frontend/client/res/templates/email/fields/select-template/edit.tpl b/frontend/client/res/templates/email/fields/select-template/edit.tpl index 8a615b6ae6..f55b32406a 100644 --- a/frontend/client/res/templates/email/fields/select-template/edit.tpl +++ b/frontend/client/res/templates/email/fields/select-template/edit.tpl @@ -1,8 +1,8 @@
    - - + + - +
    diff --git a/frontend/client/res/templates/errors/403.tpl b/frontend/client/res/templates/errors/403.tpl index f210837eb2..a061797d87 100644 --- a/frontend/client/res/templates/errors/403.tpl +++ b/frontend/client/res/templates/errors/403.tpl @@ -1,6 +1,6 @@
    -
    -

    Error 403

    - You don't have an access to this area. -
    +
    +

    Error 403

    + You don't have an access to this area. +
    diff --git a/frontend/client/res/templates/errors/404.tpl b/frontend/client/res/templates/errors/404.tpl index 059c811bc9..dd5a7c363b 100644 --- a/frontend/client/res/templates/errors/404.tpl +++ b/frontend/client/res/templates/errors/404.tpl @@ -1,6 +1,6 @@
    -
    -

    Error 404

    - The url you requested can't be handled. -
    +
    +

    Error 404

    + The url you requested can't be handled. +
    diff --git a/frontend/client/res/templates/external-account/index.tpl b/frontend/client/res/templates/external-account/index.tpl index 761e7dcca7..f07dbf48bd 100644 --- a/frontend/client/res/templates/external-account/index.tpl +++ b/frontend/client/res/templates/external-account/index.tpl @@ -1,22 +1,22 @@
    -
    -
      - {{#each externalAccountList}} -
    • - {{/each}} -
    - {{#unless externalAccountListCount}} - {{translate 'No Data'}} - {{/unless}} -
    +
    +
      + {{#each externalAccountList}} +
    • + {{/each}} +
    + {{#unless externalAccountListCount}} + {{translate 'No Data'}} + {{/unless}} +
    -
    -

    -
    - {{{content}}} -
    -
    +
    +

    +
    + {{{content}}} +
    +
    diff --git a/frontend/client/res/templates/external-account/oauth2.tpl b/frontend/client/res/templates/external-account/oauth2.tpl index 9091099a3c..dbd0405703 100644 --- a/frontend/client/res/templates/external-account/oauth2.tpl +++ b/frontend/client/res/templates/external-account/oauth2.tpl @@ -1,26 +1,26 @@
    - - + +
    -
    -
    -
    - -
    {{{enabled}}}
    -
    -
    -
    - - {{translate 'Connected' scope='ExternalAccount'}} -
    -
    -
    - {{#if helpText}} -
    - {{{../helpText}}} -
    - {{/if}} -
    +
    +
    +
    + +
    {{{enabled}}}
    +
    +
    +
    + + {{translate 'Connected' scope='ExternalAccount'}} +
    +
    +
    + {{#if helpText}} +
    + {{{../helpText}}} +
    + {{/if}} +
    diff --git a/frontend/client/res/templates/fields/address/edit.tpl b/frontend/client/res/templates/fields/address/edit.tpl index 2cd12903db..b83c76874f 100644 --- a/frontend/client/res/templates/fields/address/edit.tpl +++ b/frontend/client/res/templates/fields/address/edit.tpl @@ -1,14 +1,14 @@
    -
    - -
    -
    - -
    -
    - -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/frontend/client/res/templates/fields/array/edit.tpl b/frontend/client/res/templates/fields/array/edit.tpl index 498e806e6f..e86cafd537 100644 --- a/frontend/client/res/templates/fields/array/edit.tpl +++ b/frontend/client/res/templates/fields/array/edit.tpl @@ -1,13 +1,13 @@ {{#if hasOptions}} diff --git a/frontend/client/res/templates/fields/attachments-multiple/detail.tpl b/frontend/client/res/templates/fields/attachments-multiple/detail.tpl index 10b3ccc7cb..203499892e 100644 --- a/frontend/client/res/templates/fields/attachments-multiple/detail.tpl +++ b/frontend/client/res/templates/fields/attachments-multiple/detail.tpl @@ -1,6 +1,6 @@ {{#if value}} - {{{value}}} + {{{value}}} {{else}} - {{{translate 'None'}}} + {{{translate 'None'}}} {{/if}} diff --git a/frontend/client/res/templates/fields/attachments-multiple/edit.tpl b/frontend/client/res/templates/fields/attachments-multiple/edit.tpl index a2c314e24d..a4acc7aff0 100644 --- a/frontend/client/res/templates/fields/attachments-multiple/edit.tpl +++ b/frontend/client/res/templates/fields/attachments-multiple/edit.tpl @@ -1,9 +1,9 @@
    -
    - -
    -
    +
    + +
    +
    diff --git a/frontend/client/res/templates/fields/currency/detail.tpl b/frontend/client/res/templates/fields/currency/detail.tpl index 95051b2c9e..d6b1d7aa61 100644 --- a/frontend/client/res/templates/fields/currency/detail.tpl +++ b/frontend/client/res/templates/fields/currency/detail.tpl @@ -1,5 +1,5 @@ {{#if value}} - {{value}} {{#if value}}{{currencyValue}}{{/if}} + {{value}} {{#if value}}{{currencyValue}}{{/if}} {{else}} - {{translate 'None'}} + {{translate 'None'}} {{/if}} diff --git a/frontend/client/res/templates/fields/currency/edit.tpl b/frontend/client/res/templates/fields/currency/edit.tpl index 400f87ed6b..6918bb091e 100644 --- a/frontend/client/res/templates/fields/currency/edit.tpl +++ b/frontend/client/res/templates/fields/currency/edit.tpl @@ -1,9 +1,9 @@
    - - - - + + + +
    diff --git a/frontend/client/res/templates/fields/date/edit.tpl b/frontend/client/res/templates/fields/date/edit.tpl index e3b7a95c1a..2408a92e06 100644 --- a/frontend/client/res/templates/fields/date/edit.tpl +++ b/frontend/client/res/templates/fields/date/edit.tpl @@ -1,6 +1,6 @@
    - - + + - +
    diff --git a/frontend/client/res/templates/fields/date/search.tpl b/frontend/client/res/templates/fields/date/search.tpl index 14cf4ab5c7..767070a3a9 100644 --- a/frontend/client/res/templates/fields/date/search.tpl +++ b/frontend/client/res/templates/fields/date/search.tpl @@ -1,16 +1,16 @@
    - - + + - +
    - - + + - +
    diff --git a/frontend/client/res/templates/fields/datetime/edit.tpl b/frontend/client/res/templates/fields/datetime/edit.tpl index 7186e694f6..9b0778f970 100644 --- a/frontend/client/res/templates/fields/datetime/edit.tpl +++ b/frontend/client/res/templates/fields/datetime/edit.tpl @@ -1,12 +1,12 @@
    - - + + - - - + + + - +
    diff --git a/frontend/client/res/templates/fields/duration/edit.tpl b/frontend/client/res/templates/fields/duration/edit.tpl index dbeebc20ef..bd55e12404 100644 --- a/frontend/client/res/templates/fields/duration/edit.tpl +++ b/frontend/client/res/templates/fields/duration/edit.tpl @@ -1,4 +1,4 @@ diff --git a/frontend/client/res/templates/fields/email/detail.tpl b/frontend/client/res/templates/fields/email/detail.tpl index a2c98253ff..844bd0fcf5 100644 --- a/frontend/client/res/templates/fields/email/detail.tpl +++ b/frontend/client/res/templates/fields/email/detail.tpl @@ -1,19 +1,19 @@ {{#if emailAddressData}} - {{#each emailAddressData}} -
    - {{#unless invalid}}{{#unless optOut}} - - {{/unless}}{{/unless}} - - - {{emailAddress}} - - - {{#unless invalid}}{{#unless optOut}} - - {{/unless}}{{/unless}} -
    - {{/each}} + {{#each emailAddressData}} +
    + {{#unless invalid}}{{#unless optOut}} + + {{/unless}}{{/unless}} + + + {{emailAddress}} + + + {{#unless invalid}}{{#unless optOut}} + + {{/unless}}{{/unless}} +
    + {{/each}} {{else}} - {{value}} + {{value}} {{/if}} diff --git a/frontend/client/res/templates/fields/email/edit.tpl b/frontend/client/res/templates/fields/email/edit.tpl index 6f4f0e7b13..ac5c04fbe2 100644 --- a/frontend/client/res/templates/fields/email/edit.tpl +++ b/frontend/client/res/templates/fields/email/edit.tpl @@ -1,23 +1,23 @@
    {{#each emailAddressData}} - + {{/each}}
    diff --git a/frontend/client/res/templates/fields/enum/edit.tpl b/frontend/client/res/templates/fields/enum/edit.tpl index a4db3eedf2..851d94f777 100644 --- a/frontend/client/res/templates/fields/enum/edit.tpl +++ b/frontend/client/res/templates/fields/enum/edit.tpl @@ -1,4 +1,4 @@ diff --git a/frontend/client/res/templates/fields/enum/search.tpl b/frontend/client/res/templates/fields/enum/search.tpl index feb904a995..4594de3963 100644 --- a/frontend/client/res/templates/fields/enum/search.tpl +++ b/frontend/client/res/templates/fields/enum/search.tpl @@ -1,4 +1,4 @@ diff --git a/frontend/client/res/templates/fields/file/detail.tpl b/frontend/client/res/templates/fields/file/detail.tpl index 765bd46cbc..25060bd18e 100644 --- a/frontend/client/res/templates/fields/file/detail.tpl +++ b/frontend/client/res/templates/fields/file/detail.tpl @@ -1,5 +1,5 @@ {{#if value}} - {{{value}}} + {{{value}}} {{else}} - {{{translate 'None'}}} + {{{translate 'None'}}} {{/if}} diff --git a/frontend/client/res/templates/fields/file/edit.tpl b/frontend/client/res/templates/fields/file/edit.tpl index 0eae1a7ca6..9b6d9614ec 100644 --- a/frontend/client/res/templates/fields/file/edit.tpl +++ b/frontend/client/res/templates/fields/file/edit.tpl @@ -1,9 +1,9 @@
    -
    - -
    -
    +
    + +
    +
    diff --git a/frontend/client/res/templates/fields/int/search.tpl b/frontend/client/res/templates/fields/int/search.tpl index adba483c46..8a980cc48c 100644 --- a/frontend/client/res/templates/fields/int/search.tpl +++ b/frontend/client/res/templates/fields/int/search.tpl @@ -1,6 +1,6 @@ diff --git a/frontend/client/res/templates/fields/link-multiple/detail.tpl b/frontend/client/res/templates/fields/link-multiple/detail.tpl index 10b3ccc7cb..203499892e 100644 --- a/frontend/client/res/templates/fields/link-multiple/detail.tpl +++ b/frontend/client/res/templates/fields/link-multiple/detail.tpl @@ -1,6 +1,6 @@ {{#if value}} - {{{value}}} + {{{value}}} {{else}} - {{{translate 'None'}}} + {{{translate 'None'}}} {{/if}} diff --git a/frontend/client/res/templates/fields/link-multiple/edit.tpl b/frontend/client/res/templates/fields/link-multiple/edit.tpl index c2b67c9208..2654d08627 100644 --- a/frontend/client/res/templates/fields/link-multiple/edit.tpl +++ b/frontend/client/res/templates/fields/link-multiple/edit.tpl @@ -1,8 +1,8 @@
    - - + + - +
    diff --git a/frontend/client/res/templates/fields/link-multiple/search.tpl b/frontend/client/res/templates/fields/link-multiple/search.tpl index 8ea513893c..3aaf08f1c0 100644 --- a/frontend/client/res/templates/fields/link-multiple/search.tpl +++ b/frontend/client/res/templates/fields/link-multiple/search.tpl @@ -2,10 +2,10 @@
    - - + + - +
    diff --git a/frontend/client/res/templates/fields/link-parent/edit.tpl b/frontend/client/res/templates/fields/link-parent/edit.tpl index 98433bf847..85e55c8bf9 100644 --- a/frontend/client/res/templates/fields/link-parent/edit.tpl +++ b/frontend/client/res/templates/fields/link-parent/edit.tpl @@ -1,13 +1,13 @@
    - - - - - - - - + + + + + + + +
    diff --git a/frontend/client/res/templates/fields/link-parent/search.tpl b/frontend/client/res/templates/fields/link-parent/search.tpl index 34c54270d7..f327c24e6e 100644 --- a/frontend/client/res/templates/fields/link-parent/search.tpl +++ b/frontend/client/res/templates/fields/link-parent/search.tpl @@ -1,12 +1,12 @@
    - - - - - + + + + +
    diff --git a/frontend/client/res/templates/fields/link/detail.tpl b/frontend/client/res/templates/fields/link/detail.tpl index 32622b4744..d0d4bd6cd1 100644 --- a/frontend/client/res/templates/fields/link/detail.tpl +++ b/frontend/client/res/templates/fields/link/detail.tpl @@ -1,5 +1,5 @@ {{#if idValue}} {{nameValue}} {{else}} - {{translate 'None'}} + {{translate 'None'}} {{/if}} diff --git a/frontend/client/res/templates/fields/link/edit.tpl b/frontend/client/res/templates/fields/link/edit.tpl index c1699d527c..8956a960aa 100644 --- a/frontend/client/res/templates/fields/link/edit.tpl +++ b/frontend/client/res/templates/fields/link/edit.tpl @@ -1,9 +1,9 @@
    - - + + - +
    diff --git a/frontend/client/res/templates/fields/link/search.tpl b/frontend/client/res/templates/fields/link/search.tpl index 4bf2d2905b..2d87612807 100644 --- a/frontend/client/res/templates/fields/link/search.tpl +++ b/frontend/client/res/templates/fields/link/search.tpl @@ -1,9 +1,9 @@
    - - - - - + + + + +
    diff --git a/frontend/client/res/templates/fields/person-name/edit.tpl b/frontend/client/res/templates/fields/person-name/edit.tpl index efea56371e..487c95cd69 100644 --- a/frontend/client/res/templates/fields/person-name/edit.tpl +++ b/frontend/client/res/templates/fields/person-name/edit.tpl @@ -1,13 +1,13 @@
    -
    - -
    -
    - -
    -
    - -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/frontend/client/res/templates/fields/phone/detail.tpl b/frontend/client/res/templates/fields/phone/detail.tpl index dbe678dc1e..a0ad912ba5 100644 --- a/frontend/client/res/templates/fields/phone/detail.tpl +++ b/frontend/client/res/templates/fields/phone/detail.tpl @@ -1,10 +1,10 @@ {{#if phoneNumberData}} - {{#each phoneNumberData}} -
    - {{phoneNumber}} - ({{translateOption type scope=../../scope field=../../name}}) -
    - {{/each}} + {{#each phoneNumberData}} +
    + {{phoneNumber}} + ({{translateOption type scope=../../scope field=../../name}}) +
    + {{/each}} {{else}} - {{value}} + {{value}} {{/if}} diff --git a/frontend/client/res/templates/fields/phone/edit.tpl b/frontend/client/res/templates/fields/phone/edit.tpl index 7196f63a95..5a4498f5a4 100644 --- a/frontend/client/res/templates/fields/phone/edit.tpl +++ b/frontend/client/res/templates/fields/phone/edit.tpl @@ -1,20 +1,20 @@
    {{#each phoneNumberData}} -
    - - - - - - - - -
    +
    + + + + + + + + +
    {{/each}}
    diff --git a/frontend/client/res/templates/global-search/panel.tpl b/frontend/client/res/templates/global-search/panel.tpl index 25f0c66c14..623a399a1b 100644 --- a/frontend/client/res/templates/global-search/panel.tpl +++ b/frontend/client/res/templates/global-search/panel.tpl @@ -1,8 +1,8 @@
    -
    {{translate 'Global Search'}}
    -
    -
    - {{translate 'Loading...'}} -
    -
    +
    {{translate 'Global Search'}}
    +
    +
    + {{translate 'Loading...'}} +
    +
    diff --git a/frontend/client/res/templates/header.tpl b/frontend/client/res/templates/header.tpl index f6a782a18d..210f0e6153 100644 --- a/frontend/client/res/templates/header.tpl +++ b/frontend/client/res/templates/header.tpl @@ -1,31 +1,31 @@
    -
    -

    {{{header}}}

    -
    -
    -
    - {{#each items.buttons}} - {{#if link}} - {{translate label scope=../../scope}} - {{else}} - - {{/if}} - {{/each}} - - {{#if items.dropdown}} - - - {{/if}} -
    -
    +
    +

    {{{header}}}

    +
    +
    +
    + {{#each items.buttons}} + {{#if link}} + {{translate label scope=../../scope}} + {{else}} + + {{/if}} + {{/each}} + + {{#if items.dropdown}} + + + {{/if}} +
    +
    diff --git a/frontend/client/res/templates/import/index.tpl b/frontend/client/res/templates/import/index.tpl index 20f7471468..8ce14a7965 100644 --- a/frontend/client/res/templates/import/index.tpl +++ b/frontend/client/res/templates/import/index.tpl @@ -1,7 +1,7 @@
    - {{{step}}} + {{{step}}}
    diff --git a/frontend/client/res/templates/import/step-1.tpl b/frontend/client/res/templates/import/step-1.tpl index 7d1d0c5eb3..da69906b52 100644 --- a/frontend/client/res/templates/import/step-1.tpl +++ b/frontend/client/res/templates/import/step-1.tpl @@ -1,126 +1,126 @@

    {{translate 'Step 1' scope='Import'}}

    -
    -
    {{translate 'What to Import?' scope='Import'}}
    -
    -
    -
    - - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    +
    +
    {{translate 'What to Import?' scope='Import'}}
    +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    -
    -
    {{translate 'Properties' scope='Import'}}
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    -
    -
    +
    +
    {{translate 'Properties' scope='Import'}}
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    -
    -
    {{translate 'Preview' scope='Import'}}
    -
    -
    -
    -
    -
    - -
    - -
    +
    +
    {{translate 'Preview' scope='Import'}}
    +
    +
    +
    +
    +
    + +
    + +
    diff --git a/frontend/client/res/templates/import/step-2.tpl b/frontend/client/res/templates/import/step-2.tpl index 71e05e7d77..4afd5b8d29 100644 --- a/frontend/client/res/templates/import/step-2.tpl +++ b/frontend/client/res/templates/import/step-2.tpl @@ -1,35 +1,35 @@

    {{translate 'Step 2' scope='Import'}}

    -
    -
    {{translate 'Field Mapping' scope='Import'}}
    -
    -
    -
    -
    -
    - -
    -
    {{translate 'Default Values' scope='Import'}}
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    - - -
    +
    +
    {{translate 'Field Mapping' scope='Import'}}
    +
    +
    +
    +
    +
    + +
    +
    {{translate 'Default Values' scope='Import'}}
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    + + +
    diff --git a/frontend/client/res/templates/import/step-3.tpl b/frontend/client/res/templates/import/step-3.tpl index 68e261e7d4..14e46f4b9d 100644 --- a/frontend/client/res/templates/import/step-3.tpl +++ b/frontend/client/res/templates/import/step-3.tpl @@ -1,20 +1,20 @@ -
    -
    {{translate 'Result' scope='Import'}}
    -
    -

    {{translate scope category='scopeNamesPlural'}}

    -
    - {{translate 'Created' scope='Import'}}: {{result.countCreated}} -
    - {{translate 'Updated' scope='Import'}}: {{result.countUpdated}} -
    - -
    - {{translate 'Return to Import' scope='Import'}} - {{translate 'Show records' scope='Import'}} - {{#if result.countCreated}} - - {{/if}} -
    -
    -
    +
    +
    {{translate 'Result' scope='Import'}}
    +
    +

    {{translate scope category='scopeNamesPlural'}}

    +
    + {{translate 'Created' scope='Import'}}: {{result.countCreated}} +
    + {{translate 'Updated' scope='Import'}}: {{result.countUpdated}} +
    + +
    + {{translate 'Return to Import' scope='Import'}} + {{translate 'Show records' scope='Import'}} + {{#if result.countCreated}} + + {{/if}} +
    +
    +
    diff --git a/frontend/client/res/templates/login.tpl b/frontend/client/res/templates/login.tpl index 3e3b699396..d01d426bee 100644 --- a/frontend/client/res/templates/login.tpl +++ b/frontend/client/res/templates/login.tpl @@ -1,27 +1,27 @@
    -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    {{{footer}}}
    diff --git a/frontend/client/res/templates/modals/add-dashlet.tpl b/frontend/client/res/templates/modals/add-dashlet.tpl index bee90af5d9..d6e1df1569 100644 --- a/frontend/client/res/templates/modals/add-dashlet.tpl +++ b/frontend/client/res/templates/modals/add-dashlet.tpl @@ -1,8 +1,8 @@
      {{#each dashletList}} -
    • - {{translate this category="dashlets"}} - -
    • +
    • + {{translate this category="dashlets"}} + +
    • {{/each}}
    diff --git a/frontend/client/res/templates/modals/array-field-add.tpl b/frontend/client/res/templates/modals/array-field-add.tpl index 1b5ecafdc2..1d610df0c5 100644 --- a/frontend/client/res/templates/modals/array-field-add.tpl +++ b/frontend/client/res/templates/modals/array-field-add.tpl @@ -1,11 +1,11 @@ {{#unless optionList}} - {{translate 'No Data'}} + {{translate 'No Data'}} {{/unless}}
      {{#each optionList}} -
    • - {{#if ../translatedOptions}}{{prop ../../translatedOptions this}}{{else}}{{./this}}{{/if}} - -
    • +
    • + {{#if ../translatedOptions}}{{prop ../../translatedOptions this}}{{else}}{{./this}}{{/if}} + +
    • {{/each}}
    diff --git a/frontend/client/res/templates/modals/change-password.tpl b/frontend/client/res/templates/modals/change-password.tpl index 1d122a7525..561c9d1c8a 100644 --- a/frontend/client/res/templates/modals/change-password.tpl +++ b/frontend/client/res/templates/modals/change-password.tpl @@ -1,9 +1,9 @@
    - -
    {{{password}}}
    + +
    {{{password}}}
    - -
    {{{passwordConfirm}}}
    + +
    {{{passwordConfirm}}}
    diff --git a/frontend/client/res/templates/modals/duplicate.tpl b/frontend/client/res/templates/modals/duplicate.tpl index fe9b7f0374..95056eee48 100644 --- a/frontend/client/res/templates/modals/duplicate.tpl +++ b/frontend/client/res/templates/modals/duplicate.tpl @@ -1,13 +1,13 @@

    {{translate 'duplicate' category="messages"}}

    - - {{#each duplicates}} - - - - {{/each}} -
    - {{./this}} -
    + + {{#each duplicates}} + + + + {{/each}} +
    + {{./this}} +
    diff --git a/frontend/client/res/templates/modals/image-preview.tpl b/frontend/client/res/templates/modals/image-preview.tpl index b97e949165..fed2b20abf 100644 --- a/frontend/client/res/templates/modals/image-preview.tpl +++ b/frontend/client/res/templates/modals/image-preview.tpl @@ -1,5 +1,5 @@
    - +
    diff --git a/frontend/client/res/templates/modals/mass-update.tpl b/frontend/client/res/templates/modals/mass-update.tpl index f39ef40948..2fc2b08197 100644 --- a/frontend/client/res/templates/modals/mass-update.tpl +++ b/frontend/client/res/templates/modals/mass-update.tpl @@ -1,17 +1,17 @@ {{#unless fields}} - {{translate 'No fields available for Mass Update'}} -{{else}} + {{translate 'No fields available for Mass Update'}} +{{else}}
    -
    - - -
    +
    + + +
    {{/unless}}
    -
    +
    diff --git a/frontend/client/res/templates/modals/save-filters.tpl b/frontend/client/res/templates/modals/save-filters.tpl index 86fc4e38d2..34831d5b14 100644 --- a/frontend/client/res/templates/modals/save-filters.tpl +++ b/frontend/client/res/templates/modals/save-filters.tpl @@ -1,6 +1,6 @@
    - -
    - {{{name}}} -
    + +
    + {{{name}}} +
    diff --git a/frontend/client/res/templates/modals/select-records.tpl b/frontend/client/res/templates/modals/select-records.tpl index 904d85ff2b..9a3e2a053d 100644 --- a/frontend/client/res/templates/modals/select-records.tpl +++ b/frontend/client/res/templates/modals/select-records.tpl @@ -2,6 +2,6 @@
    {{{list}}}
    {{#if createButton}}
    - +
    {{/if}} diff --git a/frontend/client/res/templates/notifications/badge.tpl b/frontend/client/res/templates/notifications/badge.tpl index 8987b88ce4..1f5ececc0e 100644 --- a/frontend/client/res/templates/notifications/badge.tpl +++ b/frontend/client/res/templates/notifications/badge.tpl @@ -1,4 +1,4 @@ - +
    diff --git a/frontend/client/res/templates/notifications/panel.tpl b/frontend/client/res/templates/notifications/panel.tpl index 3e8c537a30..e573279890 100644 --- a/frontend/client/res/templates/notifications/panel.tpl +++ b/frontend/client/res/templates/notifications/panel.tpl @@ -1,8 +1,8 @@
    -
    {{translate 'Mark all read'}}{{translate 'Notifications'}}
    -
    -
    - {{translate 'Loading...'}} -
    -
    +
    {{translate 'Mark all read'}}{{translate 'Notifications'}}
    +
    +
    + {{translate 'Loading...'}} +
    +
    diff --git a/frontend/client/res/templates/notifications/read.tpl b/frontend/client/res/templates/notifications/read.tpl index 3574b35a75..5a97f6a50e 100644 --- a/frontend/client/res/templates/notifications/read.tpl +++ b/frontend/client/res/templates/notifications/read.tpl @@ -1,3 +1,3 @@ {{#unless isRead}} - + {{/unless}} diff --git a/frontend/client/res/templates/preferences/fields/smtp-email-address/detail.tpl b/frontend/client/res/templates/preferences/fields/smtp-email-address/detail.tpl index d3f7d0cf93..323dd2f2f8 100644 --- a/frontend/client/res/templates/preferences/fields/smtp-email-address/detail.tpl +++ b/frontend/client/res/templates/preferences/fields/smtp-email-address/detail.tpl @@ -1,8 +1,8 @@ {{#if value}} - {{value}} + {{value}} {{else}} - {{translate 'userHasNoEmailAddress' category='messages' scope='Admin'}} - {{#if isAdmin}} - {{translate 'Edit'}} - {{/if}} + {{translate 'userHasNoEmailAddress' category='messages' scope='Admin'}} + {{#if isAdmin}} + {{translate 'Edit'}} + {{/if}} {{/if}} diff --git a/frontend/client/res/templates/record/bottom.tpl b/frontend/client/res/templates/record/bottom.tpl index 1d1949fe75..bad11a3e76 100644 --- a/frontend/client/res/templates/record/bottom.tpl +++ b/frontend/client/res/templates/record/bottom.tpl @@ -1,28 +1,28 @@ {{#each panels}} -
    -
    -
    - {{#if buttons}} - {{#each buttons}} - - {{/each}} - {{/if}} - {{#if actions}} - - - {{/if}} -
    -

    {{title}}

    -
    -
    - {{{var name ../this}}} -
    -
    +
    +
    +
    + {{#if buttons}} + {{#each buttons}} + + {{/each}} + {{/if}} + {{#if actions}} + + + {{/if}} +
    +

    {{title}}

    +
    +
    + {{{var name ../this}}} +
    +
    {{/each}} diff --git a/frontend/client/res/templates/record/detail.tpl b/frontend/client/res/templates/record/detail.tpl index d19c87698b..fe7b9d5642 100644 --- a/frontend/client/res/templates/record/detail.tpl +++ b/frontend/client/res/templates/record/detail.tpl @@ -1,33 +1,33 @@
    - {{#if buttonsTop}} -
    - {{#each buttons}} - {{button name scope=../../scope label=label style=style}} - {{/each}} -
    - {{/if}} - + {{#if buttonsTop}} +
    + {{#each buttons}} + {{button name scope=../../scope label=label style=style}} + {{/each}} +
    + {{/if}} + -
    -
    -
    {{{record}}}
    -
    {{{extra}}}
    -
    {{{bottom}}}
    -
    -
    - {{{side}}} -
    -
    +
    +
    +
    {{{record}}}
    +
    {{{extra}}}
    +
    {{{bottom}}}
    +
    +
    + {{{side}}} +
    +
    - {{#if buttonsBottom}} -
    - {{#each buttons}} - {{button name scope=../../scope label=label style=style}} - {{/each}} -
    - {{/if}} + {{#if buttonsBottom}} +
    + {{#each buttons}} + {{button name scope=../../scope label=label style=style}} + {{/each}} +
    + {{/if}}
    diff --git a/frontend/client/res/templates/record/edit.tpl b/frontend/client/res/templates/record/edit.tpl index 14e5b1b484..fb4761f814 100644 --- a/frontend/client/res/templates/record/edit.tpl +++ b/frontend/client/res/templates/record/edit.tpl @@ -1,36 +1,36 @@
    - {{#if buttonsTop}} -
    - {{#each buttons}} - {{button name scope=../../scope label=label style=style}} - {{/each}} -
    - {{/if}} + {{#if buttonsTop}} +
    + {{#each buttons}} + {{button name scope=../../scope label=label style=style}} + {{/each}} +
    + {{/if}} -
    - {{#if isWide}} -
    - {{else}} -
    - {{/if}} -
    {{{record}}}
    -
    {{{extra}}}
    -
    {{{bottom}}}
    -
    -
    - {{{side}}} -
    -
    +
    + {{#if isWide}} +
    + {{else}} +
    + {{/if}} +
    {{{record}}}
    +
    {{{extra}}}
    +
    {{{bottom}}}
    +
    +
    + {{{side}}} +
    +
    - - {{#if buttonsBottom}} -
    - {{#each buttons}} - {{button name scope=../../scope label=label style=style}} - {{/each}} -
    - {{/if}} + + {{#if buttonsBottom}} +
    + {{#each buttons}} + {{button name scope=../../scope label=label style=style}} + {{/each}} +
    + {{/if}}
    diff --git a/frontend/client/res/templates/record/list-expanded.tpl b/frontend/client/res/templates/record/list-expanded.tpl index 76b1241e2c..bcf854981b 100644 --- a/frontend/client/res/templates/record/list-expanded.tpl +++ b/frontend/client/res/templates/record/list-expanded.tpl @@ -1,45 +1,45 @@ {{#if collection.models.length}} {{#if topBar}}
    - {{#if paginationTop}} -
    - {{{pagination}}} -
    - {{/if}} - - {{#if checkboxes}} -
    - - -
    - {{/if}} + {{#if paginationTop}} +
    + {{{pagination}}} +
    + {{/if}} + + {{#if checkboxes}} +
    + + +
    + {{/if}}
    {{/if}}
    -
      - {{#each rows}} - {{{var this ../this}}} - {{/each}} -
    - {{#unless paginationEnabled}} - {{#if showMoreEnabled}} - - {{/if}} - {{/unless}} +
      + {{#each rows}} + {{{var this ../this}}} + {{/each}} +
    + {{#unless paginationEnabled}} + {{#if showMoreEnabled}} + + {{/if}} + {{/unless}}
    {{#if bottomBar}} @@ -49,5 +49,5 @@ {{/if}} {{else}} - {{translate 'No Data'}} + {{translate 'No Data'}} {{/if}} diff --git a/frontend/client/res/templates/record/list-pagination.tpl b/frontend/client/res/templates/record/list-pagination.tpl index 670411435a..be5fd7f953 100644 --- a/frontend/client/res/templates/record/list-pagination.tpl +++ b/frontend/client/res/templates/record/list-pagination.tpl @@ -1,20 +1,20 @@ diff --git a/frontend/client/res/templates/record/list.tpl b/frontend/client/res/templates/record/list.tpl index 421870a2b1..d8a75eb1e8 100644 --- a/frontend/client/res/templates/record/list.tpl +++ b/frontend/client/res/templates/record/list.tpl @@ -2,69 +2,69 @@ {{#if topBar}}
    - {{#if paginationTop}} -
    - {{{pagination}}} -
    - {{/if}} - - {{#if checkboxes}} - {{#if actions}} -
    - - -
    - {{/if}} - {{/if}} + {{#if paginationTop}} +
    + {{{pagination}}} +
    + {{/if}} + + {{#if checkboxes}} + {{#if actions}} +
    + + +
    + {{/if}} + {{/if}}
    {{/if}}
    - - {{#if header}} - - - {{#if checkboxes}} - - {{/if}} - {{#each headerDefs}} - - {{/each}} - - - {{/if}} - - {{#each rows}} - {{{var this ../this}}} - {{/each}} - -
    - {{#if this.sortable}} - {{translate this.name scope=../../../collection.name category='fields'}} - {{#if this.sorted}}{{#if this.asc}}{{else}}{{/if}}{{/if}} - {{else}} - {{translate this.name scope=../../../collection.name category='fields'}} - {{/if}} -
    - {{#unless paginationEnabled}} - {{#if showMoreEnabled}} - - {{/if}} - {{/unless}} + + {{#if header}} + + + {{#if checkboxes}} + + {{/if}} + {{#each headerDefs}} + + {{/each}} + + + {{/if}} + + {{#each rows}} + {{{var this ../this}}} + {{/each}} + +
    + {{#if this.sortable}} + {{translate this.name scope=../../../collection.name category='fields'}} + {{#if this.sorted}}{{#if this.asc}}{{else}}{{/if}}{{/if}} + {{else}} + {{translate this.name scope=../../../collection.name category='fields'}} + {{/if}} +
    + {{#unless paginationEnabled}} + {{#if showMoreEnabled}} + + {{/if}} + {{/unless}}
    {{#if bottomBar}} @@ -74,5 +74,5 @@ {{/if}} {{else}} - {{translate 'No Data'}} + {{translate 'No Data'}} {{/if}} diff --git a/frontend/client/res/templates/record/merge.tpl b/frontend/client/res/templates/record/merge.tpl index 5530d0d61a..986706054f 100644 --- a/frontend/client/res/templates/record/merge.tpl +++ b/frontend/client/res/templates/record/merge.tpl @@ -1,42 +1,42 @@
    - - - - - {{#each models}} - - - {{/each}} - - - - {{#each rows}} - - - {{#each columns}} - - - {{/each}} - - {{/each}} - -
    - - - {{get this 'name'}} -
    - {{translate name scope=../scope category='fields'}} - - - -
    - {{{var fieldVariable ../../this}}} -
    -
    -
    - - -
    + + + + + {{#each models}} + + + {{/each}} + + + + {{#each rows}} + + + {{#each columns}} + + + {{/each}} + + {{/each}} + +
    + + + {{get this 'name'}} +
    + {{translate name scope=../scope category='fields'}} + + + +
    + {{{var fieldVariable ../../this}}} +
    +
    +
    + + +
    diff --git a/frontend/client/res/templates/record/panels/default-side.tpl b/frontend/client/res/templates/record/panels/default-side.tpl index 50df439077..5832cc6871 100644 --- a/frontend/client/res/templates/record/panels/default-side.tpl +++ b/frontend/client/res/templates/record/panels/default-side.tpl @@ -1,34 +1,34 @@
    {{#each fields}}
    - -
    - {{{var this ../this}}} -
    + +
    + {{{var this ../this}}} +
    {{/each}} -
    - - +
    + +
    - {{#ifAttrNotEmpty model 'createdById'}} -
    - -
    - - {{{createdAt}}} » {{{createdBy}}} -
    -
    - {{/ifAttrNotEmpty}} - - {{#ifAttrNotEmpty model 'modifiedById'}} -
    - -
    - {{{modifiedAt}}} » {{{modifiedBy}}} -
    -
    - {{/ifAttrNotEmpty}} + {{#ifAttrNotEmpty model 'createdById'}} +
    + +
    + + {{{createdAt}}} » {{{createdBy}}} +
    +
    + {{/ifAttrNotEmpty}} + + {{#ifAttrNotEmpty model 'modifiedById'}} +
    + +
    + {{{modifiedAt}}} » {{{modifiedBy}}} +
    +
    + {{/ifAttrNotEmpty}}
    diff --git a/frontend/client/res/templates/record/panels/side.tpl b/frontend/client/res/templates/record/panels/side.tpl index e3d455fedc..a20cbfeeed 100644 --- a/frontend/client/res/templates/record/panels/side.tpl +++ b/frontend/client/res/templates/record/panels/side.tpl @@ -1,12 +1,12 @@
    {{#each fields}}
    - -
    - {{{var this ../this}}} -
    + +
    + {{{var this ../this}}} +
    {{/each}}
    diff --git a/frontend/client/res/templates/record/row-actions/default.tpl b/frontend/client/res/templates/record/row-actions/default.tpl index 16c5dd1236..8f1bd56445 100644 --- a/frontend/client/res/templates/record/row-actions/default.tpl +++ b/frontend/client/res/templates/record/row-actions/default.tpl @@ -1,13 +1,13 @@ {{#if actions.length}}
    - - + +
    {{/if}} diff --git a/frontend/client/res/templates/record/search.tpl b/frontend/client/res/templates/record/search.tpl index e792198ae7..f5dd29d66f 100644 --- a/frontend/client/res/templates/record/search.tpl +++ b/frontend/client/res/templates/record/search.tpl @@ -1,58 +1,58 @@
    -
    -
    - {{#if leftDropdown}} -
    - - -
    - {{/if}} - -
    - -
    -
    -
    -
    -
    - - - -
    -
    +
    +
    + {{#if leftDropdown}} +
    + + +
    + {{/if}} + +
    + +
    +
    +
    +
    +
    + + + +
    +
    diff --git a/frontend/client/res/templates/record/side.tpl b/frontend/client/res/templates/record/side.tpl index 859d732fa4..582e051206 100644 --- a/frontend/client/res/templates/record/side.tpl +++ b/frontend/client/res/templates/record/side.tpl @@ -1,24 +1,24 @@ {{#each panels}}
    - {{#if label}} -
    -
    - {{#if actions}} - - - {{/if}} -
    -

    {{translate label scope=../../scope}}

    -
    - {{/if}} -
    - {{{var name ../this}}} -
    + {{#if label}} +
    +
    + {{#if actions}} + + + {{/if}} +
    +

    {{translate label scope=../../scope}}

    +
    + {{/if}} +
    + {{{var name ../this}}} +
    {{/each}} diff --git a/frontend/client/res/templates/role/table.tpl b/frontend/client/res/templates/role/table.tpl index 534d5bc8a1..5cd386883a 100644 --- a/frontend/client/res/templates/role/table.tpl +++ b/frontend/client/res/templates/role/table.tpl @@ -1,39 +1,39 @@ - - - - - {{#each actionList}} - - {{/each}} - - {{#each aclTable}} - - - - - - {{#each acl}} - - {{/each}} - - {{/each}} -
    {{translate 'Access' scope='Role'}}{{translate this scope='Role' category='actions'}}
    {{translate @key category='scopeNamesPlural'}} - {{#if ../editMode}} - - {{else}} - {{translateOption access scope='Role' field='accessList'}} - {{/if}} - - {{#if ../../editMode}} - - {{else}} - {{#ifNotEqual ../../access 'not-set'}} - {{translateOption ../level field='levelList' scope='Role'}} - {{/ifNotEqual}} - {{/if}} -
    + + + + + {{#each actionList}} + + {{/each}} + + {{#each aclTable}} + + + + + + {{#each acl}} + + {{/each}} + + {{/each}} +
    {{translate 'Access' scope='Role'}}{{translate this scope='Role' category='actions'}}
    {{translate @key category='scopeNamesPlural'}} + {{#if ../editMode}} + + {{else}} + {{translateOption access scope='Role' field='accessList'}} + {{/if}} + + {{#if ../../editMode}} + + {{else}} + {{#ifNotEqual ../../access 'not-set'}} + {{translateOption ../level field='levelList' scope='Role'}} + {{/ifNotEqual}} + {{/if}} +
    diff --git a/frontend/client/res/templates/scheduled-job/cronjob.tpl b/frontend/client/res/templates/scheduled-job/cronjob.tpl index dbfb1f986c..9641456f80 100644 --- a/frontend/client/res/templates/scheduled-job/cronjob.tpl +++ b/frontend/client/res/templates/scheduled-job/cronjob.tpl @@ -1,4 +1,4 @@
    -
     
    -
     
    +
     
    +
     
    diff --git a/frontend/client/res/templates/search/filter.tpl b/frontend/client/res/templates/search/filter.tpl index 7bda850a0a..d08d351690 100644 --- a/frontend/client/res/templates/search/filter.tpl +++ b/frontend/client/res/templates/search/filter.tpl @@ -1,8 +1,8 @@
    - {{#unless notRemovable}}{{/unless}} - -
    {{{field}}}
    + {{#unless notRemovable}}{{/unless}} + +
    {{{field}}}
    diff --git a/frontend/client/res/templates/settings/fields/currency-rates/edit.tpl b/frontend/client/res/templates/settings/fields/currency-rates/edit.tpl index ed5d04b387..f3df11ffc6 100644 --- a/frontend/client/res/templates/settings/fields/currency-rates/edit.tpl +++ b/frontend/client/res/templates/settings/fields/currency-rates/edit.tpl @@ -1,6 +1,6 @@ -{{#each rateValues}} -
    - {{@key}} - -
    +{{#each rateValues}} +
    + {{@key}} + +
    {{/each}} diff --git a/frontend/client/res/templates/site/master.tpl b/frontend/client/res/templates/site/master.tpl index 89c54e3d67..47209c59a0 100644 --- a/frontend/client/res/templates/site/master.tpl +++ b/frontend/client/res/templates/site/master.tpl @@ -1,5 +1,5 @@
    -
    {{{main}}}
    +
    {{{main}}}
    {{{footer}}}
    diff --git a/frontend/client/res/templates/site/navbar.tpl b/frontend/client/res/templates/site/navbar.tpl index 945e95b988..cb4d6c792a 100644 --- a/frontend/client/res/templates/site/navbar.tpl +++ b/frontend/client/res/templates/site/navbar.tpl @@ -1,57 +1,57 @@ diff --git a/frontend/client/res/templates/stream/notes/assign.tpl b/frontend/client/res/templates/stream/notes/assign.tpl index 004986a07e..966f3e02b2 100644 --- a/frontend/client/res/templates/stream/notes/assign.tpl +++ b/frontend/client/res/templates/stream/notes/assign.tpl @@ -1,14 +1,14 @@ {{#unless onlyContent}}
  • {{/unless}} - -
    - {{{message}}} -
    -
    - {{{createdAt}}} -
    - + +
    + {{{message}}} +
    +
    + {{{createdAt}}} +
    + {{#unless onlyContent}}
  • {{/unless}} diff --git a/frontend/client/res/templates/stream/notes/create-related.tpl b/frontend/client/res/templates/stream/notes/create-related.tpl index b32cdacb39..9fc090c528 100644 --- a/frontend/client/res/templates/stream/notes/create-related.tpl +++ b/frontend/client/res/templates/stream/notes/create-related.tpl @@ -2,14 +2,14 @@
  • {{/unless}} -
    - {{{message}}} -
    - -
    - {{{createdAt}}} -
    - +
    + {{{message}}} +
    + +
    + {{{createdAt}}} +
    + {{#unless onlyContent}}
  • {{/unless}} diff --git a/frontend/client/res/templates/stream/notes/create.tpl b/frontend/client/res/templates/stream/notes/create.tpl index bdeb0847b9..3427f64d37 100644 --- a/frontend/client/res/templates/stream/notes/create.tpl +++ b/frontend/client/res/templates/stream/notes/create.tpl @@ -2,17 +2,17 @@
  • {{/unless}} -
    - {{#if statusText}} - {{statusText}} - {{/if}} - {{{message}}} -
    - -
    - {{{createdAt}}} -
    - +
    + {{#if statusText}} + {{statusText}} + {{/if}} + {{{message}}} +
    + +
    + {{{createdAt}}} +
    + {{#unless onlyContent}}
  • {{/unless}} diff --git a/frontend/client/res/templates/stream/notes/email-received.tpl b/frontend/client/res/templates/stream/notes/email-received.tpl index 98cd5486c4..53d4ef83e5 100644 --- a/frontend/client/res/templates/stream/notes/email-received.tpl +++ b/frontend/client/res/templates/stream/notes/email-received.tpl @@ -1,19 +1,19 @@ {{#unless onlyContent}}
  • -{{/unless}} - -
    - {{translate 'Email'}} {{emailName}} - {{translate 'has been received' category='stream'}} - {{#if isUserStream}} {{translate 'for' category='stream'}} {{parentTypeString}} {{{parent}}} {{/if}} - -
    - - -
    - {{{createdAt}}} -
    - +{{/unless}} + +
    + {{translate 'Email'}} {{emailName}} + {{translate 'has been received' category='stream'}} + {{#if isUserStream}} {{translate 'for' category='stream'}} {{parentTypeString}} {{{parent}}} {{/if}} + +
    + + +
    + {{{createdAt}}} +
    + {{#unless onlyContent}}
  • {{/unless}} diff --git a/frontend/client/res/templates/stream/notes/post.tpl b/frontend/client/res/templates/stream/notes/post.tpl index 9b7c97ff2f..5851c71a72 100644 --- a/frontend/client/res/templates/stream/notes/post.tpl +++ b/frontend/client/res/templates/stream/notes/post.tpl @@ -1,44 +1,44 @@ {{#unless onlyContent}}
  • {{/unless}} - - {{#unless isUserStream}} -
    - {{#if acl.edit}} - - {{/if}} -
    - {{/unless}} - - -
    - {{{message}}} -
    - - {{#if post}} -
    - {{{post}}} -
    - {{/if}} - - {{#if attachments}} -
    - {{{attachments}}} -
    - {{/if}} - -
    - {{{createdAt}}} -
    - + + {{#unless isUserStream}} +
    + {{#if acl.edit}} + + {{/if}} +
    + {{/unless}} + + +
    + {{{message}}} +
    + + {{#if post}} +
    + {{{post}}} +
    + {{/if}} + + {{#if attachments}} +
    + {{{attachments}}} +
    + {{/if}} + +
    + {{{createdAt}}} +
    + {{#unless onlyContent}}
  • {{/unless}} diff --git a/frontend/client/res/templates/stream/notes/status.tpl b/frontend/client/res/templates/stream/notes/status.tpl index c1fda37110..f823fb8586 100644 --- a/frontend/client/res/templates/stream/notes/status.tpl +++ b/frontend/client/res/templates/stream/notes/status.tpl @@ -1,15 +1,15 @@ {{#unless onlyContent}}
  • {{/unless}} - -
    - {{statusText}} - {{{message}}} -
    - -
    - {{{createdAt}}} -
    + +
    + {{statusText}} + {{{message}}} +
    + +
    + {{{createdAt}}} +
    {{#unless onlyContent}}
  • diff --git a/frontend/client/res/templates/stream/notes/update.tpl b/frontend/client/res/templates/stream/notes/update.tpl index a65afe87d2..43b98c10cd 100644 --- a/frontend/client/res/templates/stream/notes/update.tpl +++ b/frontend/client/res/templates/stream/notes/update.tpl @@ -1,23 +1,23 @@ {{#unless onlyContent}}
  • {{/unless}} - -
    - {{{message}}} -
    - - - -
    - {{{createdAt}}} -
    + +
    + {{{message}}} +
    + + + +
    + {{{createdAt}}} +
    {{#unless onlyContent}}
  • diff --git a/frontend/client/res/templates/stream/panel.tpl b/frontend/client/res/templates/stream/panel.tpl index cb5be8b26e..cc87cbc3dc 100644 --- a/frontend/client/res/templates/stream/panel.tpl +++ b/frontend/client/res/templates/stream/panel.tpl @@ -1,15 +1,15 @@
    - -
    -
    - -
    -
    - {{{attachments}}} -
    -
    + +
    +
    + +
    +
    + {{{attachments}}} +
    +
    - {{{list}}} + {{{list}}}
    diff --git a/frontend/client/src/acl.js b/frontend/client/src/acl.js index 5718286b88..8bd9f2df1c 100644 --- a/frontend/client/src/acl.js +++ b/frontend/client/src/acl.js @@ -30,84 +30,84 @@ */ Espo.Acl = function (user) { - this.data = {}; - this.user = user || null; + this.data = {}; + this.user = user || null; } _.extend(Espo.Acl.prototype, { - data: null, - - user: null, - - set: function (data) { - data = data || {}; - this.data = data; - }, - - check: function (controller, action, isOwner, inTeam) { - if (this.user.isAdmin()) { - return true; - } - - if (controller in this.data) { - if (this.data[controller] === false) { - return false; - } - if (this.data[controller] === true) { - return true; - } - if (typeof action !== 'undefined') { - if (action in this.data[controller]) { - var value = this.data[controller][action]; - - if (value === 'all' || value === true) { - return true; - } - - if (!value || value === 'no') { - return false; - } - - if (typeof isOwner === 'undefined') { - return true; - } - - if (isOwner) { - if (value === 'own' || value === 'team') { - return true; - } - } - - //if (inTeam) { - if (value === 'team') { - return true; - } - //} - - return false; - } - } - return true; - } - return true; - }, - - checkModel: function (model, action) { - if (action == 'edit') { - if (!model.isEditable()) { - return false; - } - } - if (this.user.isAdmin()) { - return true; - } - return this.check(model.name, action, this.user.isOwner(model), this.user.inTeam(model)); - }, - - clear: function () { - this.data = {}; - } + data: null, + + user: null, + + set: function (data) { + data = data || {}; + this.data = data; + }, + + check: function (controller, action, isOwner, inTeam) { + if (this.user.isAdmin()) { + return true; + } + + if (controller in this.data) { + if (this.data[controller] === false) { + return false; + } + if (this.data[controller] === true) { + return true; + } + if (typeof action !== 'undefined') { + if (action in this.data[controller]) { + var value = this.data[controller][action]; + + if (value === 'all' || value === true) { + return true; + } + + if (!value || value === 'no') { + return false; + } + + if (typeof isOwner === 'undefined') { + return true; + } + + if (isOwner) { + if (value === 'own' || value === 'team') { + return true; + } + } + + //if (inTeam) { + if (value === 'team') { + return true; + } + //} + + return false; + } + } + return true; + } + return true; + }, + + checkModel: function (model, action) { + if (action == 'edit') { + if (!model.isEditable()) { + return false; + } + } + if (this.user.isAdmin()) { + return true; + } + return this.check(model.name, action, this.user.isOwner(model), this.user.inTeam(model)); + }, + + clear: function () { + this.data = {}; + } }); diff --git a/frontend/client/src/app.js b/frontend/client/src/app.js index ad1cbb283b..cb9f1b0d1f 100644 --- a/frontend/client/src/app.js +++ b/frontend/client/src/app.js @@ -21,448 +21,448 @@ var Espo = Espo || {}; Espo.App = function (options, callback) { - var options = options || {}; + var options = options || {}; - this.useCache = options.useCache || this.useCache; - this.url = options.url || this.url; + this.useCache = options.useCache || this.useCache; + this.url = options.url || this.url; - this.controllers = {}; + this.controllers = {}; - if (this.useCache) { - this.cache = new Espo.Cache(); - if (options.cacheTimestamp) { - this.cache.handleActuality(options.cacheTimestamp); - } - } + if (this.useCache) { + this.cache = new Espo.Cache(); + if (options.cacheTimestamp) { + this.cache.handleActuality(options.cacheTimestamp); + } + } - this.storage = new Espo.Storage(); + this.storage = new Espo.Storage(); - this.loader = Espo.loader; - this.loader.cache = this.cache; + this.loader = Espo.loader; + this.loader.cache = this.cache; - this._setupAjax(); + this._setupAjax(); - this.settings = new Espo['Models.Settings'](null, {cache: this.cache}); - if (!this.settings.loadFromCache()) { - this.settings.load(true); - } + this.settings = new Espo['Models.Settings'](null, {cache: this.cache}); + if (!this.settings.loadFromCache()) { + this.settings.load(true); + } - this.metadata = new Espo.Metadata(this.cache); - - this.language = new Espo.Language(this.cache); + this.metadata = new Espo.Metadata(this.cache); + + this.language = new Espo.Language(this.cache); - this.fieldManager = new Espo.FieldManager(); + this.fieldManager = new Espo.FieldManager(); - this.user = new Espo['Models.User'](); - this.preferences = new Espo['Models.Preferences'](); - this.preferences.settings = this.settings; - this.acl = new Espo.Acl(this.user); - - this.preferences.on('update', function (model) { - this.storage.set('user', 'preferences', this.preferences.toJSON()); - }, this); + this.user = new Espo['Models.User'](); + this.preferences = new Espo['Models.Preferences'](); + this.preferences.settings = this.settings; + this.acl = new Espo.Acl(this.user); + + this.preferences.on('update', function (model) { + this.storage.set('user', 'preferences', this.preferences.toJSON()); + }, this); - this._modelFactory = new Espo.ModelFactory(this.loader, this.metadata, this.user); - this._collectionFactory = new Espo.CollectionFactory(this.loader, this._modelFactory); + this._modelFactory = new Espo.ModelFactory(this.loader, this.metadata, this.user); + this._collectionFactory = new Espo.CollectionFactory(this.loader, this._modelFactory); - this._initDateTime(); - this._initView(); - this._initBaseController(); + this._initDateTime(); + this._initView(); + this._initBaseController(); - this._preLoader = new Espo.PreLoader(this.cache, this._viewFactory); - - var countLoaded = 0; - var manageCallback = function () { - countLoaded++; - if (countLoaded == 1) { - callback.call(this, this); - } - }.bind(this); - - this._preLoad(manageCallback); + this._preLoader = new Espo.PreLoader(this.cache, this._viewFactory); + + var countLoaded = 0; + var manageCallback = function () { + countLoaded++; + if (countLoaded == 1) { + callback.call(this, this); + } + }.bind(this); + + this._preLoad(manageCallback); } _.extend(Espo.App.prototype, { - useCache: false, + useCache: false, - user: null, + user: null, - preferences: null, + preferences: null, - settings: null, + settings: null, - metadata: null, + metadata: null, - language: null, + language: null, - fieldManager: null, + fieldManager: null, - cache: null, + cache: null, - loader: null, + loader: null, - url: 'api/v1', + url: 'api/v1', - auth: null, + auth: null, - baseController: null, + baseController: null, - controllers: null, + controllers: null, - router: null, + router: null, - _modelFactory: null, - _collectionFactory: null, - _viewFactory: null, - _viewLoader: null, - _viewHelper: null, + _modelFactory: null, + _collectionFactory: null, + _viewFactory: null, + _viewLoader: null, + _viewHelper: null, - start: function () { - this._initAuth(); - var onAuth = function () { - this.metadata.load(function () { - this.fieldManager.defs = this.metadata.get('fields'); - this.fieldManager.metadata = this.metadata; - - this.settings.defs = this.metadata.get('entityDefs.Settings'); - this.user.defs = this.metadata.get('entityDefs.User'); - this.preferences.defs = this.metadata.get('entityDefs.Preferences'); - + start: function () { + this._initAuth(); + var onAuth = function () { + this.metadata.load(function () { + this.fieldManager.defs = this.metadata.get('fields'); + this.fieldManager.metadata = this.metadata; + + this.settings.defs = this.metadata.get('entityDefs.Settings'); + this.user.defs = this.metadata.get('entityDefs.User'); + this.preferences.defs = this.metadata.get('entityDefs.Preferences'); + - this.loader.addLibsConfig(this.metadata.get('app.jsLibs') || {}); - - this._initRouter(); - }.bind(this)); - }.bind(this); + this.loader.addLibsConfig(this.metadata.get('app.jsLibs') || {}); + + this._initRouter(); + }.bind(this)); + }.bind(this); - if (!this.auth) { - this.baseController.login(); - } else { - this._initUserData(); - onAuth(); - } + if (!this.auth) { + this.baseController.login(); + } else { + this._initUserData(); + onAuth(); + } - this.on('auth', onAuth); - }, + this.on('auth', onAuth); + }, - _initRouter: function () { - this.router = new Espo.Router(); - this._viewHelper.router = this.router; - this.baseController._router = this.router; - this.router.on('routed', function (params) { - this.doAction(params); - }.bind(this)); - try { - Backbone.history.start(); - } catch (e) { - Backbone.history.loadUrl(); - } - }, + _initRouter: function () { + this.router = new Espo.Router(); + this._viewHelper.router = this.router; + this.baseController._router = this.router; + this.router.on('routed', function (params) { + this.doAction(params); + }.bind(this)); + try { + Backbone.history.start(); + } catch (e) { + Backbone.history.loadUrl(); + } + }, - doAction: function (params) { - this.trigger('action', params); + doAction: function (params) { + this.trigger('action', params); - this._getController(params.controller, function (controller) { - try { - controller.doAction(params.action, params.options); - this.trigger('action:done'); - } catch (e) { - switch (e.name) { - case 'AccessDenied': - this.baseController.error403(); - break; - case 'NotFound': - this.baseController.error404(); - break; - default: - throw e; - } - } - }.bind(this)); - }, + this._getController(params.controller, function (controller) { + try { + controller.doAction(params.action, params.options); + this.trigger('action:done'); + } catch (e) { + switch (e.name) { + case 'AccessDenied': + this.baseController.error403(); + break; + case 'NotFound': + this.baseController.error404(); + break; + default: + throw e; + } + } + }.bind(this)); + }, - _initBaseController: function () { - this.baseController = new Espo['Controllers.Base']({}, this._getControllerInjection()); - this._viewHelper.baseController = this.baseController; - }, + _initBaseController: function () { + this.baseController = new Espo['Controllers.Base']({}, this._getControllerInjection()); + this._viewHelper.baseController = this.baseController; + }, - _getControllerInjection: function () { - return { - viewFactory: this._viewFactory, - modelFactory: this._modelFactory, - collectionFactory: this._collectionFactory, - settings: this.settings, - user: this.user, - preferences: this.preferences, - acl: this.acl, - cache: this.cache, - router: this.router, - storage: this.storage, - metadata: this.metadata, - dateTime: this.dateTime, - }; - }, + _getControllerInjection: function () { + return { + viewFactory: this._viewFactory, + modelFactory: this._modelFactory, + collectionFactory: this._collectionFactory, + settings: this.settings, + user: this.user, + preferences: this.preferences, + acl: this.acl, + cache: this.cache, + router: this.router, + storage: this.storage, + metadata: this.metadata, + dateTime: this.dateTime, + }; + }, - _getController: function (name, callback) { - if (!(name || false)) { - callback(this.baseController); - return; - } - if (!(name in this.controllers)) { - try { - var className = this.metadata.get('clientDefs.' + name + '.controller'); - if (!className) { - var module = this.metadata.get('scopes.' + name + '.module'); - className = Espo.Utils.composeClassName(module, name, 'Controllers'); - } - - this.loader.load(className, function (controllerClass) { - this.controllers[name] = new controllerClass(this.baseController.params, this._getControllerInjection()); - this.controllers[name].name = name; - callback(this.controllers[name]); - }.bind(this), - function () { - this.baseController.error404(); - }.bind(this)); - return; - } catch (e) { - this.baseController.error404(); - } - } - callback(this.controllers[name]); - }, + _getController: function (name, callback) { + if (!(name || false)) { + callback(this.baseController); + return; + } + if (!(name in this.controllers)) { + try { + var className = this.metadata.get('clientDefs.' + name + '.controller'); + if (!className) { + var module = this.metadata.get('scopes.' + name + '.module'); + className = Espo.Utils.composeClassName(module, name, 'Controllers'); + } + + this.loader.load(className, function (controllerClass) { + this.controllers[name] = new controllerClass(this.baseController.params, this._getControllerInjection()); + this.controllers[name].name = name; + callback(this.controllers[name]); + }.bind(this), + function () { + this.baseController.error404(); + }.bind(this)); + return; + } catch (e) { + this.baseController.error404(); + } + } + callback(this.controllers[name]); + }, - _preLoad: function (callback) { - this._preLoader.load(callback, this); - }, + _preLoad: function (callback) { + this._preLoader.load(callback, this); + }, - _initDateTime: function () { - this.dateTime = new Espo.DateTime(); - this._modelFactory.dateTime = this.dateTime; - this.dateTime.setSettingsAndPreferences(this.settings, this.preferences); - }, + _initDateTime: function () { + this.dateTime = new Espo.DateTime(); + this._modelFactory.dateTime = this.dateTime; + this.dateTime.setSettingsAndPreferences(this.settings, this.preferences); + }, - _initView: function () { + _initView: function () { - var helper = this._viewHelper = new Espo.ViewHelper(); - helper.layoutManager = new Espo.LayoutManager({cache: this.cache}); - helper.settings = this.settings; - helper.user = this.user; - helper.preferences = this.preferences; - helper.acl = this.acl; - helper.modelFactory = this._modelFactory; - helper.collectionFactory = this._collectionFactory; - helper.storage = this.storage; - helper.dateTime = this.dateTime; - helper.language = this.language; - helper.metadata = this.metadata; - helper.fieldManager = this.fieldManager; - helper.cache = this.cache; - helper.storage = this.storage; + var helper = this._viewHelper = new Espo.ViewHelper(); + helper.layoutManager = new Espo.LayoutManager({cache: this.cache}); + helper.settings = this.settings; + helper.user = this.user; + helper.preferences = this.preferences; + helper.acl = this.acl; + helper.modelFactory = this._modelFactory; + helper.collectionFactory = this._collectionFactory; + helper.storage = this.storage; + helper.dateTime = this.dateTime; + helper.language = this.language; + helper.metadata = this.metadata; + helper.fieldManager = this.fieldManager; + helper.cache = this.cache; + helper.storage = this.storage; - this._viewLoader = function (viewName, callback) { - this.loader.load(Espo.Utils.composeViewClassName(viewName), callback); - }.bind(this); - - var self = this; - - - var getResourceInnerPath = function (type, name) { - switch (type) { - case 'template': - return 'res/templates/' + name.split('.').join('/') + '.tpl'; - case 'layoutTemplate': - return 'res/layout-types/' + name + '.tpl'; - case 'layout': - return 'res/layouts/' + name + '.json'; - } - }; - - var getResourcePath = function (type, name) { - var path; - if (name.indexOf(':') != -1) { - var arr = name.split(':'); - name = arr[1]; - var mod = arr[0]; - if (mod == 'custom') { - path = 'client/custom/' + getResourceInnerPath(type, name); - } else { - path = 'client/modules/' + mod + '/' + getResourceInnerPath(type, name); - } - } else { - path = 'client/' + getResourceInnerPath(type, name); - } - return path; - }; + this._viewLoader = function (viewName, callback) { + this.loader.load(Espo.Utils.composeViewClassName(viewName), callback); + }.bind(this); + + var self = this; + + + var getResourceInnerPath = function (type, name) { + switch (type) { + case 'template': + return 'res/templates/' + name.split('.').join('/') + '.tpl'; + case 'layoutTemplate': + return 'res/layout-types/' + name + '.tpl'; + case 'layout': + return 'res/layouts/' + name + '.json'; + } + }; + + var getResourcePath = function (type, name) { + var path; + if (name.indexOf(':') != -1) { + var arr = name.split(':'); + name = arr[1]; + var mod = arr[0]; + if (mod == 'custom') { + path = 'client/custom/' + getResourceInnerPath(type, name); + } else { + path = 'client/modules/' + mod + '/' + getResourceInnerPath(type, name); + } + } else { + path = 'client/' + getResourceInnerPath(type, name); + } + return path; + }; - this._viewFactory = new Bull.Factory({ - useCache: false, - defaultViewName: 'Base', - helper: helper, - viewLoader: this._viewLoader, - resources: { - loaders: { - 'template': function (name, callback) { - var path = getResourcePath('template', name); - self.loader.load('res!' + path, callback); - }, - 'layoutTemplate': function (name, callback) { - var path = getResourcePath('layoutTemplate', name); - self.loader.load('res!' + path, callback); - } - } - } - }); - }, + this._viewFactory = new Bull.Factory({ + useCache: false, + defaultViewName: 'Base', + helper: helper, + viewLoader: this._viewLoader, + resources: { + loaders: { + 'template': function (name, callback) { + var path = getResourcePath('template', name); + self.loader.load('res!' + path, callback); + }, + 'layoutTemplate': function (name, callback) { + var path = getResourcePath('layoutTemplate', name); + self.loader.load('res!' + path, callback); + } + } + } + }); + }, - _initAuth: function () { - this.auth = this.storage.get('user', 'auth') || null; + _initAuth: function () { + this.auth = this.storage.get('user', 'auth') || null; - this.baseController.on('login', function (data) { - this.auth = Base64.encode(data.auth.userName + ':' + data.auth.token); - this.storage.set('user', 'auth', this.auth); - this.storage.set('user', 'user', data.user); - this.storage.set('user', 'preferences', data.preferences); - this.storage.set('user', 'acl', data.acl || {}); - - this._initUserData(data); + this.baseController.on('login', function (data) { + this.auth = Base64.encode(data.auth.userName + ':' + data.auth.token); + this.storage.set('user', 'auth', this.auth); + this.storage.set('user', 'user', data.user); + this.storage.set('user', 'preferences', data.preferences); + this.storage.set('user', 'acl', data.acl || {}); + + this._initUserData(data); - this.trigger('auth'); + this.trigger('auth'); - }.bind(this)); + }.bind(this)); - this.baseController.on('logout', function () { - this.logout(); - }.bind(this)); - }, - - logout: function () { - - if (this.auth) { - var arr = Base64.decode(this.auth).split(':'); - if (arr.length > 1) { - $.ajax({ - url: 'App/action/destroyAuthToken', - type: 'POST', - data: JSON.stringify({ - token: arr[1] - }) - }); - } - } - - this.auth = null; - this.user.clear(); - this.preferences.clear(); - this.acl.clear(); - this.storage.clear('user', 'auth'); - this.storage.clear('user', 'user'); - this.storage.clear('user', 'preferences'); - this.storage.clear('user', 'acl'); - this.doAction({action: 'login'}); - this.language.clearCache(); + this.baseController.on('logout', function () { + this.logout(); + }.bind(this)); + }, + + logout: function () { + + if (this.auth) { + var arr = Base64.decode(this.auth).split(':'); + if (arr.length > 1) { + $.ajax({ + url: 'App/action/destroyAuthToken', + type: 'POST', + data: JSON.stringify({ + token: arr[1] + }) + }); + } + } + + this.auth = null; + this.user.clear(); + this.preferences.clear(); + this.acl.clear(); + this.storage.clear('user', 'auth'); + this.storage.clear('user', 'user'); + this.storage.clear('user', 'preferences'); + this.storage.clear('user', 'acl'); + this.doAction({action: 'login'}); + this.language.clearCache(); xhr = new XMLHttpRequest; xhr.open('GET', this.url + '/', !1, 'logout', 'logout'); xhr.send(''); xhr.abort(); - }, + }, - _initUserData: function (options) { - options = options || {}; - - if (this.auth !== null) { - - this.language.load(null, true); - this.dateTime.setLanguage(this.language); - - var userData = options.user || this.storage.get('user', 'user') || null; - var preferencesData = options.preferences || this.storage.get('user', 'preferences') || null; - var aclData = options.acl || this.storage.get('user', 'acl') || null; - - this.user.set(userData); - this.preferences.set(preferencesData); - this.acl.set(aclData); - - this.user.on('change', function () { - this.storage.set('user', 'user', this.user.toJSON()); - }, this); - - if (!this.auth) { - return; - } + _initUserData: function (options) { + options = options || {}; + + if (this.auth !== null) { + + this.language.load(null, true); + this.dateTime.setLanguage(this.language); + + var userData = options.user || this.storage.get('user', 'user') || null; + var preferencesData = options.preferences || this.storage.get('user', 'preferences') || null; + var aclData = options.acl || this.storage.get('user', 'acl') || null; + + this.user.set(userData); + this.preferences.set(preferencesData); + this.acl.set(aclData); + + this.user.on('change', function () { + this.storage.set('user', 'user', this.user.toJSON()); + }, this); + + if (!this.auth) { + return; + } - var arr = Base64.decode(this.auth).split(':'); - var xhr = new XMLHttpRequest(); - xhr.open('GET', this.url + '/', false, arr[0], arr[1]); - xhr.send(''); - } - }, + var arr = Base64.decode(this.auth).split(':'); + var xhr = new XMLHttpRequest(); + xhr.open('GET', this.url + '/', false, arr[0], arr[1]); + xhr.send(''); + } + }, - _setupAjax: function () { - var self = this; - $.ajaxSetup({ - beforeSend: function (xhr, options) { - if (!options.local && self.url) { - this.url = Espo.Utils.trimSlash(self.url) + '/' + this.url; - } - if (self.auth !== null) { - xhr.setRequestHeader('Authorization', 'Basic ' + self.auth); - xhr.setRequestHeader('Espo-Authorization', self.auth); - } - }, - dataType: 'json', - timeout: 60000, - contentType: 'application/json' - }); - - $(document).ajaxError(function (event, xhr, options) { - if (xhr.errorIsHandled) { - return; - } - switch (xhr.status) { - case 0: - if (xhr.statusText == 'timeout') { - Espo.Ui.error(self.language.translate('Timeout')); - } - break; - case 200: - Espo.Ui.error(self.language.translate('Bad server response')); - console.error('Bad server response: ' + xhr.responseText); - break; - case 401: - if (!options.login) { - Espo.Ui.error(self.language.translate('Auth error')); - if (self.auth) { - self.logout(); - } - } - break; - case 403: - if (options.main) { - self.baseController.error403(); - } else { - Espo.Ui.error(self.language.translate('Error') + ' ' + xhr.status); - } - break; - case 404: - if (options.main) { - self.baseController.error404(); - } else { - Espo.Ui.error(self.language.translate('Error') + ' ' + xhr.status); - } - break; - default: - Espo.Ui.error(self.language.translate('Error') + ' ' + xhr.status); - } - - var statusReason = xhr.getResponseHeader('X-Status-Reason'); - if (statusReason) { - console.error('Server side error: ' + statusReason); - } - }); - }, + _setupAjax: function () { + var self = this; + $.ajaxSetup({ + beforeSend: function (xhr, options) { + if (!options.local && self.url) { + this.url = Espo.Utils.trimSlash(self.url) + '/' + this.url; + } + if (self.auth !== null) { + xhr.setRequestHeader('Authorization', 'Basic ' + self.auth); + xhr.setRequestHeader('Espo-Authorization', self.auth); + } + }, + dataType: 'json', + timeout: 60000, + contentType: 'application/json' + }); + + $(document).ajaxError(function (event, xhr, options) { + if (xhr.errorIsHandled) { + return; + } + switch (xhr.status) { + case 0: + if (xhr.statusText == 'timeout') { + Espo.Ui.error(self.language.translate('Timeout')); + } + break; + case 200: + Espo.Ui.error(self.language.translate('Bad server response')); + console.error('Bad server response: ' + xhr.responseText); + break; + case 401: + if (!options.login) { + Espo.Ui.error(self.language.translate('Auth error')); + if (self.auth) { + self.logout(); + } + } + break; + case 403: + if (options.main) { + self.baseController.error403(); + } else { + Espo.Ui.error(self.language.translate('Error') + ' ' + xhr.status); + } + break; + case 404: + if (options.main) { + self.baseController.error404(); + } else { + Espo.Ui.error(self.language.translate('Error') + ' ' + xhr.status); + } + break; + default: + Espo.Ui.error(self.language.translate('Error') + ' ' + xhr.status); + } + + var statusReason = xhr.getResponseHeader('X-Status-Reason'); + if (statusReason) { + console.error('Server side error: ' + statusReason); + } + }); + }, }, Backbone.Events); diff --git a/frontend/client/src/cache.js b/frontend/client/src/cache.js index f59dfb34c0..d941cf45ef 100644 --- a/frontend/client/src/cache.js +++ b/frontend/client/src/cache.js @@ -24,83 +24,83 @@ Espo.Cache = function () { }; _.extend(Espo.Cache.prototype, { - - _prefix: 'cache', - - handleActuality: function (cacheTimestamp) { - var stored = parseInt(this.get('app', 'cacheTimestamp')); - if (stored) { - if (stored !== cacheTimestamp) { - this.clear(); - } - } else { - this.clear(); - this.set('app', 'cacheTimestamp', cacheTimestamp); - } - }, - - _composeFullPrefix: function (type) { - return this._prefix + '-' + type; - }, + + _prefix: 'cache', + + handleActuality: function (cacheTimestamp) { + var stored = parseInt(this.get('app', 'cacheTimestamp')); + if (stored) { + if (stored !== cacheTimestamp) { + this.clear(); + } + } else { + this.clear(); + this.set('app', 'cacheTimestamp', cacheTimestamp); + } + }, + + _composeFullPrefix: function (type) { + return this._prefix + '-' + type; + }, - _composeKey: function (type, name) { - return this._composeFullPrefix(type) + '-' + name; - }, + _composeKey: function (type, name) { + return this._composeFullPrefix(type) + '-' + name; + }, - _checkType: function (type) { - if (typeof type === 'undefined' && toString.call(type) != '[object String]') { - throw new TypeError("Bad type \"" + type + "\" passed to Bull.Cacher()."); - } - }, + _checkType: function (type) { + if (typeof type === 'undefined' && toString.call(type) != '[object String]') { + throw new TypeError("Bad type \"" + type + "\" passed to Bull.Cacher()."); + } + }, - get: function (type, name) { - this._checkType(type); + get: function (type, name) { + this._checkType(type); - var key = this._composeKey(type, name); - var stored = localStorage.getItem(key); - if (stored) { - var str = stored; - if (stored[0] == "{" || stored[0] == "[") { - try { - str = JSON.parse(stored); - } catch (error) { - str = stored; - } - stored = str; - } - return stored; - } - return null; - }, + var key = this._composeKey(type, name); + var stored = localStorage.getItem(key); + if (stored) { + var str = stored; + if (stored[0] == "{" || stored[0] == "[") { + try { + str = JSON.parse(stored); + } catch (error) { + str = stored; + } + stored = str; + } + return stored; + } + return null; + }, - set: function (type, name, value) { - this._checkType(type); - var key = this._composeKey(type, name); - if (value instanceof Object) { - value = JSON.stringify(value); - } - localStorage.setItem(key, value); - }, + set: function (type, name, value) { + this._checkType(type); + var key = this._composeKey(type, name); + if (value instanceof Object) { + value = JSON.stringify(value); + } + localStorage.setItem(key, value); + }, - clear: function (type, name) { - var reText; - if (typeof type !== 'undefined') { - if (typeof name === 'undefined') { - reText = '^' + this._composeFullPrefix(type); - } else { - reText = '^' + this._composeKey(type, name); - } - } else { - reText = '^' + this._prefix + '-'; - } - var re = new RegExp(reText); - for (var i in localStorage) { - if (re.test(i)) { - delete localStorage[i]; - } - } - }, + clear: function (type, name) { + var reText; + if (typeof type !== 'undefined') { + if (typeof name === 'undefined') { + reText = '^' + this._composeFullPrefix(type); + } else { + reText = '^' + this._composeKey(type, name); + } + } else { + reText = '^' + this._prefix + '-'; + } + var re = new RegExp(reText); + for (var i in localStorage) { + if (re.test(i)) { + delete localStorage[i]; + } + } + }, }); - + diff --git a/frontend/client/src/collection-factory.js b/frontend/client/src/collection-factory.js index 25e551abc8..d6517418a1 100644 --- a/frontend/client/src/collection-factory.js +++ b/frontend/client/src/collection-factory.js @@ -20,37 +20,37 @@ ************************************************************************/ Espo.CollectionFactory = function (loader, modelFactory) { - this.loader = loader; - this.modelFactory = modelFactory; + this.loader = loader; + this.modelFactory = modelFactory; }; _.extend(Espo.CollectionFactory.prototype, { - loader: null, + loader: null, - modelFactory: null, + modelFactory: null, - create: function (name, callback, context) { - context = context || this; - - this.modelFactory.getSeed(name, function (seed) { - - var asc = this.modelFactory.metadata.get('entityDefs.' + name + '.collection.asc'); - var sortBy = this.modelFactory.metadata.get('entityDefs.' + name + '.collection.sortBy'); - - var className = this.modelFactory.metadata.get('clientDefs.' + name + '.collection') || 'Collection'; + create: function (name, callback, context) { + context = context || this; + + this.modelFactory.getSeed(name, function (seed) { + + var asc = this.modelFactory.metadata.get('entityDefs.' + name + '.collection.asc'); + var sortBy = this.modelFactory.metadata.get('entityDefs.' + name + '.collection.sortBy'); + + var className = this.modelFactory.metadata.get('clientDefs.' + name + '.collection') || 'Collection'; - Espo.loader.load(className, function (collectionClass) { - var collection = new collectionClass(null, { - name: name, - asc: asc, - sortBy: sortBy - }); - collection.model = seed; - collection._user = this.modelFactory.user; - callback.call(context, collection); - }.bind(this)); - }.bind(this)); - } + Espo.loader.load(className, function (collectionClass) { + var collection = new collectionClass(null, { + name: name, + asc: asc, + sortBy: sortBy + }); + collection.model = seed; + collection._user = this.modelFactory.user; + callback.call(context, collection); + }.bind(this)); + }.bind(this)); + } }); diff --git a/frontend/client/src/collection.js b/frontend/client/src/collection.js index 950434e550..80899a3eb9 100644 --- a/frontend/client/src/collection.js +++ b/frontend/client/src/collection.js @@ -21,101 +21,101 @@ Espo.Collection = Backbone.Collection.extend({ - name: null, + name: null, - total: 0, + total: 0, - offset: 0, + offset: 0, - maxSize: 20, + maxSize: 20, - sortBy: 'id', + sortBy: 'id', - asc: false, + asc: false, - where: null, + where: null, - _user: null, + _user: null, - initialize: function (models, options) { - options = options || {}; - this.name = options.name || this.name; - this.urlRoot = this.urlRoot || this.name; - this.url = this.url || this.urlRoot; - - this.sortBy = options.sortBy || this.sortBy; - this.asc = ('asc' in options) ? options.asc : this.asc; + initialize: function (models, options) { + options = options || {}; + this.name = options.name || this.name; + this.urlRoot = this.urlRoot || this.name; + this.url = this.url || this.urlRoot; + + this.sortBy = options.sortBy || this.sortBy; + this.asc = ('asc' in options) ? options.asc : this.asc; - Backbone.Collection.prototype.initialize.call(this); - }, + Backbone.Collection.prototype.initialize.call(this); + }, - sort: function (field, asc) { - this.sortBy = field; - this.asc = asc; - this.fetch(); - }, + sort: function (field, asc) { + this.sortBy = field; + this.asc = asc; + this.fetch(); + }, - nextPage: function () { - var offset = this.offset + this.maxSize; - this.setOffset(offset); - }, + nextPage: function () { + var offset = this.offset + this.maxSize; + this.setOffset(offset); + }, - previousPage: function () { - var offset = this.offset - this.maxSize; - this.setOffset(offset); - }, + previousPage: function () { + var offset = this.offset - this.maxSize; + this.setOffset(offset); + }, - firstPage: function () { - this.setOffset(0); - }, + firstPage: function () { + this.setOffset(0); + }, - lastPage: function () { - var offset = this.total - this.total % this.maxSize; - this.setOffset(offset); - }, + lastPage: function () { + var offset = this.total - this.total % this.maxSize; + this.setOffset(offset); + }, - setOffset: function (offset) { - if (offset < 0) { - throw new RangeError('offset can not be less than 0'); - } - if (offset > this.total) { - throw new RangeError('offset can not be larger than total count'); - } - this.offset = offset; - this.fetch(); - }, + setOffset: function (offset) { + if (offset < 0) { + throw new RangeError('offset can not be less than 0'); + } + if (offset > this.total) { + throw new RangeError('offset can not be larger than total count'); + } + this.offset = offset; + this.fetch(); + }, - parse: function (response) { - this.total = response.total; - return response.list; - }, + parse: function (response) { + this.total = response.total; + return response.list; + }, - fetch: function (options) { - var options = options || {}; - options.data = options.data || {}; + fetch: function (options) { + var options = options || {}; + options.data = options.data || {}; - this.offset = options.offset || this.offset; - this.sortBy = options.sortBy || this.sortBy; - this.asc = options.asc || this.asc; - this.where = options.where || this.where; + this.offset = options.offset || this.offset; + this.sortBy = options.sortBy || this.sortBy; + this.asc = options.asc || this.asc; + this.where = options.where || this.where; - if (!('maxSize' in options)) { - options.data.maxSize = options.more ? this.maxSize : ((this.length > this.maxSize) ? this.length : this.maxSize); - } else { - options.data.maxSize = options.maxSize; - } - - options.data.offset = options.more ? this.length : this.offset; - options.data.sortBy = this.sortBy; - options.data.asc = this.asc; - options.data.where = this.where; - - return Backbone.Collection.prototype.fetch.call(this, options); - }, + if (!('maxSize' in options)) { + options.data.maxSize = options.more ? this.maxSize : ((this.length > this.maxSize) ? this.length : this.maxSize); + } else { + options.data.maxSize = options.maxSize; + } + + options.data.offset = options.more ? this.length : this.offset; + options.data.sortBy = this.sortBy; + options.data.asc = this.asc; + options.data.where = this.where; + + return Backbone.Collection.prototype.fetch.call(this, options); + }, - getUser: function () { - return this._user; - }, + getUser: function () { + return this._user; + }, }); diff --git a/frontend/client/src/collections/note.js b/frontend/client/src/collections/note.js index 77abcaac31..d0d2122858 100644 --- a/frontend/client/src/collections/note.js +++ b/frontend/client/src/collections/note.js @@ -19,23 +19,23 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Collections.Note', 'Collection', function (Dep) { - - return Dep.extend({ - - fetchNew: function (options) { - var options = options || {}; - options.data = options.data || {}; - - if (this.length) { - options.data.after = this.models[0].get('createdAt'); - options.remove = false; - options.at = 0; - options.maxSize = null; - } - - this.fetch(options); - }, - - }); - + + return Dep.extend({ + + fetchNew: function (options) { + var options = options || {}; + options.data = options.data || {}; + + if (this.length) { + options.data.after = this.models[0].get('createdAt'); + options.remove = false; + options.at = 0; + options.maxSize = null; + } + + this.fetch(options); + }, + + }); + }); diff --git a/frontend/client/src/controller.js b/frontend/client/src/controller.js index 5185092bad..ba3f47724b 100644 --- a/frontend/client/src/controller.js +++ b/frontend/client/src/controller.js @@ -21,238 +21,238 @@ /** * Controller. Views, Models and Collections are created here. -*/ +*/ Espo.Controller = function (params, injections) { - this.initialize(); - this.params = params || {}; - this.viewFactory = injections.viewFactory; - this.modelFactory = injections.modelFactory; - this.collectionFactory = injections.collectionFactory; - - this._settings = injections.settings || null; - this._user = injections.user || null; - this._preferences = injections.preferences || null; - this._acl = injections.acl || null; - this._cache = injections.cache || null; - this._router = injections.router || null; - this._storage = injections.storage || null; - this._metadata = injections.metadata || null; - this._dateTime = injections.dateTime || null; - - this.set('masterRendered', false); + this.initialize(); + this.params = params || {}; + this.viewFactory = injections.viewFactory; + this.modelFactory = injections.modelFactory; + this.collectionFactory = injections.collectionFactory; + + this._settings = injections.settings || null; + this._user = injections.user || null; + this._preferences = injections.preferences || null; + this._acl = injections.acl || null; + this._cache = injections.cache || null; + this._router = injections.router || null; + this._storage = injections.storage || null; + this._metadata = injections.metadata || null; + this._dateTime = injections.dateTime || null; + + this.set('masterRendered', false); }; _.extend(Espo.Controller.prototype, { - - defaultAction: 'index', - - name: false, - - params: null, - - viewFactory: null, - - modelFactory: null, - - controllerFactory: null, - - initialize: function () {}, - - getConfig: function () { - return this._settings; - }, - - getUser: function () { - return this._user; - }, - - getPreferences: function () { - return this._preferences; - }, - - getAcl: function () { - return this._acl; - }, - - getCache: function () { - return this._cache; - }, - - getRouter: function () { - return this._router; - }, - - getStorage: function () { - return this._storage; - }, - - getMetadata: function () { - return this._metadata; - }, - - getDateTime: function () { - return this._dateTime; - }, - - /** - * Get parameter of all controllers. - * @param key - * @return null if doesn't exist. - */ - get: function (key) { - if (key in this.params) { - return this.params[key]; - } - return null; - }, - - /** - * Set paramer for all controllers. - * @param key Name of view. - * @param value. - */ - set: function (key, value) { - this.params[key] = value; - }, - - checkAccess: function (action) { - return true; - }, - - handleAccessGlobal: function () { - if (!this.checkAccessGlobal()) { - throw new Espo.Exceptions.AccessDenied("Denied access to action '" + this.name + "#" + action + "'"); - } - }, - - checkAccessGlobal: function () { - return true; - }, - - handleCheckAccess: function (action) { - if (!this.checkAccess(action)) { - throw new Espo.Exceptions.AccessDenied("Denied access to action '" + this.name + "#" + action + "'"); - } - }, - - doAction: function (action, options) { - this.handleAccessGlobal(); - - action = action || this.defaultAction; - var method = action; - if (!(method in this)) { - throw new Espo.Exceptions.NotFound("Action '" + this.name + "#" + action + "' is not found"); - } - - var preMethod = 'before' + Espo.Utils.upperCaseFirst(method); - var postMethod = 'after' + Espo.Utils.upperCaseFirst(method); - - if (preMethod in this) { - this[preMethod].call(this, options || {}); - } - this[method].call(this, options || {}); - if (postMethod in this) { - this[postMethod].call(this, options || {}); - } - }, - - /** - * Create master view, render it if not rendered and return it. - * @param {Function} callback Master view will be argument for this. - */ - master: function (callback) { - var entire = this.get('entire'); - if (entire) { - entire.remove(); - this.set('entire', null); - } - var master = this.get('master'); - if (!master) { - this.viewFactory.create('Site.Master', null, function (master) { - this.set('master', master); - if (!this.get('masterRendered')) { - master.render(function () { - this.set('masterRendered', true); - callback.call(this, master); - }.bind(this)); - return; - } - callback.call(this, master); - }.bind(this)); - } else { - callback.call(this, master); - } - }, - - /** - * Create main view in master and return it. - * @param {String} view Name of view. - * @param {Object} options Options for view. - * @return {Espo.View} - */ - main: function (view, options, callback) { - var view = view || 'Base'; - var master = this.master(function (master) { - master.showLoadingNotification(); - options = options || {}; - options.el = '#main'; - this.viewFactory.create(view, options, function (main) { - main.once('render', function () { - main.updatePageTitle(); - master.hideLoadingNotification(); - }); - master.setView('main', main); - - main.once('after:render', function () { - $(window).scrollTop(0) - }); - - if (callback) { - callback.call(this, main); - } else { - main.render(); - } - }); - }.bind(this)); - }, - - showLoadingNotification: function () { - var master = this.get('master'); - if (master) { - master.showLoadingNotification(); - } - }, - - hideLoadingNotification: function () { - var master = this.get('master'); - if (master) { - master.hideLoadingNotification(); - } - }, - - /** - * Create view in the body tag. - * @param {String} view Name of view. - * @param {Object} options Options for view. - * @return {Espo.View} - */ - entire: function (view, options, callback) { - var master = this.get('master'); - if (master) { - master.remove(); - } - this.set('master', null); - this.set('masterRendered', false); - options = options || {}; - options.el = 'body'; - this.viewFactory.create(view, options, function (view) { - this.set('entire', view); - callback(view); - }.bind(this)); - } + + defaultAction: 'index', + + name: false, + + params: null, + + viewFactory: null, + + modelFactory: null, + + controllerFactory: null, + + initialize: function () {}, + + getConfig: function () { + return this._settings; + }, + + getUser: function () { + return this._user; + }, + + getPreferences: function () { + return this._preferences; + }, + + getAcl: function () { + return this._acl; + }, + + getCache: function () { + return this._cache; + }, + + getRouter: function () { + return this._router; + }, + + getStorage: function () { + return this._storage; + }, + + getMetadata: function () { + return this._metadata; + }, + + getDateTime: function () { + return this._dateTime; + }, + + /** + * Get parameter of all controllers. + * @param key + * @return null if doesn't exist. + */ + get: function (key) { + if (key in this.params) { + return this.params[key]; + } + return null; + }, + + /** + * Set paramer for all controllers. + * @param key Name of view. + * @param value. + */ + set: function (key, value) { + this.params[key] = value; + }, + + checkAccess: function (action) { + return true; + }, + + handleAccessGlobal: function () { + if (!this.checkAccessGlobal()) { + throw new Espo.Exceptions.AccessDenied("Denied access to action '" + this.name + "#" + action + "'"); + } + }, + + checkAccessGlobal: function () { + return true; + }, + + handleCheckAccess: function (action) { + if (!this.checkAccess(action)) { + throw new Espo.Exceptions.AccessDenied("Denied access to action '" + this.name + "#" + action + "'"); + } + }, + + doAction: function (action, options) { + this.handleAccessGlobal(); + + action = action || this.defaultAction; + var method = action; + if (!(method in this)) { + throw new Espo.Exceptions.NotFound("Action '" + this.name + "#" + action + "' is not found"); + } + + var preMethod = 'before' + Espo.Utils.upperCaseFirst(method); + var postMethod = 'after' + Espo.Utils.upperCaseFirst(method); + + if (preMethod in this) { + this[preMethod].call(this, options || {}); + } + this[method].call(this, options || {}); + if (postMethod in this) { + this[postMethod].call(this, options || {}); + } + }, + + /** + * Create master view, render it if not rendered and return it. + * @param {Function} callback Master view will be argument for this. + */ + master: function (callback) { + var entire = this.get('entire'); + if (entire) { + entire.remove(); + this.set('entire', null); + } + var master = this.get('master'); + if (!master) { + this.viewFactory.create('Site.Master', null, function (master) { + this.set('master', master); + if (!this.get('masterRendered')) { + master.render(function () { + this.set('masterRendered', true); + callback.call(this, master); + }.bind(this)); + return; + } + callback.call(this, master); + }.bind(this)); + } else { + callback.call(this, master); + } + }, + + /** + * Create main view in master and return it. + * @param {String} view Name of view. + * @param {Object} options Options for view. + * @return {Espo.View} + */ + main: function (view, options, callback) { + var view = view || 'Base'; + var master = this.master(function (master) { + master.showLoadingNotification(); + options = options || {}; + options.el = '#main'; + this.viewFactory.create(view, options, function (main) { + main.once('render', function () { + main.updatePageTitle(); + master.hideLoadingNotification(); + }); + master.setView('main', main); + + main.once('after:render', function () { + $(window).scrollTop(0) + }); + + if (callback) { + callback.call(this, main); + } else { + main.render(); + } + }); + }.bind(this)); + }, + + showLoadingNotification: function () { + var master = this.get('master'); + if (master) { + master.showLoadingNotification(); + } + }, + + hideLoadingNotification: function () { + var master = this.get('master'); + if (master) { + master.hideLoadingNotification(); + } + }, + + /** + * Create view in the body tag. + * @param {String} view Name of view. + * @param {Object} options Options for view. + * @return {Espo.View} + */ + entire: function (view, options, callback) { + var master = this.get('master'); + if (master) { + master.remove(); + } + this.set('master', null); + this.set('masterRendered', false); + options = options || {}; + options.el = 'body'; + this.viewFactory.create(view, options, function (view) { + this.set('entire', view); + callback(view); + }.bind(this)); + } }, Backbone.Events); -Espo.Controller.extend = Backbone.Router.extend; +Espo.Controller.extend = Backbone.Router.extend; diff --git a/frontend/client/src/controllers/about.js b/frontend/client/src/controllers/about.js index 0bf8926452..ca25ba5e3a 100644 --- a/frontend/client/src/controllers/about.js +++ b/frontend/client/src/controllers/about.js @@ -19,16 +19,16 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Controllers.About', 'Controller', function (Dep) { - - return Dep.extend({ - - defaultAction: 'about', - - about: function () { - this.main('About', {}, function (view) { - view.render(); - }); - }, - }); - + + return Dep.extend({ + + defaultAction: 'about', + + about: function () { + this.main('About', {}, function (view) { + view.render(); + }); + }, + }); + }); diff --git a/frontend/client/src/controllers/admin.js b/frontend/client/src/controllers/admin.js index 960443dd6e..cd9b0a89ce 100644 --- a/frontend/client/src/controllers/admin.js +++ b/frontend/client/src/controllers/admin.js @@ -19,175 +19,175 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Controllers.Admin', 'Controller', function (Dep) { - - return Dep.extend({ - - checkAccessGlobal: function () { - if (this.getUser().isAdmin()) { - return true; - } - return false; - }, - - index: function () { - this.main('Admin.Index', null); - }, - - layouts: function (options) { - var scope = options.scope || null; - var type = options.type || null; - - this.main('Admin.Layouts.Index', {scope: scope, type: type}); - }, - - fieldManager: function (options) { - var scope = options.scope || null; - var field = options.field || null; + + return Dep.extend({ + + checkAccessGlobal: function () { + if (this.getUser().isAdmin()) { + return true; + } + return false; + }, + + index: function () { + this.main('Admin.Index', null); + }, + + layouts: function (options) { + var scope = options.scope || null; + var type = options.type || null; + + this.main('Admin.Layouts.Index', {scope: scope, type: type}); + }, + + fieldManager: function (options) { + var scope = options.scope || null; + var field = options.field || null; - this.main('Admin.FieldManager.Index', {scope: scope, field: field}); - }, - - upgrade: function (options) { - this.main('Admin.Upgrade.Index'); - }, - - getSettingsModel: function () { - var model = this.getConfig().clone(); - model.defs = this.getConfig().defs; - - return model; - }, - - settings: function () { - var model = this.getSettingsModel(); - - model.once('sync', function () { - model.id = '1'; - this.main('Edit', { - model: model, - views: { - header: {template: 'admin.settings.header'}, - body: {view: 'Admin.Settings'}, - }, - }); - }, this); - model.fetch(); - }, - - outboundEmail: function () { - var model = this.getSettingsModel(); - - model.once('sync', function () { - model.id = '1'; - this.main('Edit', { - model: model, - views: { - header: {template: 'admin.settings.header-outbound-email'}, - body: {view: 'Admin.OutboundEmail'}, - }, - }); - }, this); - model.fetch(); - }, - - currency: function () { - var model = this.getSettingsModel(); - - model.once('sync', function () { - model.id = '1'; - this.main('Edit', { - model: model, - views: { - header: {template: 'admin.settings.header-currency'}, - body: {view: 'Admin.Currency'}, - }, - }); - }, this); - model.fetch(); - }, - - authTokens: function () { - this.collectionFactory.create('AuthToken', function (collection) { - var searchManager = new Espo.SearchManager(collection, 'list', this.getStorage(), this.getDateTime()); - searchManager.loadStored(); - collection.where = searchManager.getWhere(); - collection.maxSize = this.getConfig().get('recordsPerPage') || collection.maxSize; + this.main('Admin.FieldManager.Index', {scope: scope, field: field}); + }, + + upgrade: function (options) { + this.main('Admin.Upgrade.Index'); + }, + + getSettingsModel: function () { + var model = this.getConfig().clone(); + model.defs = this.getConfig().defs; + + return model; + }, + + settings: function () { + var model = this.getSettingsModel(); + + model.once('sync', function () { + model.id = '1'; + this.main('Edit', { + model: model, + views: { + header: {template: 'admin.settings.header'}, + body: {view: 'Admin.Settings'}, + }, + }); + }, this); + model.fetch(); + }, + + outboundEmail: function () { + var model = this.getSettingsModel(); + + model.once('sync', function () { + model.id = '1'; + this.main('Edit', { + model: model, + views: { + header: {template: 'admin.settings.header-outbound-email'}, + body: {view: 'Admin.OutboundEmail'}, + }, + }); + }, this); + model.fetch(); + }, + + currency: function () { + var model = this.getSettingsModel(); + + model.once('sync', function () { + model.id = '1'; + this.main('Edit', { + model: model, + views: { + header: {template: 'admin.settings.header-currency'}, + body: {view: 'Admin.Currency'}, + }, + }); + }, this); + model.fetch(); + }, + + authTokens: function () { + this.collectionFactory.create('AuthToken', function (collection) { + var searchManager = new Espo.SearchManager(collection, 'list', this.getStorage(), this.getDateTime()); + searchManager.loadStored(); + collection.where = searchManager.getWhere(); + collection.maxSize = this.getConfig().get('recordsPerPage') || collection.maxSize; - this.main('Admin.AuthToken.List', { - scope: 'AuthToken', - collection: collection, - searchManager: searchManager, - }); - }, this); - }, - - userInterface: function () { - var model = this.getSettingsModel(); - - model.once('sync', function () { - model.id = '1'; - this.main('Edit', { - model: model, - views: { - header: {template: 'admin.settings.header-user-interface'}, - body: {view: 'Admin.UserInterface'}, - }, - }); - }, this); - model.fetch(); - }, - - authentication: function () { - var model = this.getSettingsModel(); - - model.once('sync', function () { - model.id = '1'; - this.main('Edit', { - model: model, - views: { - header: {template: 'admin.settings.header-authentication'}, - body: {view: 'Admin.Authentication'}, - }, - }); - }, this); - model.fetch(); - }, - - integrations: function (options) { - var integration = options.name || null; - - this.main('Admin.Integrations.Index', {integration: integration}); - }, - - extensions: function (options) { - this.main('Admin.Extensions.Index'); - }, - - rebuild: function (options) { - var master = this.get('master'); - Espo.Ui.notify(master.translate('Please wait...')); - this.getRouter().navigate('#Admin'); - $.ajax({ - url: 'Admin/rebuild', - success: function () { - var msg = master.translate('Rebuild has been done', 'labels', 'Admin'); - Espo.Ui.success(msg); - }.bind(this) - }); - }, - - clearCache: function (options) { - var master = this.get('master'); - Espo.Ui.notify(master.translate('Please wait...')); - this.getRouter().navigate('#Admin'); - $.ajax({ - url: 'Admin/clearCache', - success: function () { - var msg = master.translate('Cache has been cleared', 'labels', 'Admin'); - Espo.Ui.success(msg); - }.bind(this) - }); - }, - }); - + this.main('Admin.AuthToken.List', { + scope: 'AuthToken', + collection: collection, + searchManager: searchManager, + }); + }, this); + }, + + userInterface: function () { + var model = this.getSettingsModel(); + + model.once('sync', function () { + model.id = '1'; + this.main('Edit', { + model: model, + views: { + header: {template: 'admin.settings.header-user-interface'}, + body: {view: 'Admin.UserInterface'}, + }, + }); + }, this); + model.fetch(); + }, + + authentication: function () { + var model = this.getSettingsModel(); + + model.once('sync', function () { + model.id = '1'; + this.main('Edit', { + model: model, + views: { + header: {template: 'admin.settings.header-authentication'}, + body: {view: 'Admin.Authentication'}, + }, + }); + }, this); + model.fetch(); + }, + + integrations: function (options) { + var integration = options.name || null; + + this.main('Admin.Integrations.Index', {integration: integration}); + }, + + extensions: function (options) { + this.main('Admin.Extensions.Index'); + }, + + rebuild: function (options) { + var master = this.get('master'); + Espo.Ui.notify(master.translate('Please wait...')); + this.getRouter().navigate('#Admin'); + $.ajax({ + url: 'Admin/rebuild', + success: function () { + var msg = master.translate('Rebuild has been done', 'labels', 'Admin'); + Espo.Ui.success(msg); + }.bind(this) + }); + }, + + clearCache: function (options) { + var master = this.get('master'); + Espo.Ui.notify(master.translate('Please wait...')); + this.getRouter().navigate('#Admin'); + $.ajax({ + url: 'Admin/clearCache', + success: function () { + var msg = master.translate('Cache has been cleared', 'labels', 'Admin'); + Espo.Ui.success(msg); + }.bind(this) + }); + }, + }); + }); diff --git a/frontend/client/src/controllers/base.js b/frontend/client/src/controllers/base.js index 20368c9222..9e19c509ef 100644 --- a/frontend/client/src/controllers/base.js +++ b/frontend/client/src/controllers/base.js @@ -20,46 +20,46 @@ ************************************************************************/ Espo.define('Controllers.Base', 'Controller', function (Dep) { - return Dep.extend({ + return Dep.extend({ - login: function () { - this.entire('Login', {}, function (login) { - login.render(); - login.on('login', function (data) { - this.trigger('login', data); - }.bind(this)); - }.bind(this)); - }, + login: function () { + this.entire('Login', {}, function (login) { + login.render(); + login.on('login', function (data) { + this.trigger('login', data); + }.bind(this)); + }.bind(this)); + }, - logout: function () { - this.trigger('logout'); - }, - - clearCache: function (options) { - var cache = this.getCache(); - if (cache) { - cache.clear(); - this.getRouter().navigateBack(); - window.location.reload(); - } else { - Espo.Ui.notify('Cache is not enabled', 'error', 3000); - this.getRouter().navigateBack(); - } - }, + logout: function () { + this.trigger('logout'); + }, + + clearCache: function (options) { + var cache = this.getCache(); + if (cache) { + cache.clear(); + this.getRouter().navigateBack(); + window.location.reload(); + } else { + Espo.Ui.notify('Cache is not enabled', 'error', 3000); + this.getRouter().navigateBack(); + } + }, - error404: function () { - this.entire('Base', {template: 'errors.404'}, function (view) { - view.render(); - }); - }, + error404: function () { + this.entire('Base', {template: 'errors.404'}, function (view) { + view.render(); + }); + }, - error403: function () { - this.entire('Base', {template: 'errors.403'}, function (view) { - view.render(); - }); - }, - + error403: function () { + this.entire('Base', {template: 'errors.403'}, function (view) { + view.render(); + }); + }, + - }); + }); }); diff --git a/frontend/client/src/controllers/external-account.js b/frontend/client/src/controllers/external-account.js index e05b4bbc02..045a535663 100644 --- a/frontend/client/src/controllers/external-account.js +++ b/frontend/client/src/controllers/external-account.js @@ -20,34 +20,34 @@ ************************************************************************/ Espo.define('Controllers.ExternalAccount', 'Controller', function (Dep) { - - return Dep.extend({ - - defaultAction: 'list', - - list: function (options) { - this.collectionFactory.create('ExternalAccount', function (collection) { - collection.once('sync', function () { - this.main('ExternalAccount.Index', { - collection: collection, - }); - }, this); - collection.fetch(); - }, this); - }, - - edit: function (options) { - var id = options.id; - - this.collectionFactory.create('ExternalAccount', function (collection) { - collection.once('sync', function () { - this.main('ExternalAccount.Index', { - collection: collection, - id: id - }); - }, this); - collection.fetch(); - }, this); - }, - }); + + return Dep.extend({ + + defaultAction: 'list', + + list: function (options) { + this.collectionFactory.create('ExternalAccount', function (collection) { + collection.once('sync', function () { + this.main('ExternalAccount.Index', { + collection: collection, + }); + }, this); + collection.fetch(); + }, this); + }, + + edit: function (options) { + var id = options.id; + + this.collectionFactory.create('ExternalAccount', function (collection) { + collection.once('sync', function () { + this.main('ExternalAccount.Index', { + collection: collection, + id: id + }); + }, this); + collection.fetch(); + }, this); + }, + }); }); diff --git a/frontend/client/src/controllers/home.js b/frontend/client/src/controllers/home.js index 570de7eca1..2a0eda0832 100644 --- a/frontend/client/src/controllers/home.js +++ b/frontend/client/src/controllers/home.js @@ -20,21 +20,21 @@ ************************************************************************/ Espo.define('Controllers.Home', 'Controller', function (Dep) { - return Dep.extend({ + return Dep.extend({ - index: function () { - this.main('Home', null); - }, + index: function () { + this.main('Home', null); + }, - search: function (text) { - $.ajax({ - url: 'search', - type: 'GET', - data: { - text: text - }, - }); - }, - }); + search: function (text) { + $.ajax({ + url: 'search', + type: 'GET', + data: { + text: text + }, + }); + }, + }); }); diff --git a/frontend/client/src/controllers/import.js b/frontend/client/src/controllers/import.js index 05c167e87c..521235a637 100644 --- a/frontend/client/src/controllers/import.js +++ b/frontend/client/src/controllers/import.js @@ -19,20 +19,20 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Controllers.Import', 'Controller', function (Dep) { - - return Dep.extend({ - - checkAccess: function () { - if (this.getUser().isAdmin()) { - return true; - } - return false; - }, - - index: function () { - this.main('Import.Index', null); - }, - - }); - + + return Dep.extend({ + + checkAccess: function () { + if (this.getUser().isAdmin()) { + return true; + } + return false; + }, + + index: function () { + this.main('Import.Index', null); + }, + + }); + }); diff --git a/frontend/client/src/controllers/page.js b/frontend/client/src/controllers/page.js index 5292beb212..99b598c726 100644 --- a/frontend/client/src/controllers/page.js +++ b/frontend/client/src/controllers/page.js @@ -20,12 +20,12 @@ ************************************************************************/ Espo.define('Controllers.Page', 'Controller', function (Dep) { - return Dep.extend({ - - view: function (options) { - var page = options.id; - this.main(null, {template: 'pages.' + Espo.Utils.convert(page, 'c-h')}); - - } - }); + return Dep.extend({ + + view: function (options) { + var page = options.id; + this.main(null, {template: 'pages.' + Espo.Utils.convert(page, 'c-h')}); + + } + }); }); diff --git a/frontend/client/src/controllers/preferences.js b/frontend/client/src/controllers/preferences.js index 6532bb9453..5e36dd44b0 100644 --- a/frontend/client/src/controllers/preferences.js +++ b/frontend/client/src/controllers/preferences.js @@ -20,30 +20,30 @@ ************************************************************************/ Espo.define('Controllers.Preferences', 'Controllers.Record', function (Dep) { - - return Dep.extend({ - - defaultAction: 'own', - - getModel: function (callback) { - var model = new Espo['Models.Preferences'](); - model.settings = this.getConfig(); - model.defs = this.getMetadata().get('entityDefs.Preferences'); - callback.call(this, model); - }, - - checkAccess: function (action) { - return true; - }, - - own: function () { - this.edit({ - id: this.getUser().id - }); - }, - - list: function () {}, - }); + + return Dep.extend({ + + defaultAction: 'own', + + getModel: function (callback) { + var model = new Espo['Models.Preferences'](); + model.settings = this.getConfig(); + model.defs = this.getMetadata().get('entityDefs.Preferences'); + callback.call(this, model); + }, + + checkAccess: function (action) { + return true; + }, + + own: function () { + this.edit({ + id: this.getUser().id + }); + }, + + list: function () {}, + }); }); diff --git a/frontend/client/src/controllers/record.js b/frontend/client/src/controllers/record.js index 86bcbb3360..898361957c 100644 --- a/frontend/client/src/controllers/record.js +++ b/frontend/client/src/controllers/record.js @@ -20,211 +20,211 @@ ************************************************************************/ Espo.define('Controllers.Record', 'Controller', function (Dep) { - return Dep.extend({ + return Dep.extend({ - viewMap: null, + viewMap: null, - defaultAction: 'list', - - checkAccess: function (action) { - if (this.getUser().isAdmin()) { - return true; - } - if (this.getAcl().check(this.name, action)) { - return true; - } - return false; - }, + defaultAction: 'list', + + checkAccess: function (action) { + if (this.getUser().isAdmin()) { + return true; + } + if (this.getAcl().check(this.name, action)) { + return true; + } + return false; + }, - initialize: function () { - this.viewMap = this.viewMap || {}; - this.viewsMap = this.viewsMap || {}; - }, + initialize: function () { + this.viewMap = this.viewMap || {}; + this.viewsMap = this.viewsMap || {}; + }, - getViewName: function (type) { - return this.viewMap[type] || this.getMetadata().get('clientDefs.' + this.name + '.views.' + type) || Espo.Utils.upperCaseFirst(type); - }, + getViewName: function (type) { + return this.viewMap[type] || this.getMetadata().get('clientDefs.' + this.name + '.views.' + type) || Espo.Utils.upperCaseFirst(type); + }, - getViews: function (type) { - var views = {}; - var recordView = this.getMetadata().get('clientDefs.' + this.name + '.recordViews.' + type); - if (recordView) { - if (!views.body) { - views.body = {}; - } - views.body.view = recordView; - } - return views; - }, - - beforeList: function () { - this.handleCheckAccess('read'); - }, + getViews: function (type) { + var views = {}; + var recordView = this.getMetadata().get('clientDefs.' + this.name + '.recordViews.' + type); + if (recordView) { + if (!views.body) { + views.body = {}; + } + views.body.view = recordView; + } + return views; + }, + + beforeList: function () { + this.handleCheckAccess('read'); + }, - list: function (options) { - this.getCollection(function (collection) { + list: function (options) { + this.getCollection(function (collection) { - this.main(this.getViewName('list'), { - scope: this.name, - collection: collection, - }); - }); - }, - - beforeView: function () { - this.handleCheckAccess('read'); - }, + this.main(this.getViewName('list'), { + scope: this.name, + collection: collection, + }); + }); + }, + + beforeView: function () { + this.handleCheckAccess('read'); + }, - view: function (options) { - var id = options.id; - - var createView = function (model) { - this.main(this.getViewName('detail'), { - scope: this.name, - model: model, - views: this.getViews('detail'), - }); - }.bind(this); - - if ('model' in options) { - var model = options.model; - createView(model); - - model.once('sync', function () { - this.hideLoadingNotification(); - }, this); - this.showLoadingNotification(); - model.fetch(); - } else { - this.getModel(function (model) { - model.id = id; - - this.showLoadingNotification(); - model.once('sync', function () { - createView(model); - }, this); - model.fetch({main: true}); - }); - } - }, - - beforeCreate: function () { - this.handleCheckAccess('edit'); - }, + view: function (options) { + var id = options.id; + + var createView = function (model) { + this.main(this.getViewName('detail'), { + scope: this.name, + model: model, + views: this.getViews('detail'), + }); + }.bind(this); + + if ('model' in options) { + var model = options.model; + createView(model); + + model.once('sync', function () { + this.hideLoadingNotification(); + }, this); + this.showLoadingNotification(); + model.fetch(); + } else { + this.getModel(function (model) { + model.id = id; + + this.showLoadingNotification(); + model.once('sync', function () { + createView(model); + }, this); + model.fetch({main: true}); + }); + } + }, + + beforeCreate: function () { + this.handleCheckAccess('edit'); + }, - create: function (options) { - options = options || {}; - this.getModel(function (model) { - model.populateDefaults(); - if (options.relate) { - model.setRelate(options.relate); - } - if (options.attributes) { - model.set(options.attributes) - } + create: function (options) { + options = options || {}; + this.getModel(function (model) { + model.populateDefaults(); + if (options.relate) { + model.setRelate(options.relate); + } + if (options.attributes) { + model.set(options.attributes) + } - this.main(this.getViewName('edit'), { - scope: this.name, - model: model, - returnUrl: options.returnUrl, - views: this.getViews('edit'), - }); - }); - }, - - beforeCreate: function () { - this.handleCheckAccess('edit'); - }, + this.main(this.getViewName('edit'), { + scope: this.name, + model: model, + returnUrl: options.returnUrl, + views: this.getViews('edit'), + }); + }); + }, + + beforeCreate: function () { + this.handleCheckAccess('edit'); + }, - edit: function (options) { - var id = options.id; + edit: function (options) { + var id = options.id; - this.getModel(function (model) { - model.id = id; - - this.showLoadingNotification(); - model.once('sync', function () { + this.getModel(function (model) { + model.id = id; + + this.showLoadingNotification(); + model.once('sync', function () { - if (options.attributes) { - model.set(options.attributes) - } - - this.main(this.getViewName('edit'), { - scope: this.name, - model: model, - returnUrl: options.returnUrl, - views: this.getViews('edit'), - }); - }, this); - model.fetch({main: true}); - }); - }, - - beforeMerge: function () { - this.handleCheckAccess('edit'); - }, + if (options.attributes) { + model.set(options.attributes) + } + + this.main(this.getViewName('edit'), { + scope: this.name, + model: model, + returnUrl: options.returnUrl, + views: this.getViews('edit'), + }); + }, this); + model.fetch({main: true}); + }); + }, + + beforeMerge: function () { + this.handleCheckAccess('edit'); + }, - merge: function (options) { - var ids = options.ids.split(','); + merge: function (options) { + var ids = options.ids.split(','); - this.getModel(function (model) { - var models = []; + this.getModel(function (model) { + var models = []; - var proceed = function () { - this.main('Merge', { - models: models, - scope: this.name - }); - }.bind(this); + var proceed = function () { + this.main('Merge', { + models: models, + scope: this.name + }); + }.bind(this); - var i = 0; - ids.forEach(function (id) { - var current = model.clone(); - current.id = id; - models.push(current); - current.once('sync', function () { - i++; - if (i == ids.length) { - proceed(); - } - }); - current.fetch(); - }.bind(this)); - }.bind(this)); - }, + var i = 0; + ids.forEach(function (id) { + var current = model.clone(); + current.id = id; + models.push(current); + current.once('sync', function () { + i++; + if (i == ids.length) { + proceed(); + } + }); + current.fetch(); + }.bind(this)); + }.bind(this)); + }, - /** - * Get collection for the current controller. - * @param {Espo.Collection}. - */ - getCollection: function (callback, context) { - context = context || this; - - if (!this.name) { - throw new Error('No collection for unnamed controller'); - } - var collectionName = this.name; - this.collectionFactory.create(collectionName, function (collection) { - callback.call(context, collection); - }, context); - }, + /** + * Get collection for the current controller. + * @param {Espo.Collection}. + */ + getCollection: function (callback, context) { + context = context || this; + + if (!this.name) { + throw new Error('No collection for unnamed controller'); + } + var collectionName = this.name; + this.collectionFactory.create(collectionName, function (collection) { + callback.call(context, collection); + }, context); + }, - /** - * Get model for the current controller. - * @param {Espo.Model}. - */ - getModel: function (callback, context) { - context = context || this; - - if (!this.name) { - throw new Error('No collection for unnamed controller'); - } - var modelName = this.name; - this.modelFactory.create(modelName, function (model) { - callback.call(context, model); - }, context); - }, - }); + /** + * Get model for the current controller. + * @param {Espo.Model}. + */ + getModel: function (callback, context) { + context = context || this; + + if (!this.name) { + throw new Error('No collection for unnamed controller'); + } + var modelName = this.name; + this.modelFactory.create(modelName, function (model) { + callback.call(context, model); + }, context); + }, + }); }); diff --git a/frontend/client/src/controllers/role.js b/frontend/client/src/controllers/role.js index caee4e6aeb..397d9004e2 100644 --- a/frontend/client/src/controllers/role.js +++ b/frontend/client/src/controllers/role.js @@ -19,16 +19,16 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Controllers.Role', 'Controllers.Record', function (Dep) { - - return Dep.extend({ - - checkAccess: function () { - if (this.getUser().isAdmin()) { - return true; - } - return false; - }, + + return Dep.extend({ + + checkAccess: function () { + if (this.getUser().isAdmin()) { + return true; + } + return false; + }, - }); - + }); + }); diff --git a/frontend/client/src/controllers/team.js b/frontend/client/src/controllers/team.js index bba16575ed..5437461424 100644 --- a/frontend/client/src/controllers/team.js +++ b/frontend/client/src/controllers/team.js @@ -19,18 +19,18 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Controllers.Team', 'Controllers.Record', function (Dep) { - - return Dep.extend({ - - checkAccess: function (action) { - if (action == 'read') { - return true; - } - if (this.getUser().isAdmin()) { - return true; - } - } - - }); + + return Dep.extend({ + + checkAccess: function (action) { + if (action == 'read') { + return true; + } + if (this.getUser().isAdmin()) { + return true; + } + } + + }); }); diff --git a/frontend/client/src/controllers/user.js b/frontend/client/src/controllers/user.js index fcff05529a..e415ebe1d8 100644 --- a/frontend/client/src/controllers/user.js +++ b/frontend/client/src/controllers/user.js @@ -20,8 +20,8 @@ ************************************************************************/ Espo.define('Controllers.User', 'Controllers.Record', function (Dep) { - - return Dep.extend({ + + return Dep.extend({ - }); + }); }); diff --git a/frontend/client/src/date-time.js b/frontend/client/src/date-time.js index 45a789194b..609000ec1a 100644 --- a/frontend/client/src/date-time.js +++ b/frontend/client/src/date-time.js @@ -25,161 +25,161 @@ Espo.DateTime = function () { _.extend(Espo.DateTime.prototype, { - internalDateFormat: 'YYYY-MM-DD', + internalDateFormat: 'YYYY-MM-DD', - internalDateTimeFormat: 'YYYY-MM-DD HH:mm', + internalDateTimeFormat: 'YYYY-MM-DD HH:mm', - dateFormat: 'MM/DD/YYYY', + dateFormat: 'MM/DD/YYYY', - timeFormat: 'HH:mm', + timeFormat: 'HH:mm', - timeZone: null, + timeZone: null, - weekStart: 1, + weekStart: 1, - hasMeridian: function () { - return (new RegExp('A', 'i')).test(this.timeFormat); - }, - - getDateFormat: function () { - return this.dateFormat; - }, + hasMeridian: function () { + return (new RegExp('A', 'i')).test(this.timeFormat); + }, + + getDateFormat: function () { + return this.dateFormat; + }, - getDateTimeFormat: function () { - return this.dateFormat + ' ' + this.timeFormat; - }, + getDateTimeFormat: function () { + return this.dateFormat + ' ' + this.timeFormat; + }, - fromDisplayDate: function (string) { - if (!string) { - return null; - } - var m = moment(string, this.dateFormat); - if (!m.isValid()) { - return -1; - } - return m.format(this.internalDateFormat); - }, + fromDisplayDate: function (string) { + if (!string) { + return null; + } + var m = moment(string, this.dateFormat); + if (!m.isValid()) { + return -1; + } + return m.format(this.internalDateFormat); + }, - toDisplayDate: function (string) { - if (!string || (typeof string != 'string')) { - return ''; - } - - var m = moment(string, this.internalDateFormat); - if (!m.isValid()) { - return ''; - } - - return m.format(this.dateFormat); - }, + toDisplayDate: function (string) { + if (!string || (typeof string != 'string')) { + return ''; + } + + var m = moment(string, this.internalDateFormat); + if (!m.isValid()) { + return ''; + } + + return m.format(this.dateFormat); + }, - fromDisplay: function (string) { - if (!string) { - return null; - } - var m; - if (this.timeZone) { - m = moment.tz(string, this.getDateTimeFormat(), this.timeZone).utc(); - } else { - m = moment.utc(string, this.getDateTimeFormat()); - } - - if (!m.isValid()) { - return -1; - } - return m.format(this.internalDateTimeFormat) + ':00'; - }, + fromDisplay: function (string) { + if (!string) { + return null; + } + var m; + if (this.timeZone) { + m = moment.tz(string, this.getDateTimeFormat(), this.timeZone).utc(); + } else { + m = moment.utc(string, this.getDateTimeFormat()); + } + + if (!m.isValid()) { + return -1; + } + return m.format(this.internalDateTimeFormat) + ':00'; + }, - toDisplay: function (string) { - if (!string) { - return ''; - } - return this.toMoment(string).format(this.getDateTimeFormat()); - }, - - getNowMoment: function () { - var m = moment(); - if (this.timeZone) { - m = m.tz(this.timeZone); - } - return m; - }, + toDisplay: function (string) { + if (!string) { + return ''; + } + return this.toMoment(string).format(this.getDateTimeFormat()); + }, + + getNowMoment: function () { + var m = moment(); + if (this.timeZone) { + m = m.tz(this.timeZone); + } + return m; + }, - toMoment: function (string) { - var m = moment.utc(string, this.internalDateTimeFormat); - if (this.timeZone) { - m = m.tz(this.timeZone); - } - return m; - }, + toMoment: function (string) { + var m = moment.utc(string, this.internalDateTimeFormat); + if (this.timeZone) { + m = m.tz(this.timeZone); + } + return m; + }, - fromIso: function (string) { - if (!string) { - return ''; - } - var m = moment(string).utc(); - return m.format(this.internalDateTimeFormat); - }, + fromIso: function (string) { + if (!string) { + return ''; + } + var m = moment(string).utc(); + return m.format(this.internalDateTimeFormat); + }, - toIso: function (string) { - if (!string) { - return null; - } - return this.toMoment(string).format(); - }, + toIso: function (string) { + if (!string) { + return null; + } + return this.toMoment(string).format(); + }, - getToday: function () { - return moment.utc().format(this.internalDateFormat); - }, + getToday: function () { + return moment.utc().format(this.internalDateFormat); + }, - getNow: function (multiplicity) { - if (!multiplicity) { - return moment.utc().format(this.internalDateTimeFormat); - } else { - var unix = moment().unix(); - unix = unix - (unix % (multiplicity * 60)); - return moment.unix(unix).utc().format(this.internalDateTimeFormat); - } - }, + getNow: function (multiplicity) { + if (!multiplicity) { + return moment.utc().format(this.internalDateTimeFormat); + } else { + var unix = moment().unix(); + unix = unix - (unix % (multiplicity * 60)); + return moment.unix(unix).utc().format(this.internalDateTimeFormat); + } + }, - setSettingsAndPreferences: function (settings, preferences) { - - if (settings.has('dateFormat')) { - this.dateFormat = settings.get('dateFormat'); - } - if (settings.has('timeFormat')) { - this.timeFormat = settings.get('timeFormat'); - } - if (settings.has('timeZone')) { - this.timeZone = settings.get('timeZone') || null; - if (this.timeZone == 'UTC') { - this.timeZone = null; - } - } - if (settings.has('weekStart')) { - this.weekStart = settings.get('weekStart'); - } - - preferences.on('change', function (model) { - this.dateFormat = model.get('dateFormat'); - this.timeFormat = model.get('timeFormat'); - this.timeZone = model.get('timeZone'); - this.weekStart = model.get('weekStart'); - if (this.timeZone == 'UTC') { - this.timeZone = null; - } - }, this); - }, - - setLanguage: function (language) { - moment.lang('en', { - months: language.translate('monthNames', 'lists'), - monthsShort: language.translate('monthNamesShort', 'lists'), - weekdays: language.translate('dayNames', 'lists'), - weekdaysShort: language.translate('dayNamesShort', 'lists'), - weekdaysMin: language.translate('dayNamesMin', 'lists'), - }); - moment.lang('en'); - }, + setSettingsAndPreferences: function (settings, preferences) { + + if (settings.has('dateFormat')) { + this.dateFormat = settings.get('dateFormat'); + } + if (settings.has('timeFormat')) { + this.timeFormat = settings.get('timeFormat'); + } + if (settings.has('timeZone')) { + this.timeZone = settings.get('timeZone') || null; + if (this.timeZone == 'UTC') { + this.timeZone = null; + } + } + if (settings.has('weekStart')) { + this.weekStart = settings.get('weekStart'); + } + + preferences.on('change', function (model) { + this.dateFormat = model.get('dateFormat'); + this.timeFormat = model.get('timeFormat'); + this.timeZone = model.get('timeZone'); + this.weekStart = model.get('weekStart'); + if (this.timeZone == 'UTC') { + this.timeZone = null; + } + }, this); + }, + + setLanguage: function (language) { + moment.lang('en', { + months: language.translate('monthNames', 'lists'), + monthsShort: language.translate('monthNamesShort', 'lists'), + weekdays: language.translate('dayNames', 'lists'), + weekdaysShort: language.translate('dayNamesShort', 'lists'), + weekdaysMin: language.translate('dayNamesMin', 'lists'), + }); + moment.lang('en'); + }, }); diff --git a/frontend/client/src/exceptions.js b/frontend/client/src/exceptions.js index 7d1b6b4cc8..e30b2538f1 100644 --- a/frontend/client/src/exceptions.js +++ b/frontend/client/src/exceptions.js @@ -22,15 +22,15 @@ Espo.Exceptions = Espo.Exceptions || {}; Espo.Exceptions.AccessDenied = function (message) { - this.message = message; - Error.apply(this, arguments); + this.message = message; + Error.apply(this, arguments); } Espo.Exceptions.AccessDenied.prototype = new Error(); -Espo.Exceptions.AccessDenied.prototype.name = 'AccessDenied'; +Espo.Exceptions.AccessDenied.prototype.name = 'AccessDenied'; Espo.Exceptions.NotFound = function (message) { - this.message = message; - Error.apply(this, arguments); + this.message = message; + Error.apply(this, arguments); } Espo.Exceptions.NotFound.prototype = new Error(); Espo.Exceptions.NotFound.prototype.name = 'NotFound'; diff --git a/frontend/client/src/field-manager.js b/frontend/client/src/field-manager.js index d000e1f702..2356ab901f 100644 --- a/frontend/client/src/field-manager.js +++ b/frontend/client/src/field-manager.js @@ -20,121 +20,121 @@ ************************************************************************/ Espo.FieldManager = function (defs, metadata) { - this.defs = defs; - this.metadata = metadata; + this.defs = defs; + this.metadata = metadata; }; _.extend(Espo.FieldManager.prototype, { - defs: null, - - metadata: null, + defs: null, + + metadata: null, - getParams: function (fieldType) { - if (fieldType in this.defs) { - return this.defs[fieldType].params || []; - } - return []; - }, - - checkFilter: function (fieldType) { - if (fieldType in this.defs) { - if ('filter' in this.defs[fieldType]) { - return this.defs[fieldType].filter; - } else { - return false; - } - } - return false; - }, - - isMergable: function (fieldType) { - if (fieldType in this.defs) { - if ('mergable' in this.defs[fieldType]) { - return this.defs[fieldType].mergable; - } else { - return true; - } - } - return false; - }, - - getEntityAttributes: function (entityName) { - var list = []; - - var defs = this.metadata.get('entityDefs.' + entityName + '.fields') || {}; - Object.keys(defs).forEach(function (field) { - this.getAttributes(defs[field]['type'], field).forEach(function (attr) { - if (!~list.indexOf(attr)) { - list.push(attr); - } - }); - }, this); - return list; - }, + getParams: function (fieldType) { + if (fieldType in this.defs) { + return this.defs[fieldType].params || []; + } + return []; + }, + + checkFilter: function (fieldType) { + if (fieldType in this.defs) { + if ('filter' in this.defs[fieldType]) { + return this.defs[fieldType].filter; + } else { + return false; + } + } + return false; + }, + + isMergable: function (fieldType) { + if (fieldType in this.defs) { + if ('mergable' in this.defs[fieldType]) { + return this.defs[fieldType].mergable; + } else { + return true; + } + } + return false; + }, + + getEntityAttributes: function (entityName) { + var list = []; + + var defs = this.metadata.get('entityDefs.' + entityName + '.fields') || {}; + Object.keys(defs).forEach(function (field) { + this.getAttributes(defs[field]['type'], field).forEach(function (attr) { + if (!~list.indexOf(attr)) { + list.push(attr); + } + }); + }, this); + return list; + }, - getActualAttributes: function (fieldType, fieldName) { - var fieldNames = []; - if (fieldType in this.defs) { - if ('actualFields' in this.defs[fieldType]) { - var actualfFields = this.defs[fieldType].actualFields; + getActualAttributes: function (fieldType, fieldName) { + var fieldNames = []; + if (fieldType in this.defs) { + if ('actualFields' in this.defs[fieldType]) { + var actualfFields = this.defs[fieldType].actualFields; - var naming = 'suffix'; - if ('naming' in this.defs[fieldType]) { - naming = this.defs[fieldType].naming; - } - if (naming == 'prefix') { - actualfFields.forEach(function (f) { - fieldNames.push(f + Espo.Utils.upperCaseFirst(fieldName)); - }); - } else { - actualfFields.forEach(function (f) { - fieldNames.push(fieldName + Espo.Utils.upperCaseFirst(f)); - }); - } - } else { - fieldNames.push(fieldName); - } - } - return fieldNames; - }, + var naming = 'suffix'; + if ('naming' in this.defs[fieldType]) { + naming = this.defs[fieldType].naming; + } + if (naming == 'prefix') { + actualfFields.forEach(function (f) { + fieldNames.push(f + Espo.Utils.upperCaseFirst(fieldName)); + }); + } else { + actualfFields.forEach(function (f) { + fieldNames.push(fieldName + Espo.Utils.upperCaseFirst(f)); + }); + } + } else { + fieldNames.push(fieldName); + } + } + return fieldNames; + }, - getNotActualAttributes: function (fieldType, fieldName) { - var fieldNames = []; - if (fieldType in this.defs) { - if ('notActualFields' in this.defs[fieldType]) { - var notActualFields = this.defs[fieldType].notActualFields; + getNotActualAttributes: function (fieldType, fieldName) { + var fieldNames = []; + if (fieldType in this.defs) { + if ('notActualFields' in this.defs[fieldType]) { + var notActualFields = this.defs[fieldType].notActualFields; - var naming = 'suffix'; - if ('naming' in this.defs[fieldType]) { - naming = this.defs[fieldType].naming; - } - if (naming == 'prefix') { - notActualFields.forEach(function (f) { - fieldNames.push(f + Espo.Utils.upperCaseFirst(fieldName)); - }); - } else { - notActualFields.forEach(function (f) { - fieldNames.push(fieldName + Espo.Utils.upperCaseFirst(f)); - }); - } - } - } - return fieldNames; - }, + var naming = 'suffix'; + if ('naming' in this.defs[fieldType]) { + naming = this.defs[fieldType].naming; + } + if (naming == 'prefix') { + notActualFields.forEach(function (f) { + fieldNames.push(f + Espo.Utils.upperCaseFirst(fieldName)); + }); + } else { + notActualFields.forEach(function (f) { + fieldNames.push(fieldName + Espo.Utils.upperCaseFirst(f)); + }); + } + } + } + return fieldNames; + }, - getAttributes: function (fieldType, fieldName) { - return _.union(this.getActualAttributes(fieldType, fieldName), this.getNotActualAttributes(fieldType, fieldName)); - }, + getAttributes: function (fieldType, fieldName) { + return _.union(this.getActualAttributes(fieldType, fieldName), this.getNotActualAttributes(fieldType, fieldName)); + }, - getViewName: function (fieldType) { - if (fieldType in this.defs) { - if ('view' in this.defs[fieldType]) { - return this.defs[fieldType].view; - } - } - return 'Fields.' + Espo.Utils.upperCaseFirst(fieldType); - }, + getViewName: function (fieldType) { + if (fieldType in this.defs) { + if ('view' in this.defs[fieldType]) { + return this.defs[fieldType].view; + } + } + return 'Fields.' + Espo.Utils.upperCaseFirst(fieldType); + }, }); diff --git a/frontend/client/src/language.js b/frontend/client/src/language.js index b571c3606f..078a9e7592 100644 --- a/frontend/client/src/language.js +++ b/frontend/client/src/language.js @@ -20,109 +20,109 @@ ************************************************************************/ Espo.Language = function (cache) { - this.cache = cache || null; - this.data = {}; + this.cache = cache || null; + this.data = {}; }; _.extend(Espo.Language.prototype, { - data: null, + data: null, - cache: null, - - url: 'I18n', - - has: function (name, category, scope) { - if (scope in this.data) { - if (category in this.data[scope]) { - if (name in this.data[scope][category]) { - return true; - } - } - } - }, + cache: null, + + url: 'I18n', + + has: function (name, category, scope) { + if (scope in this.data) { + if (category in this.data[scope]) { + if (name in this.data[scope][category]) { + return true; + } + } + } + }, - get: function (scope, category, name) { - if (scope in this.data) { - if (category in this.data[scope]) { - if (name in this.data[scope][category]) { - return this.data[scope][category][name]; - } - } - } - if (scope == 'Global') { - return name; - } - return false; - }, + get: function (scope, category, name) { + if (scope in this.data) { + if (category in this.data[scope]) { + if (name in this.data[scope][category]) { + return this.data[scope][category][name]; + } + } + } + if (scope == 'Global') { + return name; + } + return false; + }, - translate: function (name, category, scope) { - scope = scope || 'Global'; - category = category || 'labels'; - var res = this.get(scope, category, name); - if (res === false && scope != 'Global') { - res = this.get('Global', category, name); - } - return res; - }, - - translateOption: function (value, field, scope) { - var translation = this.translate(field, 'options', scope); - if (typeof translation != 'object') { - translation = {}; - } - return translation[value] || value; - }, - - loadFromCache: function () { - - if (this.cache) { - var cached = this.cache.get('app', 'language'); - if (cached) { - this.data = cached; - return true; - } - } - return null; - }, - - clearCache: function () { - if (this.cache) { - this.cache.clear('app', 'language'); - } - }, - - storeToCache: function () { - if (this.cache) { - this.cache.set('app', 'language', this.data); - } - }, - - load: function (callback, sync) { - var sync = (typeof sync == 'undefined') ? true: sync; - this.once('sync', callback); - if (!this.loadFromCache()) { - this.fetch(sync); - return; - } - this.trigger('sync'); - }, + translate: function (name, category, scope) { + scope = scope || 'Global'; + category = category || 'labels'; + var res = this.get(scope, category, name); + if (res === false && scope != 'Global') { + res = this.get('Global', category, name); + } + return res; + }, + + translateOption: function (value, field, scope) { + var translation = this.translate(field, 'options', scope); + if (typeof translation != 'object') { + translation = {}; + } + return translation[value] || value; + }, + + loadFromCache: function () { + + if (this.cache) { + var cached = this.cache.get('app', 'language'); + if (cached) { + this.data = cached; + return true; + } + } + return null; + }, + + clearCache: function () { + if (this.cache) { + this.cache.clear('app', 'language'); + } + }, + + storeToCache: function () { + if (this.cache) { + this.cache.set('app', 'language', this.data); + } + }, + + load: function (callback, sync) { + var sync = (typeof sync == 'undefined') ? true: sync; + this.once('sync', callback); + if (!this.loadFromCache()) { + this.fetch(sync); + return; + } + this.trigger('sync'); + }, - fetch: function (sync) { - var self = this; - $.ajax({ - url: this.url, - type: 'GET', - dataType: 'JSON', - async: !(sync || false), - success: function (data) { - self.data = data; - self.storeToCache(); - self.trigger('sync'); - } - }); - }, - + fetch: function (sync) { + var self = this; + $.ajax({ + url: this.url, + type: 'GET', + dataType: 'JSON', + async: !(sync || false), + success: function (data) { + self.data = data; + self.storeToCache(); + self.trigger('sync'); + } + }); + }, + }, Backbone.Events); diff --git a/frontend/client/src/layout-manager.js b/frontend/client/src/layout-manager.js index 95233c92af..95b8ff95c5 100644 --- a/frontend/client/src/layout-manager.js +++ b/frontend/client/src/layout-manager.js @@ -20,92 +20,92 @@ ************************************************************************/ Espo.LayoutManager = function (options) { - var options = options || {}; - this.cache = options.cache || null; - this.data = {}; - this.ajax = $.ajax; + var options = options || {}; + this.cache = options.cache || null; + this.data = {}; + this.ajax = $.ajax; } _.extend(Espo.LayoutManager.prototype, { - cache: null, - - data: null, - - _getKey: function (controller, type) { - return controller + '-' + type; - }, - - _getUrl: function (controller, type) { - return controller + '/layout/' + type; - }, + cache: null, + + data: null, + + _getKey: function (controller, type) { + return controller + '-' + type; + }, + + _getUrl: function (controller, type) { + return controller + '/layout/' + type; + }, - get: function (controller, type, callback, cache) { - if (typeof cache == 'undefined') { - cache = true; - } - - var key = this._getKey(controller, type); - - if (cache) { - if (key in this.data) { - if (typeof callback === 'function') { - callback(this.data[key]); - } - return; - } - } - - if (this.cache !== null && cache) { - var cached = this.cache.get('app-layout', key); - if (cached) { - if (typeof callback === 'function') { - callback(cached); - } - this.data[key] = cached; - return; - } - } + get: function (controller, type, callback, cache) { + if (typeof cache == 'undefined') { + cache = true; + } + + var key = this._getKey(controller, type); + + if (cache) { + if (key in this.data) { + if (typeof callback === 'function') { + callback(this.data[key]); + } + return; + } + } + + if (this.cache !== null && cache) { + var cached = this.cache.get('app-layout', key); + if (cached) { + if (typeof callback === 'function') { + callback(cached); + } + this.data[key] = cached; + return; + } + } - this.ajax({ - url: this._getUrl(controller, type), - type: 'GET', - dataType: 'json', - success: function (layout) { - if (typeof callback === 'function') { - callback(layout); - } - this.data[key] = layout; - if (this.cache !== null) { - this.cache.set('app-layout', key, layout); - } - }.bind(this), - /*error: function () { - console.error('Could not load layout ' + controller + '#' + type); - },*/ - }); - }, - - set: function (controller, type, layout, callback) { - var key = this._getKey(controller, type); + this.ajax({ + url: this._getUrl(controller, type), + type: 'GET', + dataType: 'json', + success: function (layout) { + if (typeof callback === 'function') { + callback(layout); + } + this.data[key] = layout; + if (this.cache !== null) { + this.cache.set('app-layout', key, layout); + } + }.bind(this), + /*error: function () { + console.error('Could not load layout ' + controller + '#' + type); + },*/ + }); + }, + + set: function (controller, type, layout, callback) { + var key = this._getKey(controller, type); - this.ajax({ - url: this._getUrl(controller, type), - type: 'PUT', - data: JSON.stringify(layout), - success: function () { - if (this.cache !== null) { - this.cache.set('app-layout', key, layout); - } - this.data[key] = layout; - this.trigger('sync'); - if (typeof callback === 'function') { - callback(); - } - }.bind(this) - }); - }, - + this.ajax({ + url: this._getUrl(controller, type), + type: 'PUT', + data: JSON.stringify(layout), + success: function () { + if (this.cache !== null) { + this.cache.set('app-layout', key, layout); + } + this.data[key] = layout; + this.trigger('sync'); + if (typeof callback === 'function') { + callback(); + } + }.bind(this) + }); + }, + }, Backbone.Events); diff --git a/frontend/client/src/loader.js b/frontend/client/src/loader.js index 39a225f2bf..495ce54bbe 100644 --- a/frontend/client/src/loader.js +++ b/frontend/client/src/loader.js @@ -21,321 +21,321 @@ (function (Espo, _, $) { - var root = this; + var root = this; - Espo.Loader = function (cache) { - this.cache = cache || null; - this._loadCallbacks = {}; - - this.pathsBeingLoaded = {}; - - this.libsConfig = {}; - } + Espo.Loader = function (cache) { + this.cache = cache || null; + this._loadCallbacks = {}; + + this.pathsBeingLoaded = {}; + + this.libsConfig = {}; + } - _.extend(Espo.Loader.prototype, { + _.extend(Espo.Loader.prototype, { - cache: null, + cache: null, - data: null, + data: null, - godClass: Espo, + godClass: Espo, - _loadCallbacks: null, - - libsConfigUrl: 'client/cfg/libs.json', + _loadCallbacks: null, + + libsConfigUrl: 'client/cfg/libs.json', - _getClass: function (name) { - if (name in this.godClass) { - return this.godClass[name]; - } - return false; - }, + _getClass: function (name) { + if (name in this.godClass) { + return this.godClass[name]; + } + return false; + }, - _setClass: function (name, o) { - this.godClass[name] = o; - }, + _setClass: function (name, o) { + this.godClass[name] = o; + }, - _nameToPath: function (name) { - var path; - if (name.indexOf(':') != -1) { - var arr = name.split(':'); - var name = arr[1]; - var mod = arr[0]; - if (mod == 'Custom') { - path = 'client/custom/src/' + Espo.Utils.convert(name, 'C-h').split('.').join('/'); - } else { - path = 'client/modules/' + Espo.Utils.convert(mod, 'C-h') + '/src/' + Espo.Utils.convert(name, 'C-h').split('.').join('/'); - } - } else { - path = 'client/src/' + Espo.Utils.convert(name, 'C-h').split('.').join('/'); - } - path += '.js'; - return path; - }, + _nameToPath: function (name) { + var path; + if (name.indexOf(':') != -1) { + var arr = name.split(':'); + var name = arr[1]; + var mod = arr[0]; + if (mod == 'Custom') { + path = 'client/custom/src/' + Espo.Utils.convert(name, 'C-h').split('.').join('/'); + } else { + path = 'client/modules/' + Espo.Utils.convert(mod, 'C-h') + '/src/' + Espo.Utils.convert(name, 'C-h').split('.').join('/'); + } + } else { + path = 'client/src/' + Espo.Utils.convert(name, 'C-h').split('.').join('/'); + } + path += '.js'; + return path; + }, - _execute: function (script) { - eval.call(root, script); - }, + _execute: function (script) { + eval.call(root, script); + }, - _executeLoadCallback: function (subject, o) { - if (subject in this._loadCallbacks) { - this._loadCallbacks[subject].forEach(function (callback) { - callback(o); - }); - delete this._loadCallbacks[subject]; - } - }, + _executeLoadCallback: function (subject, o) { + if (subject in this._loadCallbacks) { + this._loadCallbacks[subject].forEach(function (callback) { + callback(o); + }); + delete this._loadCallbacks[subject]; + } + }, - define: function (subject, dependency, callback) { - var self = this; - var proceed = function (relObj) { - var o = callback.apply(this, arguments); - if (!o) { - if (self.cache) { - self.cache.clear('script', name); - } - throw new Error("Could not load '" + subject + "'"); - } - self._setClass(subject, o); - self._executeLoadCallback(subject, o); - }; + define: function (subject, dependency, callback) { + var self = this; + var proceed = function (relObj) { + var o = callback.apply(this, arguments); + if (!o) { + if (self.cache) { + self.cache.clear('script', name); + } + throw new Error("Could not load '" + subject + "'"); + } + self._setClass(subject, o); + self._executeLoadCallback(subject, o); + }; - if (!dependency) { - proceed(); - } else { - this.require(dependency, function () { - proceed.apply(this, arguments); - }); - } - }, + if (!dependency) { + proceed(); + } else { + this.require(dependency, function () { + proceed.apply(this, arguments); + }); + } + }, - require: function (subject, callback) { - if (Object.prototype.toString.call(subject) === '[object Array]') { - var list = subject; - } else { - this.load(subject, callback); - return; - } - var totalCount = list.length; - var readyCount = 0; - var loaded = {}; + require: function (subject, callback) { + if (Object.prototype.toString.call(subject) === '[object Array]') { + var list = subject; + } else { + this.load(subject, callback); + return; + } + var totalCount = list.length; + var readyCount = 0; + var loaded = {}; - list.forEach(function (name) { - this.load(name, function (c) { - loaded[name] = c; - readyCount++; - if (readyCount == totalCount) { - var args = []; - for (var i in list) { - args.push(loaded[list[i]]); - } - callback.apply(this, args); - } - }); - }.bind(this)); - }, - - _addLoadCallback: function (name, callback) { - if (!(name in this._loadCallbacks)) { - this._loadCallbacks[name] = []; - } - this._loadCallbacks[name].push(callback); - }, - - dataLoaded: {}, - - load: function (name, callback, error) { - var dataType, type, path, fetchObject; - var realName = name; - - if (name.indexOf('lib!') === 0) { - dataType = 'script'; - type = 'lib'; - - realName = name.substr(4); - path = realName; - - var exportsTo = 'window'; - var exportsAs = realName; - - if (realName in this.libsConfig) { - path = this.libsConfig[realName].path || path; - exportsTo = this.libsConfig[realName].exportsTo || exportsTo; - exportsAs = this.libsConfig[realName].exportsAs || exportsAs; - } - - fetchObject = function (name, d) { - var from = root; - if (exportsTo == 'window') { - from = root; - } else { - exportsTo.split('.').forEach(function (item) { - from = from[item]; - }); - } - if (exportsAs in from) { - return from[exportsAs]; - } - } - - } else if (name.indexOf('res!') === 0) { - dataType = 'text'; - type = 'res'; - - realName = name.substr(4); - path = realName; - } else { - dataType = 'script'; - type = 'class'; - - if (!name || name == '') { - throw new Error("Can not load empty class name"); - } + list.forEach(function (name) { + this.load(name, function (c) { + loaded[name] = c; + readyCount++; + if (readyCount == totalCount) { + var args = []; + for (var i in list) { + args.push(loaded[list[i]]); + } + callback.apply(this, args); + } + }); + }.bind(this)); + }, + + _addLoadCallback: function (name, callback) { + if (!(name in this._loadCallbacks)) { + this._loadCallbacks[name] = []; + } + this._loadCallbacks[name].push(callback); + }, + + dataLoaded: {}, + + load: function (name, callback, error) { + var dataType, type, path, fetchObject; + var realName = name; + + if (name.indexOf('lib!') === 0) { + dataType = 'script'; + type = 'lib'; + + realName = name.substr(4); + path = realName; + + var exportsTo = 'window'; + var exportsAs = realName; + + if (realName in this.libsConfig) { + path = this.libsConfig[realName].path || path; + exportsTo = this.libsConfig[realName].exportsTo || exportsTo; + exportsAs = this.libsConfig[realName].exportsAs || exportsAs; + } + + fetchObject = function (name, d) { + var from = root; + if (exportsTo == 'window') { + from = root; + } else { + exportsTo.split('.').forEach(function (item) { + from = from[item]; + }); + } + if (exportsAs in from) { + return from[exportsAs]; + } + } + + } else if (name.indexOf('res!') === 0) { + dataType = 'text'; + type = 'res'; + + realName = name.substr(4); + path = realName; + } else { + dataType = 'script'; + type = 'class'; + + if (!name || name == '') { + throw new Error("Can not load empty class name"); + } - var c = this._getClass(name); - if (c) { - callback(c); - return; - } + var c = this._getClass(name); + if (c) { + callback(c); + return; + } - path = this._nameToPath(name); - } - - if (name in this.dataLoaded) { - callback(this.dataLoaded[name]); - return; - } - - if (this.cache) { - var cached = this.cache.get(type, name); - if (cached) { - if (dataType == 'script') { - this._execute(cached); - } - if (type == 'class') { - var c = this._getClass(name); - if (c) { - callback(c); - return; - } - this._addLoadCallback(name, callback); - } else { - var d = cached; - if (typeof fetchObject == 'function') { - d = fetchObject(realName, cached); - } - this.dataLoaded[name] = d; - callback(d); - } - - return; - } - } - - if (path in this.pathsBeingLoaded) { - this._addLoadCallback(name, callback); - return; - } - this.pathsBeingLoaded[path] = true; + path = this._nameToPath(name); + } + + if (name in this.dataLoaded) { + callback(this.dataLoaded[name]); + return; + } + + if (this.cache) { + var cached = this.cache.get(type, name); + if (cached) { + if (dataType == 'script') { + this._execute(cached); + } + if (type == 'class') { + var c = this._getClass(name); + if (c) { + callback(c); + return; + } + this._addLoadCallback(name, callback); + } else { + var d = cached; + if (typeof fetchObject == 'function') { + d = fetchObject(realName, cached); + } + this.dataLoaded[name] = d; + callback(d); + } + + return; + } + } + + if (path in this.pathsBeingLoaded) { + this._addLoadCallback(name, callback); + return; + } + this.pathsBeingLoaded[path] = true; - $.ajax({ - type: 'GET', - cache: false, - dataType: dataType, - local: true, - url: path, - success: function (response) { - if (this.cache) { - this.cache.set(type, name, response); - } + $.ajax({ + type: 'GET', + cache: false, + dataType: dataType, + local: true, + url: path, + success: function (response) { + if (this.cache) { + this.cache.set(type, name, response); + } - this._addLoadCallback(name, callback); - - if (dataType == 'script') { - this._execute(response); - } - - if (type == 'class') { - // TODO remove this and use define for all classes - var c = this._getClass(name); - if (c && typeof c === 'function') { - this._executeLoadCallback(name, c); - } - } else { - var d = response; - if (typeof fetchObject == 'function') { - d = fetchObject(realName, response); - } - this.dataLoaded[name] = d; - this._executeLoadCallback(name, d); - } - return; - }.bind(this), - error: function () { - if (typeof error == 'function') { - error(); - } - throw new Error("Could not load file '" + path + "'"); - } - }); - }, - - - loadLib: function (url, callback) { - if (this.cache) { - var script = this.cache.get('script', url); - if (script) { - this._execute(script); - if (typeof callback == 'function') { - callback(); - } - return; - } - } - - $.ajax({ - url: url, - type: 'GET', - dataType: 'script', - local: true, - success: function () { - if (typeof callback == 'function') { - callback(); - } - }, - error: function () { - throw new Error("Could not load file '" + url + "'"); - }, - }); - - }, - - loadLibsConfig: function (callback) { - $.ajax({ - url: this.libsConfigUrl, - dataType: 'json', - local: true, - success: function (data) { - this.libsConfig = data; - callback(); - }.bind(this) - }); - }, - - addLibsConfig: function (data) { - this.libsConfig = _.extend(this.libsConfig, data); - }, - }); + this._addLoadCallback(name, callback); + + if (dataType == 'script') { + this._execute(response); + } + + if (type == 'class') { + // TODO remove this and use define for all classes + var c = this._getClass(name); + if (c && typeof c === 'function') { + this._executeLoadCallback(name, c); + } + } else { + var d = response; + if (typeof fetchObject == 'function') { + d = fetchObject(realName, response); + } + this.dataLoaded[name] = d; + this._executeLoadCallback(name, d); + } + return; + }.bind(this), + error: function () { + if (typeof error == 'function') { + error(); + } + throw new Error("Could not load file '" + path + "'"); + } + }); + }, + + + loadLib: function (url, callback) { + if (this.cache) { + var script = this.cache.get('script', url); + if (script) { + this._execute(script); + if (typeof callback == 'function') { + callback(); + } + return; + } + } + + $.ajax({ + url: url, + type: 'GET', + dataType: 'script', + local: true, + success: function () { + if (typeof callback == 'function') { + callback(); + } + }, + error: function () { + throw new Error("Could not load file '" + url + "'"); + }, + }); + + }, + + loadLibsConfig: function (callback) { + $.ajax({ + url: this.libsConfigUrl, + dataType: 'json', + local: true, + success: function (data) { + this.libsConfig = data; + callback(); + }.bind(this) + }); + }, + + addLibsConfig: function (data) { + this.libsConfig = _.extend(this.libsConfig, data); + }, + }); - Espo.loader = new Espo.Loader(); - Espo.require = function (subject, callback) { - Espo.loader.require(subject, callback); - } - Espo.define = function (subject, dependency, callback) { - Espo.loader.define(subject, dependency, callback); - } - Espo.loadLib = function (url, callback) { - Espo.loader.loadLib(url, callback); - } + Espo.loader = new Espo.Loader(); + Espo.require = function (subject, callback) { + Espo.loader.require(subject, callback); + } + Espo.define = function (subject, dependency, callback) { + Espo.loader.define(subject, dependency, callback); + } + Espo.loadLib = function (url, callback) { + Espo.loader.loadLib(url, callback); + } }).call(this, Espo, _, $); diff --git a/frontend/client/src/metadata.js b/frontend/client/src/metadata.js index ba64fa69b0..ca6537c61e 100644 --- a/frontend/client/src/metadata.js +++ b/frontend/client/src/metadata.js @@ -20,83 +20,83 @@ ************************************************************************/ (function (Espo, _, $, Backbone) { - Espo.Metadata = function (cache) { - this.cache = cache || null; + Espo.Metadata = function (cache) { + this.cache = cache || null; - this.data = {}; - this.ajax = $.ajax; - } + this.data = {}; + this.ajax = $.ajax; + } - _.extend(Espo.Metadata.prototype, { + _.extend(Espo.Metadata.prototype, { - cache: null, + cache: null, - data: null, + data: null, - url: 'Metadata', + url: 'Metadata', - load: function (callback, sync) { - var sync = (typeof sync == 'undefined') ? false: sync; - this.off('sync'); - this.once('sync', callback); - if (!this.loadFromCache()) { - this.fetch(sync); - return; - } - this.trigger('sync'); - }, + load: function (callback, sync) { + var sync = (typeof sync == 'undefined') ? false: sync; + this.off('sync'); + this.once('sync', callback); + if (!this.loadFromCache()) { + this.fetch(sync); + return; + } + this.trigger('sync'); + }, - fetch: function (sync) { - var self = this; - this.ajax({ - url: this.url, - type: 'GET', - dataType: 'JSON', - async: !(sync || false), - success: function (data) { - self.data = data; - self.storeToCache(); - self.trigger('sync'); - } - }); - }, + fetch: function (sync) { + var self = this; + this.ajax({ + url: this.url, + type: 'GET', + dataType: 'JSON', + async: !(sync || false), + success: function (data) { + self.data = data; + self.storeToCache(); + self.trigger('sync'); + } + }); + }, - get: function (path, defaultValue) { - defaultValue = defaultValue || null; + get: function (path, defaultValue) { + defaultValue = defaultValue || null; - var pointer = this.data; - var arr = path.split('.'); - var result = defaultValue; - arr.forEach(function (key, i) { - if (!(key in pointer)) { - result = defaultValue; - return; - } - if (arr.length - 1 == i) { - result = pointer[key]; - } - pointer = pointer[key]; - }); - return result; - }, + var pointer = this.data; + var arr = path.split('.'); + var result = defaultValue; + arr.forEach(function (key, i) { + if (!(key in pointer)) { + result = defaultValue; + return; + } + if (arr.length - 1 == i) { + result = pointer[key]; + } + pointer = pointer[key]; + }); + return result; + }, - loadFromCache: function () { - if (this.cache) { - var cached = this.cache.get('app', 'metadata'); - if (cached) { - this.data = cached; - return true; - } - } - return null; - }, + loadFromCache: function () { + if (this.cache) { + var cached = this.cache.get('app', 'metadata'); + if (cached) { + this.data = cached; + return true; + } + } + return null; + }, - storeToCache: function () { - if (this.cache) { - this.cache.set('app', 'metadata', this.data); - } - }, + storeToCache: function () { + if (this.cache) { + this.cache.set('app', 'metadata', this.data); + } + }, - }, Backbone.Events); + }, Backbone.Events); }).call(this, Espo, _, $, Backbone); diff --git a/frontend/client/src/model-factory.js b/frontend/client/src/model-factory.js index c1669266e1..f14dd0d23a 100644 --- a/frontend/client/src/model-factory.js +++ b/frontend/client/src/model-factory.js @@ -19,53 +19,53 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ (function (Espo, _) { - - Espo.ModelFactory = function (loader, metadata, user) { - this.loader = loader; - this.metadata = metadata; - this.user = user; - - this.seeds = {}; - }; - - _.extend(Espo.ModelFactory.prototype, { - - loader: null, - - metadata: null, - - seeds: null, - - dateTime: null, - - user: null, - - create: function (name, callback, context) { - context = context || this; - this.getSeed(name, function (seed) { - var model = new seed(); - callback.call(context, model); - }.bind(this)); - }, - - getSeed: function (name, callback) { - if ('name' in this.seeds) { - callback(this.seeds[name]); - return; - } - - var className = this.metadata.get('clientDefs.' + name + '.model') || 'Model'; - - Espo.loader.load(className, function (modelClass) { - this.seeds[name] = modelClass.extend({ - name: name, - defs: this.metadata.get('entityDefs.' + name, {}), - dateTime: this.dateTime, - _user: this.user - }); - callback(this.seeds[name]); - }.bind(this)); - }, - }); - + + Espo.ModelFactory = function (loader, metadata, user) { + this.loader = loader; + this.metadata = metadata; + this.user = user; + + this.seeds = {}; + }; + + _.extend(Espo.ModelFactory.prototype, { + + loader: null, + + metadata: null, + + seeds: null, + + dateTime: null, + + user: null, + + create: function (name, callback, context) { + context = context || this; + this.getSeed(name, function (seed) { + var model = new seed(); + callback.call(context, model); + }.bind(this)); + }, + + getSeed: function (name, callback) { + if ('name' in this.seeds) { + callback(this.seeds[name]); + return; + } + + var className = this.metadata.get('clientDefs.' + name + '.model') || 'Model'; + + Espo.loader.load(className, function (modelClass) { + this.seeds[name] = modelClass.extend({ + name: name, + defs: this.metadata.get('entityDefs.' + name, {}), + dateTime: this.dateTime, + _user: this.user + }); + callback(this.seeds[name]); + }.bind(this)); + }, + }); + }).call(this, Espo, _); diff --git a/frontend/client/src/model-offline.js b/frontend/client/src/model-offline.js index 5420d35976..411c086c16 100644 --- a/frontend/client/src/model-offline.js +++ b/frontend/client/src/model-offline.js @@ -21,49 +21,49 @@ Espo.ModelOffline = Espo.Model.extend({ - name: null, + name: null, - cache: null, + cache: null, - _key: null, + _key: null, - initialize: function (attributes, options) { - options = options || {}; - Espo.Model.prototype.initialize.apply(this, arguments); - this._key = this.url = this.name; - this.cache = options.cache || null; - }, + initialize: function (attributes, options) { + options = options || {}; + Espo.Model.prototype.initialize.apply(this, arguments); + this._key = this.url = this.name; + this.cache = options.cache || null; + }, - load: function (sync) { - this.once('sync', function (model) { - model.storeToCache(); - }); + load: function (sync) { + this.once('sync', function (model) { + model.storeToCache(); + }); - this.fetch({ - async: !(sync || false) - }); - }, + this.fetch({ + async: !(sync || false) + }); + }, - loadFromCache: function () { - if (this.cache) { - var cached = this.cache.get('app', this._key); - if (cached) { - this.set(cached); - return true; - } - } - return null; - }, + loadFromCache: function () { + if (this.cache) { + var cached = this.cache.get('app', this._key); + if (cached) { + this.set(cached); + return true; + } + } + return null; + }, - storeToCache: function () { - if (this.cache) { - this.cache.set('app', this._key, this.toJSON()); - } - }, + storeToCache: function () { + if (this.cache) { + this.cache.set('app', this._key, this.toJSON()); + } + }, - isNew: function () { - return false; - }, + isNew: function () { + return false; + }, }); diff --git a/frontend/client/src/model.js b/frontend/client/src/model.js index 2c74dcc6e5..f344a9c5ca 100644 --- a/frontend/client/src/model.js +++ b/frontend/client/src/model.js @@ -20,175 +20,175 @@ ************************************************************************/ (function (Espo, _, Backbone) { - Espo.Model = Backbone.Model.extend({ + Espo.Model = Backbone.Model.extend({ - name: null, + name: null, - dateTime: null, + dateTime: null, - _user: null, - - defs: null, + _user: null, + + defs: null, - initialize: function () { - this.urlRoot = this.urlRoot || this.name; - - this.defs = this.defs || {}; - this.defs.fields = this.defs.fields || {}; - this.defs.links = this.defs.links || {}; + initialize: function () { + this.urlRoot = this.urlRoot || this.name; + + this.defs = this.defs || {}; + this.defs.fields = this.defs.fields || {}; + this.defs.links = this.defs.links || {}; - Backbone.Model.prototype.initialize.call(this); - }, - - url: function () { - var url = Backbone.Model.prototype.url.call(this); - return url; - }, - - isNew: function () { - return !this.id; - }, + Backbone.Model.prototype.initialize.call(this); + }, + + url: function () { + var url = Backbone.Model.prototype.url.call(this); + return url; + }, + + isNew: function () { + return !this.id; + }, - setDefs: function (defs) { - this.defs = defs || {}; - this.defs.fields = this.defs.fields || {}; - }, - - getClonedAttributes: function () { - var attributes = {}; - for (var name in this.attributes) { - // TODO maybe use cloneDeep method ??? - attributes[name] = Espo.Utils.cloneDeep(this.attributes[name]); - } - return attributes; - }, + setDefs: function (defs) { + this.defs = defs || {}; + this.defs.fields = this.defs.fields || {}; + }, + + getClonedAttributes: function () { + var attributes = {}; + for (var name in this.attributes) { + // TODO maybe use cloneDeep method ??? + attributes[name] = Espo.Utils.cloneDeep(this.attributes[name]); + } + return attributes; + }, - populateDefaults: function () { - var defaultHash = {}; - if ('fields' in this.defs) { - for (var field in this.defs.fields) { - var defaultValue = this.getFieldParam(field, 'default'); + populateDefaults: function () { + var defaultHash = {}; + if ('fields' in this.defs) { + for (var field in this.defs.fields) { + var defaultValue = this.getFieldParam(field, 'default'); - if (defaultValue != null) { - var defaultValue = this._getDefaultValue(defaultValue); - if (typeof defaultValue === 'object') { - defaultHash = _.extend(defaultHash, defaultValue); - } else { - defaultHash[field] = defaultValue; - } - } - } - } - - var user = this.getUser(); - if (user) { - if (this.hasField('assignedUser')) { - this.set('assignedUserId', this.getUser().id); - this.set('assignedUserName', this.getUser().get('name')); - } - var defaultTeamId = this.getUser().get('defaultTeamId'); - if (defaultTeamId) { - if (this.hasField('teams') && !this.getFieldParam('teams', 'default')) { - defaultHash['teamsIds'] = [defaultTeamId]; - defaultHash['teamsNames'] = {}; - defaultHash['teamsNames'][defaultTeamId] = this.getUser().get('defaultTeamName') - } - } - } - - this.set(defaultHash, {silent: true}); - }, + if (defaultValue != null) { + var defaultValue = this._getDefaultValue(defaultValue); + if (typeof defaultValue === 'object') { + defaultHash = _.extend(defaultHash, defaultValue); + } else { + defaultHash[field] = defaultValue; + } + } + } + } + + var user = this.getUser(); + if (user) { + if (this.hasField('assignedUser')) { + this.set('assignedUserId', this.getUser().id); + this.set('assignedUserName', this.getUser().get('name')); + } + var defaultTeamId = this.getUser().get('defaultTeamId'); + if (defaultTeamId) { + if (this.hasField('teams') && !this.getFieldParam('teams', 'default')) { + defaultHash['teamsIds'] = [defaultTeamId]; + defaultHash['teamsNames'] = {}; + defaultHash['teamsNames'][defaultTeamId] = this.getUser().get('defaultTeamName') + } + } + } + + this.set(defaultHash, {silent: true}); + }, - _getDefaultValue: function (defaultValue) { - if (typeof defaultValue == 'string' && defaultValue.indexOf('javascript:') === 0 ) { - var code = defaultValue.substring(11); - defaultValue = (new Function( "with(this) { " + code + "}")).call(this); - } - return defaultValue; - }, + _getDefaultValue: function (defaultValue) { + if (typeof defaultValue == 'string' && defaultValue.indexOf('javascript:') === 0 ) { + var code = defaultValue.substring(11); + defaultValue = (new Function( "with(this) { " + code + "}")).call(this); + } + return defaultValue; + }, - setRelate: function (data) { + setRelate: function (data) { - var setRelate = function (options) { - var link = options.link; - var model = options.model; - if (!link || !model) { - throw new Error('Bad related options'); - } - var type = this.defs.links[link].type; - switch (type) { - case 'belongsToParent': - this.set(link + 'Id', model.id); - this.set(link + 'Type', model.name); - this.set(link + 'Name', model.get('name')); - break; - case 'belongsTo': - this.set(link + 'Id', model.id); - this.set(link + 'Name', model.get('name')); - break; - case 'hasMany': - var ids = []; - ids.push(model.id); - var names = {}; - names[model.id] = model.get('name'); - this.set(link + 'Ids', ids); - this.set(link + 'Names', names); - break; - } - }.bind(this); - - if (Object.prototype.toString.call(data) === '[object Array]') { - data.forEach(function (options) { - setRelate(options); - }.bind(this)); - } else { - setRelate(data); - } - }, + var setRelate = function (options) { + var link = options.link; + var model = options.model; + if (!link || !model) { + throw new Error('Bad related options'); + } + var type = this.defs.links[link].type; + switch (type) { + case 'belongsToParent': + this.set(link + 'Id', model.id); + this.set(link + 'Type', model.name); + this.set(link + 'Name', model.get('name')); + break; + case 'belongsTo': + this.set(link + 'Id', model.id); + this.set(link + 'Name', model.get('name')); + break; + case 'hasMany': + var ids = []; + ids.push(model.id); + var names = {}; + names[model.id] = model.get('name'); + this.set(link + 'Ids', ids); + this.set(link + 'Names', names); + break; + } + }.bind(this); + + if (Object.prototype.toString.call(data) === '[object Array]') { + data.forEach(function (options) { + setRelate(options); + }.bind(this)); + } else { + setRelate(data); + } + }, - getFieldType: function (field) { - if (('defs' in this) && ('fields' in this.defs) && (field in this.defs.fields)) { - return this.defs.fields[field].type || null; - } - return null; - }, + getFieldType: function (field) { + if (('defs' in this) && ('fields' in this.defs) && (field in this.defs.fields)) { + return this.defs.fields[field].type || null; + } + return null; + }, - getFieldParam: function (field, param) { - if (('defs' in this) && ('fields' in this.defs) && (field in this.defs.fields)) { - if (param in this.defs.fields[field]) { - return this.defs.fields[field][param]; - } - } - return null; - }, + getFieldParam: function (field, param) { + if (('defs' in this) && ('fields' in this.defs) && (field in this.defs.fields)) { + if (param in this.defs.fields[field]) { + return this.defs.fields[field][param]; + } + } + return null; + }, - isFieldReadOnly: function (field) { - return this.getFieldParam(field, 'readOnly') || false; - }, + isFieldReadOnly: function (field) { + return this.getFieldParam(field, 'readOnly') || false; + }, - isRequired: function (field) { - return this.getFieldParam(field, 'required') || false; - }, + isRequired: function (field) { + return this.getFieldParam(field, 'required') || false; + }, - getTeamIds: function () { - return this.get('teamsIds') || []; - }, + getTeamIds: function () { + return this.get('teamsIds') || []; + }, - getDateTime: function () { - return this.dateTime; - }, + getDateTime: function () { + return this.dateTime; + }, - getUser: function () { - return this._user; - }, - - hasField: function (field) { - return ('defs' in this) && ('fields' in this.defs) && (field in this.defs.fields); - }, - - isEditable: function () { - return true; - }, - }); + getUser: function () { + return this._user; + }, + + hasField: function (field) { + return ('defs' in this) && ('fields' in this.defs) && (field in this.defs.fields); + }, + + isEditable: function () { + return true; + }, + }); }).call(this, Espo, _, Backbone); diff --git a/frontend/client/src/models/email.js b/frontend/client/src/models/email.js index 1930ae0a88..48d13f3cb1 100644 --- a/frontend/client/src/models/email.js +++ b/frontend/client/src/models/email.js @@ -19,9 +19,9 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Models.Email', 'Model', function (Dep) { - - return Dep.extend({ + + return Dep.extend({ - }); + }); }); diff --git a/frontend/client/src/models/preferences.js b/frontend/client/src/models/preferences.js index 700bc49542..cd2df08c6a 100644 --- a/frontend/client/src/models/preferences.js +++ b/frontend/client/src/models/preferences.js @@ -19,51 +19,51 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Models.Preferences', 'Model', function (Dep) { - - return Dep.extend({ - - name: "Preferences", - - settings: null, - - getTimeZoneOptions: function () { - if (this.settings) { - return this.settings.getFieldParam('timeZone', 'options'); - } - }, - - getLanguageOptions: function () { - if (this.settings) { - return this.settings.getFieldParam('language', 'options'); - } - }, - - getDefaultCurrencyOptions: function () { - if (this.settings) { - return this.settings.getDefaultCurrencyOptions(); - } - }, - - setDashletOptions: function (id, attributes) { - var value = this.get('dashletOptions') || {}; - value[id] = attributes; - this.set('dashletOptions', value); - }, - - getDashletOptions: function (id) { - var value = this.get('dashletOptions') || {}; - return value[id] || false; - }, - - unsetDashletOptions: function (id) { - var value = this.get('dashletOptions') || {}; - delete value[id]; - if (Object.getOwnPropertyNames(value).length == 0) { - value = null; - } - this.set('dashletOptions', value); - }, + + return Dep.extend({ + + name: "Preferences", + + settings: null, + + getTimeZoneOptions: function () { + if (this.settings) { + return this.settings.getFieldParam('timeZone', 'options'); + } + }, + + getLanguageOptions: function () { + if (this.settings) { + return this.settings.getFieldParam('language', 'options'); + } + }, + + getDefaultCurrencyOptions: function () { + if (this.settings) { + return this.settings.getDefaultCurrencyOptions(); + } + }, + + setDashletOptions: function (id, attributes) { + var value = this.get('dashletOptions') || {}; + value[id] = attributes; + this.set('dashletOptions', value); + }, + + getDashletOptions: function (id) { + var value = this.get('dashletOptions') || {}; + return value[id] || false; + }, + + unsetDashletOptions: function (id) { + var value = this.get('dashletOptions') || {}; + delete value[id]; + if (Object.getOwnPropertyNames(value).length == 0) { + value = null; + } + this.set('dashletOptions', value); + }, - }); + }); }); diff --git a/frontend/client/src/models/settings.js b/frontend/client/src/models/settings.js index c2ebf2678b..412b396c44 100644 --- a/frontend/client/src/models/settings.js +++ b/frontend/client/src/models/settings.js @@ -19,19 +19,19 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Models.Settings', 'ModelOffline', function (Dep) { - - return Dep.extend({ - - name: 'Settings', + + return Dep.extend({ + + name: 'Settings', - getDefaultCurrencyOptions: function () { - return this.get('currencyList') || []; - }, - - getBaseCurrencyOptions: function () { - return this.get('currencyList') || []; - }, + getDefaultCurrencyOptions: function () { + return this.get('currencyList') || []; + }, + + getBaseCurrencyOptions: function () { + return this.get('currencyList') || []; + }, - }); + }); }); diff --git a/frontend/client/src/models/user.js b/frontend/client/src/models/user.js index 5f44d1ac26..82ae0ecef6 100644 --- a/frontend/client/src/models/user.js +++ b/frontend/client/src/models/user.js @@ -19,36 +19,36 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Models.User', 'Model', function (Dep) { - - return Dep.extend({ - - name: "User", - - isAdmin: function () { - return this.get('isAdmin'); - }, + + return Dep.extend({ + + name: "User", + + isAdmin: function () { + return this.get('isAdmin'); + }, - isOwner: function (model) { - return this.id === model.get('assignedUserId') || this.id === model.get('createdById'); - }, + isOwner: function (model) { + return this.id === model.get('assignedUserId') || this.id === model.get('createdById'); + }, - inTeam: function (model) { - - var userTeamIds = this.getTeamIds(); + inTeam: function (model) { + + var userTeamIds = this.getTeamIds(); - if (model.name == 'Team') { - return (userTeamIds.indexOf(model.id) != -1); - } else { - var teamIds = model.getTeamIds(); - for (var i in userTeamIds) { - if (teamIds.indexOf(i) != -1) { - return true; - } - } - } - return false; - }, + if (model.name == 'Team') { + return (userTeamIds.indexOf(model.id) != -1); + } else { + var teamIds = model.getTeamIds(); + for (var i in userTeamIds) { + if (teamIds.indexOf(i) != -1) { + return true; + } + } + } + return false; + }, - }); + }); }); diff --git a/frontend/client/src/multi-collection.js b/frontend/client/src/multi-collection.js index 98d56aa25b..6de6618c2a 100644 --- a/frontend/client/src/multi-collection.js +++ b/frontend/client/src/multi-collection.js @@ -20,31 +20,31 @@ ************************************************************************/ (function (Espo, _,Backbone) { - Espo.MultiCollection = Espo.Collection.extend({ + Espo.MultiCollection = Espo.Collection.extend({ - /** - * @prop {Object} seeds Hash off model classes. - */ - seeds: null, + /** + * @prop {Object} seeds Hash off model classes. + */ + seeds: null, - initialize: function (models, options) { - options = options || {}; - - this.sortBy = options.sortBy || this.sortBy; - this.asc = ('asc' in options) ? options.asc : this.asc; - - Backbone.Collection.prototype.initialize.call(this); - }, + initialize: function (models, options) { + options = options || {}; + + this.sortBy = options.sortBy || this.sortBy; + this.asc = ('asc' in options) ? options.asc : this.asc; + + Backbone.Collection.prototype.initialize.call(this); + }, - parse: function (resp, options) { - this.total = resp.total; - return resp.list.map(function (attributes) { - var a = _.clone(attributes); - delete a['_scope']; - return new this.seeds[attributes._scope](a, options); - }.bind(this)); - }, + parse: function (resp, options) { + this.total = resp.total; + return resp.list.map(function (attributes) { + var a = _.clone(attributes); + delete a['_scope']; + return new this.seeds[attributes._scope](a, options); + }.bind(this)); + }, - }); + }); }).call(this, Espo, _, Backbone); diff --git a/frontend/client/src/pre-loader.js b/frontend/client/src/pre-loader.js index 12d3a7228d..700138faba 100644 --- a/frontend/client/src/pre-loader.js +++ b/frontend/client/src/pre-loader.js @@ -21,94 +21,94 @@ (function (Espo, _, $) { - Espo.PreLoader = function (cache, viewFactory) { - this.cache = cache; - this.viewFactory = viewFactory; - } + Espo.PreLoader = function (cache, viewFactory) { + this.cache = cache; + this.viewFactory = viewFactory; + } - _.extend(Espo.PreLoader.prototype, { + _.extend(Espo.PreLoader.prototype, { - configUrl: 'client/cfg/pre-load.json', + configUrl: 'client/cfg/pre-load.json', - cache: null, + cache: null, - viewFactory: null, + viewFactory: null, - load: function (callback, app) { + load: function (callback, app) { - var bar = $('
    ').prependTo('body');; - bar = bar.children(); - bar.css({ - 'transition': 'width .1s linear', - '-webkit-transition': 'width .1s linear' - }); + var bar = $('
    ').prependTo('body');; + bar = bar.children(); + bar.css({ + 'transition': 'width .1s linear', + '-webkit-transition': 'width .1s linear' + }); - var self = this; + var self = this; - var count = 0; - var countLoaded = 0; - var classesLoaded = 0; - var templatesLoaded = 0; - var layoutTypesLoaded = 0; + var count = 0; + var countLoaded = 0; + var classesLoaded = 0; + var templatesLoaded = 0; + var layoutTypesLoaded = 0; - var updateBar = function () { - var percents = countLoaded / count * 100; - bar.css('width', percents + '%').attr('aria-valuenow', percents); - } + var updateBar = function () { + var percents = countLoaded / count * 100; + bar.css('width', percents + '%').attr('aria-valuenow', percents); + } - var checkIfReady = function () { - if (countLoaded >= count) { - clearInterval(timer); - callback.call(app, app); - } - }; - var timer = setInterval(checkIfReady, 100); + var checkIfReady = function () { + if (countLoaded >= count) { + clearInterval(timer); + callback.call(app, app); + } + }; + var timer = setInterval(checkIfReady, 100); - var load = function (data) { - count = data.templates.length + data.layoutTypes.length+ data.classes.length; + var load = function (data) { + count = data.templates.length + data.layoutTypes.length+ data.classes.length; - var loadTemplates = function () { - data.templates.forEach(function (name) { - self.viewFactory._loader.load('template', name, function () { - layoutTypesLoaded++; - countLoaded++; - updateBar(); - }); - }); - } - var loadLayoutTypes = function () { - data.layoutTypes.forEach(function (name) { - self.viewFactory._loader.load('layoutTemplate', name, function () { - layoutTypesLoaded++; - countLoaded++; - updateBar(); - }); - }); - } - var loadClasses = function () { - data.classes.forEach(function (name) { - Espo.loader.load(name, function () { - classesLoaded++; - countLoaded++; - updateBar(); - }); - }); - } + var loadTemplates = function () { + data.templates.forEach(function (name) { + self.viewFactory._loader.load('template', name, function () { + layoutTypesLoaded++; + countLoaded++; + updateBar(); + }); + }); + } + var loadLayoutTypes = function () { + data.layoutTypes.forEach(function (name) { + self.viewFactory._loader.load('layoutTemplate', name, function () { + layoutTypesLoaded++; + countLoaded++; + updateBar(); + }); + }); + } + var loadClasses = function () { + data.classes.forEach(function (name) { + Espo.loader.load(name, function () { + classesLoaded++; + countLoaded++; + updateBar(); + }); + }); + } - loadTemplates(); - loadLayoutTypes(); - loadClasses(); - }; + loadTemplates(); + loadLayoutTypes(); + loadClasses(); + }; - $.ajax({ - url: this.configUrl, - dataType: 'json', - local: true, - success: function (data) { - load(data); - } - }); - } - }); + $.ajax({ + url: this.configUrl, + dataType: 'json', + local: true, + success: function (data) { + load(data); + } + }); + } + }); }).call(this, Espo, _, $); diff --git a/frontend/client/src/router.js b/frontend/client/src/router.js index eb813d2462..ac5bd7066d 100644 --- a/frontend/client/src/router.js +++ b/frontend/client/src/router.js @@ -20,128 +20,128 @@ ************************************************************************/ (function (Espo, _, Backbone) { - Espo.Router = Backbone.Router.extend({ + Espo.Router = Backbone.Router.extend({ - routes: { + routes: { - "logout": "logout", - - "clearCache": "clearCache", + "logout": "logout", + + "clearCache": "clearCache", - "search/:text": "search", + "search/:text": "search", - ":controller/view/:id/:options": "view", - ":controller/view/:id": "view", - ":controller/edit/:id/:options": "edit", - ":controller/edit/:id": "edit", - ":controller/create": "create", + ":controller/view/:id/:options": "view", + ":controller/view/:id": "view", + ":controller/edit/:id/:options": "edit", + ":controller/edit/:id": "edit", + ":controller/create": "create", - ":controller/:action/:options": "action", - ":controller/:action": "action", + ":controller/:action/:options": "action", + ":controller/:action": "action", - ":controller": "defaultAction", + ":controller": "defaultAction", - "*actions": "home", - }, + "*actions": "home", + }, - _last: null, + _last: null, - initialize: function () { - this.history = []; - this.on('route', function () { - this.history.push(Backbone.history.fragment); - }); - }, + initialize: function () { + this.history = []; + this.on('route', function () { + this.history.push(Backbone.history.fragment); + }); + }, - navigateBack: function (options) { - var url; - if (this.history.length > 1) { - url = this.history[this.history.length - 1]; - } else { - url = this.history[0]; - } - this.navigate(url, options); - }, + navigateBack: function (options) { + var url; + if (this.history.length > 1) { + url = this.history[this.history.length - 1]; + } else { + url = this.history[0]; + } + this.navigate(url, options); + }, - _parseOptionsParams: function (string) { - if (!string) { - return {}; - } + _parseOptionsParams: function (string) { + if (!string) { + return {}; + } - if (string.indexOf('&') === -1 && string.indexOf('=') === -1) { - return string; - } + if (string.indexOf('&') === -1 && string.indexOf('=') === -1) { + return string; + } - var options = {}; - if (typeof string !== 'undefined') { - string.split('&').forEach(function (item, i) { - var p = item.split('='); - options[p[0]] = true; - if (p.length > 1) { - options[p[0]] = p[1]; - } - }); - } - return options; - }, + var options = {}; + if (typeof string !== 'undefined') { + string.split('&').forEach(function (item, i) { + var p = item.split('='); + options[p[0]] = true; + if (p.length > 1) { + options[p[0]] = p[1]; + } + }); + } + return options; + }, - record: function (controller, action, id, options) { - var options = this._parseOptionsParams(options); - options.id = id; - this.dispatch(controller, action, options); - }, + record: function (controller, action, id, options) { + var options = this._parseOptionsParams(options); + options.id = id; + this.dispatch(controller, action, options); + }, - view: function (controller, id, options) { - this.record(controller, 'view', id, options); - }, + view: function (controller, id, options) { + this.record(controller, 'view', id, options); + }, - edit: function (controller, id, options) { - this.record(controller, 'edit', id, options); - }, + edit: function (controller, id, options) { + this.record(controller, 'edit', id, options); + }, - create: function (controller, options) { - this.record(controller, 'create', null, options); - }, + create: function (controller, options) { + this.record(controller, 'create', null, options); + }, - action: function (controller, action, options) { - this.dispatch(controller, action, this._parseOptionsParams(options)); - }, + action: function (controller, action, options) { + this.dispatch(controller, action, this._parseOptionsParams(options)); + }, - defaultAction: function (controller) { - this.dispatch(controller, null); - }, + defaultAction: function (controller) { + this.dispatch(controller, null); + }, - home: function () { - this.dispatch('Home', null); - }, + home: function () { + this.dispatch('Home', null); + }, - search: function (text) { - this.dispatch('Home', 'search', text); - }, + search: function (text) { + this.dispatch('Home', 'search', text); + }, - logout: function () { - this.dispatch(null, 'logout'); - this.navigate('', {trigger: false}); - }, - - clearCache: function () { - this.dispatch(null, 'clearCache'); - }, + logout: function () { + this.dispatch(null, 'logout'); + this.navigate('', {trigger: false}); + }, + + clearCache: function () { + this.dispatch(null, 'clearCache'); + }, - dispatch: function (controller, action, options) { - var o = { - controller: controller, - action: action, - options: options - } - this._last = o; - this.trigger('routed', o); - }, + dispatch: function (controller, action, options) { + var o = { + controller: controller, + action: action, + options: options + } + this._last = o; + this.trigger('routed', o); + }, - getLast: function () { - return this._last; - }, - }); + getLast: function () { + return this._last; + }, + }); }).call(this, Espo, _, Backbone); diff --git a/frontend/client/src/search-manager.js b/frontend/client/src/search-manager.js index ea1c4608d7..ee042c7fd6 100644 --- a/frontend/client/src/search-manager.js +++ b/frontend/client/src/search-manager.js @@ -20,181 +20,181 @@ ************************************************************************/ (function (Espo, _) { - Espo.SearchManager = function (collection, type, storage, dateTime, defaultData) { - this.collection = collection; - this.scope = collection.name; - this.storage = storage; - this.type = type || 'list'; - this.dateTime = dateTime; - - this.data = this.defaultData = defaultData || { - textFilter: '', - bool: {}, - advanced: {}, - }; - - this.sanitizeData(); - }; - - _.extend(Espo.SearchManager.prototype, { - - data: null, - - sanitizeData: function () { - if (!('advanced' in this.data)) { - this.data.advanced = {}; - } - if (!('bool' in this.data)) { - this.data.bool = {}; - } - if (!('textFilter' in this.data)) { - this.data.textFilter = ''; - } - }, - - getWhere: function () { - var where = []; - - if (this.data.textFilter && this.data.textFilter != '') { - where.push({ - type: 'textFilter', - value: this.data.textFilter - }); - } - - if (this.data.bool) { - var o = { - type: 'boolFilters', - value: [], - }; - for (var name in this.data.bool) { - if (this.data.bool[name]) { - o.value.push(name); - } - } - if (o.value.length) { - where.push(o); - } - } - - if (this.data.advanced) { - for (var name in this.data.advanced) { - var field = name; - var defs = this.data.advanced[name]; - - if (!defs) { - continue; - } - - - if ('where' in defs) { - where.push(defs.where); - } else { - if ('field' in defs) { - field = defs.field; - } - var type = defs.type; - if (defs.dateTime) { - where.push(this.getDateTimeWhere(type, field, defs.value)); - } else { - value = defs.value; - where.push({ - type: type, - field: field, - value: value, - }); - } + Espo.SearchManager = function (collection, type, storage, dateTime, defaultData) { + this.collection = collection; + this.scope = collection.name; + this.storage = storage; + this.type = type || 'list'; + this.dateTime = dateTime; + + this.data = this.defaultData = defaultData || { + textFilter: '', + bool: {}, + advanced: {}, + }; + + this.sanitizeData(); + }; + + _.extend(Espo.SearchManager.prototype, { + + data: null, + + sanitizeData: function () { + if (!('advanced' in this.data)) { + this.data.advanced = {}; + } + if (!('bool' in this.data)) { + this.data.bool = {}; + } + if (!('textFilter' in this.data)) { + this.data.textFilter = ''; + } + }, + + getWhere: function () { + var where = []; + + if (this.data.textFilter && this.data.textFilter != '') { + where.push({ + type: 'textFilter', + value: this.data.textFilter + }); + } + + if (this.data.bool) { + var o = { + type: 'boolFilters', + value: [], + }; + for (var name in this.data.bool) { + if (this.data.bool[name]) { + o.value.push(name); + } + } + if (o.value.length) { + where.push(o); + } + } + + if (this.data.advanced) { + for (var name in this.data.advanced) { + var field = name; + var defs = this.data.advanced[name]; + + if (!defs) { + continue; + } + + + if ('where' in defs) { + where.push(defs.where); + } else { + if ('field' in defs) { + field = defs.field; + } + var type = defs.type; + if (defs.dateTime) { + where.push(this.getDateTimeWhere(type, field, defs.value)); + } else { + value = defs.value; + where.push({ + type: type, + field: field, + value: value, + }); + } - } - } - } - return where; - }, - - loadStored: function () { - this.data = this.storage.get(this.type + 'Search', this.scope) || _.clone(this.defaultData); - this.sanitizeData(); - return this; - }, - - get: function () { - return this.data; - }, - - setAdvanced: function (advanced) { - this.data.advanced = advanced; - }, - - set: function (data) { - this.data = data; - if (this.storage) { - this.storage.set(this.type + 'Search', this.scope, data); - } - }, - - reset: function () { - this.data = _.clone(this.defaultData); - if (this.storage) { - this.storage.clear(this.type + 'Search', this.scope); - } - }, - - getDateTimeWhere: function (type, field, value) { - var where = { - field: field - }; - if (!value && ~['on', 'before', 'after'].indexOf(type)) { - return null; - } - - switch (type) { - case 'today': - where.type = 'between'; - var start = this.dateTime.getNowMoment().startOf('day').utc(); - - var from = start.format(this.dateTime.internalDateTimeFormat); - var to = start.add('days', 1).format(this.dateTime.internalDateTimeFormat); - where.value = [from, to]; - break; - case 'past': - where.type = 'before'; - where.value = this.dateTime.getNowMoment().utc().format(this.dateTime.internalDateTimeFormat); - break; - case 'future': - where.type = 'after'; - where.value = this.dateTime.getNowMoment().utc().format(this.dateTime.internalDateTimeFormat); - break; - case 'on': - where.type = 'between'; - var start = moment(value, this.dateTime.internalDateFormat, this.timeZone).utc(); - - var from = start.format(this.dateTime.internalDateTimeFormat); - var to = start.add('days', 1).format(this.dateTime.internalDateTimeFormat); - - where.value = [from, to]; - break; - case 'before': - where.type = 'before'; - where.value = moment(value, this.dateTime.internalDateFormat, this.timeZone).utc().format(this.dateTime.internalDateTimeFormat); - break; - case 'after': - where.type = 'after'; - where.value = moment(value, this.dateTime.internalDateFormat, this.timeZone).utc().format(this.dateTime.internalDateTimeFormat); - break; - case 'between': - where.type = 'between'; - if (value[0] && value[1]) { - var from = moment(value[0], this.dateTime.internalDateFormat, this.timeZone).utc().format(this.dateTime.internalDateTimeFormat); - var to = moment(value[1], this.dateTime.internalDateFormat, this.timeZone).utc().format(this.dateTime.internalDateTimeFormat); - where.value = [from, to]; - } - break; - default: - where.type = type; - } - - return where; - }, - }); + } + } + } + return where; + }, + + loadStored: function () { + this.data = this.storage.get(this.type + 'Search', this.scope) || _.clone(this.defaultData); + this.sanitizeData(); + return this; + }, + + get: function () { + return this.data; + }, + + setAdvanced: function (advanced) { + this.data.advanced = advanced; + }, + + set: function (data) { + this.data = data; + if (this.storage) { + this.storage.set(this.type + 'Search', this.scope, data); + } + }, + + reset: function () { + this.data = _.clone(this.defaultData); + if (this.storage) { + this.storage.clear(this.type + 'Search', this.scope); + } + }, + + getDateTimeWhere: function (type, field, value) { + var where = { + field: field + }; + if (!value && ~['on', 'before', 'after'].indexOf(type)) { + return null; + } + + switch (type) { + case 'today': + where.type = 'between'; + var start = this.dateTime.getNowMoment().startOf('day').utc(); + + var from = start.format(this.dateTime.internalDateTimeFormat); + var to = start.add('days', 1).format(this.dateTime.internalDateTimeFormat); + where.value = [from, to]; + break; + case 'past': + where.type = 'before'; + where.value = this.dateTime.getNowMoment().utc().format(this.dateTime.internalDateTimeFormat); + break; + case 'future': + where.type = 'after'; + where.value = this.dateTime.getNowMoment().utc().format(this.dateTime.internalDateTimeFormat); + break; + case 'on': + where.type = 'between'; + var start = moment(value, this.dateTime.internalDateFormat, this.timeZone).utc(); + + var from = start.format(this.dateTime.internalDateTimeFormat); + var to = start.add('days', 1).format(this.dateTime.internalDateTimeFormat); + + where.value = [from, to]; + break; + case 'before': + where.type = 'before'; + where.value = moment(value, this.dateTime.internalDateFormat, this.timeZone).utc().format(this.dateTime.internalDateTimeFormat); + break; + case 'after': + where.type = 'after'; + where.value = moment(value, this.dateTime.internalDateFormat, this.timeZone).utc().format(this.dateTime.internalDateTimeFormat); + break; + case 'between': + where.type = 'between'; + if (value[0] && value[1]) { + var from = moment(value[0], this.dateTime.internalDateFormat, this.timeZone).utc().format(this.dateTime.internalDateTimeFormat); + var to = moment(value[1], this.dateTime.internalDateFormat, this.timeZone).utc().format(this.dateTime.internalDateTimeFormat); + where.value = [from, to]; + } + break; + default: + where.type = type; + } + + return where; + }, + }); }).call(this, Espo, _); diff --git a/frontend/client/src/storage.js b/frontend/client/src/storage.js index 10353f6b3e..40e856a42e 100644 --- a/frontend/client/src/storage.js +++ b/frontend/client/src/storage.js @@ -20,75 +20,75 @@ ************************************************************************/ (function (Espo, _) { - Espo.Storage = function () { - }; - - _.extend(Espo.Storage.prototype, { - - _prefix: 'espo', - - _composeFullPrefix: function (type) { - return this._prefix + '-' + type; - }, - - _composeKey: function (type, name) { - return this._composeFullPrefix(type) + '-' + name; - }, - - _checkType: function (type) { - if (typeof type === 'undefined' && toString.call(type) != '[object String]' || type == 'cache') { - throw new TypeError("Bad type \"" + type + "\" passed to Espo.Storage."); - } - }, - - get: function (type, name) { - this._checkType(type); - - var key = this._composeKey(type, name); - var stored = localStorage.getItem(key); - if (stored) { - var str = stored; - if (stored[0] == "{" || stored[0] == "[") { - try { - str = JSON.parse(stored); - } catch (error) { - str = stored; - } - stored = str; - } - return stored; - } - return null; - }, - - set: function (type, name, value) { - this._checkType(type); + Espo.Storage = function () { + }; + + _.extend(Espo.Storage.prototype, { + + _prefix: 'espo', + + _composeFullPrefix: function (type) { + return this._prefix + '-' + type; + }, + + _composeKey: function (type, name) { + return this._composeFullPrefix(type) + '-' + name; + }, + + _checkType: function (type) { + if (typeof type === 'undefined' && toString.call(type) != '[object String]' || type == 'cache') { + throw new TypeError("Bad type \"" + type + "\" passed to Espo.Storage."); + } + }, + + get: function (type, name) { + this._checkType(type); + + var key = this._composeKey(type, name); + var stored = localStorage.getItem(key); + if (stored) { + var str = stored; + if (stored[0] == "{" || stored[0] == "[") { + try { + str = JSON.parse(stored); + } catch (error) { + str = stored; + } + stored = str; + } + return stored; + } + return null; + }, + + set: function (type, name, value) { + this._checkType(type); - var key = this._composeKey(type, name); - if (value instanceof Object) { - value = JSON.stringify(value); - } - localStorage.setItem(key, value); - }, - - clear: function (type, name) { - var reText; - if (typeof type !== 'undefined') { - if (typeof name === 'undefined') { - reText = '^' + this._composeFullPrefix(type); - } else { - reText = '^' + this._composeKey(type, name); - } - } else { - reText = '^' + this._prefix + '-'; - } - var re = new RegExp(reText); - for (var i in localStorage) { - if (re.test(i)) { - delete localStorage[i]; - } - } - } - }); + var key = this._composeKey(type, name); + if (value instanceof Object) { + value = JSON.stringify(value); + } + localStorage.setItem(key, value); + }, + + clear: function (type, name) { + var reText; + if (typeof type !== 'undefined') { + if (typeof name === 'undefined') { + reText = '^' + this._composeFullPrefix(type); + } else { + reText = '^' + this._composeKey(type, name); + } + } else { + reText = '^' + this._prefix + '-'; + } + var re = new RegExp(reText); + for (var i in localStorage) { + if (re.test(i)) { + delete localStorage[i]; + } + } + } + }); }).call(this, Espo, _); diff --git a/frontend/client/src/ui.js b/frontend/client/src/ui.js index adbb0bd0c8..4b2fe35265 100644 --- a/frontend/client/src/ui.js +++ b/frontend/client/src/ui.js @@ -20,188 +20,188 @@ ************************************************************************/ (function (Espo, $) { - var Dialog = function (options) { - options = options || {}; - - this.className = 'dialog'; - this.backdrop = 'static'; - this.closeButton = true; - this.header = false; - this.body = ''; - this.width = false; - this.height = false; - this.buttons = []; - this.removeOnClose = true; - this.graggable = false; - this.container = 'body' - this.onRemove = function () {}; - - var params = ['className', 'backdrop', 'closeButton', 'header', 'body', 'width', 'height', 'buttons', 'removeOnClose', 'graggable', 'container', 'onRemove']; - params.forEach(function (param) { - if (param in options) { - this[param] = options[param]; - } - }.bind(this)); - - this.id = 'dialog-' + Math.floor((Math.random() * 100000)); - - this.contents = ''; - if (this.header) { - this.contents += ''; - } - - this.contents += ''; - - if (this.buttons.length) { - this.contents += '
    '; - this.buttons.forEach(function (o) { - this.contents += ' '; - }.bind(this)); - this.contents += '
    '; - } - - this.contents = '' - - $('
    ').attr('id', this.id) - .attr('class', this.className + ' modal') - .attr('role', 'dialog') - .attr('tabindex', '-1') - .html(this.contents) - .appendTo($(this.container)); - - this.$el = $('#' + this.id); - this.el = this.$el.get(0); - - this.$el.find('header a.close').on('click', function () { - this.close(); - }.bind(this)); - - this.buttons.forEach(function (o) { - if (typeof o.onClick == 'function') { - $('#' + this.id + ' button[data-name="' + o.name + '"]').on('click', function () { - o.onClick(this); - }.bind(this)); - } - }.bind(this)); - - if (this.graggable) { - this.$el.find('header').css('cursor', 'pointer'); - this.$el.draggable({ - handle: 'header', - }); - } - - var modalContentEl = this.$el.find('.modal-content'); - - if (this.width) { - modalContentEl.css('width', this.width); - modalContentEl.css('margin-left', '-' + (parseInt(this.width.replace('px', '')) / 5) + 'px'); - } - - if (this.removeOnClose) { - this.$el.on('hidden.bs.modal', function (e) { - if (this.$el.get(0) == e.target) { - this.remove(); - } - }.bind(this)); - } - - this.$el.on('show.bs.modal', function (event) { - var idx = $('.modal:visible').length; - $(this).css('z-index', 1040 + (10 * idx)); - }); - this.$el.on('shown.bs.modal', function (event) { - var idx = ($('.modal:visible').length) - 1; - $('.modal-backdrop').not('.stacked').css('z-index', 1039 + (10 * idx)); - $('.modal-backdrop').not('.stacked').addClass('stacked'); - }); - this.$el.on('hidden.bs.modal', function (event) { - if ($('.modal:visible').length > 0) { - setTimeout(function() { - $(document.body).addClass('modal-open'); - }, 0); - } - }); + var Dialog = function (options) { + options = options || {}; + + this.className = 'dialog'; + this.backdrop = 'static'; + this.closeButton = true; + this.header = false; + this.body = ''; + this.width = false; + this.height = false; + this.buttons = []; + this.removeOnClose = true; + this.graggable = false; + this.container = 'body' + this.onRemove = function () {}; + + var params = ['className', 'backdrop', 'closeButton', 'header', 'body', 'width', 'height', 'buttons', 'removeOnClose', 'graggable', 'container', 'onRemove']; + params.forEach(function (param) { + if (param in options) { + this[param] = options[param]; + } + }.bind(this)); + + this.id = 'dialog-' + Math.floor((Math.random() * 100000)); + + this.contents = ''; + if (this.header) { + this.contents += ''; + } + + this.contents += ''; + + if (this.buttons.length) { + this.contents += '
    '; + this.buttons.forEach(function (o) { + this.contents += ' '; + }.bind(this)); + this.contents += '
    '; + } + + this.contents = '' + + $('
    ').attr('id', this.id) + .attr('class', this.className + ' modal') + .attr('role', 'dialog') + .attr('tabindex', '-1') + .html(this.contents) + .appendTo($(this.container)); + + this.$el = $('#' + this.id); + this.el = this.$el.get(0); + + this.$el.find('header a.close').on('click', function () { + this.close(); + }.bind(this)); + + this.buttons.forEach(function (o) { + if (typeof o.onClick == 'function') { + $('#' + this.id + ' button[data-name="' + o.name + '"]').on('click', function () { + o.onClick(this); + }.bind(this)); + } + }.bind(this)); + + if (this.graggable) { + this.$el.find('header').css('cursor', 'pointer'); + this.$el.draggable({ + handle: 'header', + }); + } + + var modalContentEl = this.$el.find('.modal-content'); + + if (this.width) { + modalContentEl.css('width', this.width); + modalContentEl.css('margin-left', '-' + (parseInt(this.width.replace('px', '')) / 5) + 'px'); + } + + if (this.removeOnClose) { + this.$el.on('hidden.bs.modal', function (e) { + if (this.$el.get(0) == e.target) { + this.remove(); + } + }.bind(this)); + } + + this.$el.on('show.bs.modal', function (event) { + var idx = $('.modal:visible').length; + $(this).css('z-index', 1040 + (10 * idx)); + }); + this.$el.on('shown.bs.modal', function (event) { + var idx = ($('.modal:visible').length) - 1; + $('.modal-backdrop').not('.stacked').css('z-index', 1039 + (10 * idx)); + $('.modal-backdrop').not('.stacked').addClass('stacked'); + }); + this.$el.on('hidden.bs.modal', function (event) { + if ($('.modal:visible').length > 0) { + setTimeout(function() { + $(document.body).addClass('modal-open'); + }, 0); + } + }); - } - Dialog.prototype.show = function () { - this.$el.modal({ - backdrop: this.backdrop, - }); - - /*this.$el.css('z-index', 1200); - $('.modal-backdrop').css('z-index', 1100);*/ - }; - Dialog.prototype.close = function () { - this.$el.modal('hide'); - $(this).trigger('dialog:close'); - }; - Dialog.prototype.remove = function () { - this.onRemove(); - this.$el.remove(); - $(this).off(); - }; - - Espo.Ui = { - - Dialog: Dialog, - - dialog: function (options) { - return new Dialog(options); - }, - - notify: function (message, type, timeout, closeButton) { - $('#nofitication').remove(); - - if (message) { - type = type || 'warning'; - if (typeof closeButton == 'undefined') { - closeButton = false; - } - - if (type == 'error') { - type = 'danger'; - } - - var el = $('
    ').css({ - position: 'fixed', - top: '0px', - 'z-index': 2000, - }).html(message); - - if (closeButton) { - el.append(''); - } - - if (timeout) { - setTimeout(function () { - el.alert('close'); - }, timeout); - } - - el.appendTo('body'); - el.css("left", ($(window).width() - el.width()) / 2 + $(window).scrollLeft() + "px"); - } - }, - - warning: function (message) { - Espo.Ui.notify(message, 'warning', 2000); - }, - - success: function (message) { - Espo.Ui.notify(message, 'success', 2000); - }, - - error: function (message) { - Espo.Ui.notify(message, 'error', 2000); - }, - - info: function (message) { - Espo.Ui.notify(message, 'info', 2000); - }, - } + } + Dialog.prototype.show = function () { + this.$el.modal({ + backdrop: this.backdrop, + }); + + /*this.$el.css('z-index', 1200); + $('.modal-backdrop').css('z-index', 1100);*/ + }; + Dialog.prototype.close = function () { + this.$el.modal('hide'); + $(this).trigger('dialog:close'); + }; + Dialog.prototype.remove = function () { + this.onRemove(); + this.$el.remove(); + $(this).off(); + }; + + Espo.Ui = { + + Dialog: Dialog, + + dialog: function (options) { + return new Dialog(options); + }, + + notify: function (message, type, timeout, closeButton) { + $('#nofitication').remove(); + + if (message) { + type = type || 'warning'; + if (typeof closeButton == 'undefined') { + closeButton = false; + } + + if (type == 'error') { + type = 'danger'; + } + + var el = $('
    ').css({ + position: 'fixed', + top: '0px', + 'z-index': 2000, + }).html(message); + + if (closeButton) { + el.append(''); + } + + if (timeout) { + setTimeout(function () { + el.alert('close'); + }, timeout); + } + + el.appendTo('body'); + el.css("left", ($(window).width() - el.width()) / 2 + $(window).scrollLeft() + "px"); + } + }, + + warning: function (message) { + Espo.Ui.notify(message, 'warning', 2000); + }, + + success: function (message) { + Espo.Ui.notify(message, 'success', 2000); + }, + + error: function (message) { + Espo.Ui.notify(message, 'error', 2000); + }, + + info: function (message) { + Espo.Ui.notify(message, 'info', 2000); + }, + } }).call(this, Espo, $); diff --git a/frontend/client/src/utils.js b/frontend/client/src/utils.js index 46eeb09016..5c0105e997 100644 --- a/frontend/client/src/utils.js +++ b/frontend/client/src/utils.js @@ -20,135 +20,135 @@ ************************************************************************/ (function (Espo, _) { - Espo.Utils = { - - checkActionAccess: function (acl, model, item) { - var hasAccess = true; - if (item.acl) { - if (!item.aclScope) { - if (model) { - hasAccess = acl.checkModel(model, item.acl); - } else { - hasAccess = acl.check(item.scope, item.acl); - } - } else { - hasAccess = acl.check(item.aclScope, item.acl); - } - } - return hasAccess; - }, + Espo.Utils = { + + checkActionAccess: function (acl, model, item) { + var hasAccess = true; + if (item.acl) { + if (!item.aclScope) { + if (model) { + hasAccess = acl.checkModel(model, item.acl); + } else { + hasAccess = acl.check(item.scope, item.acl); + } + } else { + hasAccess = acl.check(item.aclScope, item.acl); + } + } + return hasAccess; + }, - convert: function (string, p) { - if (string == null) { - return string; - } + convert: function (string, p) { + if (string == null) { + return string; + } - var result = string; - switch (p) { - case 'c-h': - case 'C-h': - result = Espo.Utils.camelCaseToHyphen(string); - break; - case 'h-c': - result = Espo.Utils.hyphenToCamelCase(string); - break; - case 'h-C': - result = Espo.Utils.hyphenToUpperCamelCase(string); - break; - } - return result; - }, - - isObject: function (obj) { - if (obj === null) { - return false; - } - return typeof obj === 'object'; - }, - - clone: function (obj) { - if (!Espo.Utils.isObject(obj)) { - return obj; - } - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }, - - cloneDeep: function (data) { - data = Espo.Utils.clone(data); - - if (Espo.Utils.isObject(data) || _.isArray(data)) { - for (var i in data) { - data[i] = this.cloneDeep(data[i]); - } - } - return data; - }, + var result = string; + switch (p) { + case 'c-h': + case 'C-h': + result = Espo.Utils.camelCaseToHyphen(string); + break; + case 'h-c': + result = Espo.Utils.hyphenToCamelCase(string); + break; + case 'h-C': + result = Espo.Utils.hyphenToUpperCamelCase(string); + break; + } + return result; + }, + + isObject: function (obj) { + if (obj === null) { + return false; + } + return typeof obj === 'object'; + }, + + clone: function (obj) { + if (!Espo.Utils.isObject(obj)) { + return obj; + } + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }, + + cloneDeep: function (data) { + data = Espo.Utils.clone(data); + + if (Espo.Utils.isObject(data) || _.isArray(data)) { + for (var i in data) { + data[i] = this.cloneDeep(data[i]); + } + } + return data; + }, - /** - * Compose class name. - * @param {String} module - * @param {String} name - * @param {String} location - * @return {String} - */ - composeClassName: function (module, name, location) { - if (module) { - return module + ':' + location + '.' + name; - } else { - return location + '.' + name; - } - }, + /** + * Compose class name. + * @param {String} module + * @param {String} name + * @param {String} location + * @return {String} + */ + composeClassName: function (module, name, location) { + if (module) { + return module + ':' + location + '.' + name; + } else { + return location + '.' + name; + } + }, - composeViewClassName: function (name) { - if (name.indexOf(':') != -1) { - var arr = name.split(':'); - var modPart = arr[0]; - var namePart = arr[1]; - return modPart + ':' + 'Views' + '.' + namePart; - } else { - return 'Views' + '.' + name; - } - }, + composeViewClassName: function (name) { + if (name.indexOf(':') != -1) { + var arr = name.split(':'); + var modPart = arr[0]; + var namePart = arr[1]; + return modPart + ':' + 'Views' + '.' + namePart; + } else { + return 'Views' + '.' + name; + } + }, - toDom: function (string) { - return Espo.Utils.convert(string, 'c-h').split('.').join('-'); - }, + toDom: function (string) { + return Espo.Utils.convert(string, 'c-h').split('.').join('-'); + }, - upperCaseFirst: function (string) { - if (string == null) { - return string; - } - return string.charAt(0).toUpperCase() + string.slice(1); - }, + upperCaseFirst: function (string) { + if (string == null) { + return string; + } + return string.charAt(0).toUpperCase() + string.slice(1); + }, - hyphenToUpperCamelCase: function (string) { - if (string == null) { - return string; - } - return this.upperCaseFirst(string.replace(/-([a-z])/g, function (g) {return g[1].toUpperCase();})); - }, + hyphenToUpperCamelCase: function (string) { + if (string == null) { + return string; + } + return this.upperCaseFirst(string.replace(/-([a-z])/g, function (g) {return g[1].toUpperCase();})); + }, - hyphenToCamelCase: function (string) { - if (string == null) { - return string; - } - return string.replace(/-([a-z])/g, function (g) {return g[1].toUpperCase();}); - }, + hyphenToCamelCase: function (string) { + if (string == null) { + return string; + } + return string.replace(/-([a-z])/g, function (g) {return g[1].toUpperCase();}); + }, - camelCaseToHyphen: function (string) { - if (string == null) { - return string; - } - return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); - }, + camelCaseToHyphen: function (string) { + if (string == null) { + return string; + } + return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); + }, - trimSlash: function (str) { - if (str.substr(-1) == '/') { - return str.substr(0, str.length - 1); - } - return str; - } - }; + trimSlash: function (str) { + if (str.substr(-1) == '/') { + return str.substr(0, str.length - 1); + } + return str; + } + }; }).call(this, Espo, _); diff --git a/frontend/client/src/view-helper.js b/frontend/client/src/view-helper.js index 8571cfadd3..6d1c3e2153 100644 --- a/frontend/client/src/view-helper.js +++ b/frontend/client/src/view-helper.js @@ -21,200 +21,200 @@ (function (Espo, _, Handlebars) { - Espo.ViewHelper = function (options) { - this.urlRegex = /(^|[^\[])(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; - this._registerHandlebarsHelpers(); - - this.mdSearch = [ - /\("?(.*?)"?\)\[(.*?)\]/g, - /\&\#x60;(([\s\S]*?)\&\#x60;)/, - /(\*\*|__)(.*?)\1/, - /(\*|_)(.*?)\1/, - /\~\~(.*?)\~\~/ - ]; - this.mdReplace = [ - '$1', - '$2', - '$2', - '$2', - '$1', - ]; - - } + Espo.ViewHelper = function (options) { + this.urlRegex = /(^|[^\[])(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; + this._registerHandlebarsHelpers(); + + this.mdSearch = [ + /\("?(.*?)"?\)\[(.*?)\]/g, + /\&\#x60;(([\s\S]*?)\&\#x60;)/, + /(\*\*|__)(.*?)\1/, + /(\*|_)(.*?)\1/, + /\~\~(.*?)\~\~/ + ]; + this.mdReplace = [ + '$1', + '$2', + '$2', + '$2', + '$1', + ]; + + } - _.extend(Espo.ViewHelper.prototype, { + _.extend(Espo.ViewHelper.prototype, { - layoutManager: null, + layoutManager: null, - settings: null, + settings: null, - user: null, + user: null, - preferences: null, + preferences: null, - language: null, + language: null, - _registerHandlebarsHelpers: function () { - var self = this; + _registerHandlebarsHelpers: function () { + var self = this; - Handlebars.registerHelper('img', function (img) { - return new Handlebars.SafeString(""); - }); + Handlebars.registerHelper('img', function (img) { + return new Handlebars.SafeString(""); + }); - Handlebars.registerHelper('prop', function (object, name) { - if (name in object) { - return object[name]; - } - }); + Handlebars.registerHelper('prop', function (object, name) { + if (name in object) { + return object[name]; + } + }); - Handlebars.registerHelper('var', function (name, context, options) { - return new Handlebars.SafeString(context[name]); - }); + Handlebars.registerHelper('var', function (name, context, options) { + return new Handlebars.SafeString(context[name]); + }); - Handlebars.registerHelper('concat', function (left, right) { - return left + right; - }); + Handlebars.registerHelper('concat', function (left, right) { + return left + right; + }); - Handlebars.registerHelper('ifEqual', function (left, right, options) { - if (left == right) { - return options.fn(this); - } - return options.inverse(this); - }); + Handlebars.registerHelper('ifEqual', function (left, right, options) { + if (left == right) { + return options.fn(this); + } + return options.inverse(this); + }); - Handlebars.registerHelper('ifNotEqual', function (left, right, options) { - if (left != right) { - return options.fn(this); - } - return options.inverse(this); - }); + Handlebars.registerHelper('ifNotEqual', function (left, right, options) { + if (left != right) { + return options.fn(this); + } + return options.inverse(this); + }); - Handlebars.registerHelper('ifPropEquals', function (object, property, value, options) { - if (object[property] == value) { - return options.fn(this); - } - return options.inverse(this); - }); - - Handlebars.registerHelper('ifAttrEquals', function (model, attr, value, options) { - if (model.get(attr) == value) { - return options.fn(this); - } - return options.inverse(this); - }); - - Handlebars.registerHelper('ifAttrNotEmpty', function (model, attr, options) { - if (model.get(attr)) { - return options.fn(this); - } - return options.inverse(this); - }); + Handlebars.registerHelper('ifPropEquals', function (object, property, value, options) { + if (object[property] == value) { + return options.fn(this); + } + return options.inverse(this); + }); + + Handlebars.registerHelper('ifAttrEquals', function (model, attr, value, options) { + if (model.get(attr) == value) { + return options.fn(this); + } + return options.inverse(this); + }); + + Handlebars.registerHelper('ifAttrNotEmpty', function (model, attr, options) { + if (model.get(attr)) { + return options.fn(this); + } + return options.inverse(this); + }); - Handlebars.registerHelper('get', function (model, name) { - return model.get(name); - }); + Handlebars.registerHelper('get', function (model, name) { + return model.get(name); + }); - Handlebars.registerHelper('length', function (arr) { - return arr.length; - }); + Handlebars.registerHelper('length', function (arr) { + return arr.length; + }); - Handlebars.registerHelper('translate', function (name, options) { - var scope = options.hash.scope || null; - var category = options.hash.category || null; - if (name === 'null') { - return ''; - } - return self.language.translate(name, category, scope); - }); + Handlebars.registerHelper('translate', function (name, options) { + var scope = options.hash.scope || null; + var category = options.hash.category || null; + if (name === 'null') { + return ''; + } + return self.language.translate(name, category, scope); + }); - Handlebars.registerHelper('button', function (name, options) { - var style = options.hash.style || 'default'; - var scope = options.hash.scope || null; - var label = options.hash.label || name; - return new Handlebars.SafeString(''); - }); + Handlebars.registerHelper('button', function (name, options) { + var style = options.hash.style || 'default'; + var scope = options.hash.scope || null; + var label = options.hash.label || name; + return new Handlebars.SafeString(''); + }); - Handlebars.registerHelper('hyphen', function (string) { - return Espo.Utils.convert(string, 'c-h'); - }); + Handlebars.registerHelper('hyphen', function (string) { + return Espo.Utils.convert(string, 'c-h'); + }); - Handlebars.registerHelper('toDom', function (string) { - return Espo.Utils.toDom(string); - }); + Handlebars.registerHelper('toDom', function (string) { + return Espo.Utils.toDom(string); + }); - Handlebars.registerHelper('breaklines', function (text) { - text = Handlebars.Utils.escapeExpression(text || ''); - text = text.replace(/(\r\n|\n|\r)/gm, '
    '); - return new Handlebars.SafeString(text); - }); - - Handlebars.registerHelper('complexText', function (text) { - text = Handlebars.Utils.escapeExpression(text || ''); - - text = text.replace(self.urlRegex, '$1($2)[$2]'); - - self.mdSearch.forEach(function (re, i) { - text = text.replace(re, self.mdReplace[i]); - }); - - text = text.replace(/(\r\n|\n|\r)/gm, '
    '); - - text = text.replace('[#see-more-text]', ' ' + self.language.translate('See more')) + ''; - return new Handlebars.SafeString(text); - }); + Handlebars.registerHelper('breaklines', function (text) { + text = Handlebars.Utils.escapeExpression(text || ''); + text = text.replace(/(\r\n|\n|\r)/gm, '
    '); + return new Handlebars.SafeString(text); + }); + + Handlebars.registerHelper('complexText', function (text) { + text = Handlebars.Utils.escapeExpression(text || ''); + + text = text.replace(self.urlRegex, '$1($2)[$2]'); + + self.mdSearch.forEach(function (re, i) { + text = text.replace(re, self.mdReplace[i]); + }); + + text = text.replace(/(\r\n|\n|\r)/gm, '
    '); + + text = text.replace('[#see-more-text]', ' ' + self.language.translate('See more')) + ''; + return new Handlebars.SafeString(text); + }); - Handlebars.registerHelper('translateOption', function (name, options) { - var scope = options.hash.scope || null; - var field = options.hash.field || null; - if (!field) { - return ''; - } - var translationHash = self.language.translate(field, 'options', scope) || {}; - return translationHash[name] || name; - }); + Handlebars.registerHelper('translateOption', function (name, options) { + var scope = options.hash.scope || null; + var field = options.hash.field || null; + if (!field) { + return ''; + } + var translationHash = self.language.translate(field, 'options', scope) || {}; + return translationHash[name] || name; + }); - Handlebars.registerHelper('options', function (list, value, options) { - value = value || false; - list = list || {}; - var html = ''; - var isArray = (Object.prototype.toString.call(list) === '[object Array]'); + Handlebars.registerHelper('options', function (list, value, options) { + value = value || false; + list = list || {}; + var html = ''; + var isArray = (Object.prototype.toString.call(list) === '[object Array]'); - var multiple = (Object.prototype.toString.call(value) === '[object Array]'); - var checkOption = function (name) { - if (multiple) { - return value.indexOf(name) != -1; - } else { - return value === name; - } - }; + var multiple = (Object.prototype.toString.call(value) === '[object Array]'); + var checkOption = function (name) { + if (multiple) { + return value.indexOf(name) != -1; + } else { + return value === name; + } + }; - var scope = options.hash.scope || false; - var category = options.hash.category || false; - var field = options.hash.field || false; + var scope = options.hash.scope || false; + var category = options.hash.category || false; + var field = options.hash.field || false; - var translationHash; - if (!category && field) { - var translationHash = self.language.translate(field, 'options', scope) || {}; - } + var translationHash; + if (!category && field) { + var translationHash = self.language.translate(field, 'options', scope) || {}; + } - var translate = function (name) { - if (!category && field) { - if (typeof translationHash === 'object' && name in translationHash) { - return translationHash[name]; - } - return name; - } - return self.language.translate(name, category, scope); - }; + var translate = function (name) { + if (!category && field) { + if (typeof translationHash === 'object' && name in translationHash) { + return translationHash[name]; + } + return name; + } + return self.language.translate(name, category, scope); + }; - for (var key in list) { - var keyVal = list[key]; - html += "" - } - return new Handlebars.SafeString(html); - }); - } - }); + for (var key in list) { + var keyVal = list[key]; + html += "" + } + return new Handlebars.SafeString(html); + }); + } + }); }).call(this, Espo, _, Handlebars); diff --git a/frontend/client/src/view.js b/frontend/client/src/view.js index 06bb69c923..9618ab66c8 100644 --- a/frontend/client/src/view.js +++ b/frontend/client/src/view.js @@ -20,136 +20,136 @@ ************************************************************************/ (function (Espo, Backbone, _, Bull, $) { - Espo.View = Bull.View.extend({ + Espo.View = Bull.View.extend({ - addActionHandler: function (action, handler) { - this.events = this.events || {}; + addActionHandler: function (action, handler) { + this.events = this.events || {}; - var fullAction = 'click button[data-action=\"'+action+'\"]'; - this.events[fullAction] = handler; - }, + var fullAction = 'click button[data-action=\"'+action+'\"]'; + this.events[fullAction] = handler; + }, - notify: function (label, type, timeout, scope) { - if (label == false) { - Espo.Ui.notify(false); - return; - } - scope = scope || null; - timeout = timeout || 2000; - if (!type) { - timeout = null; - } - var text = this.getLanguage().translate(label, 'labels', scope); - Espo.Ui.notify(text, type, timeout); - }, + notify: function (label, type, timeout, scope) { + if (label == false) { + Espo.Ui.notify(false); + return; + } + scope = scope || null; + timeout = timeout || 2000; + if (!type) { + timeout = null; + } + var text = this.getLanguage().translate(label, 'labels', scope); + Espo.Ui.notify(text, type, timeout); + }, - getHelper: function () { - return this._helper; - }, + getHelper: function () { + return this._helper; + }, - getUser: function () { - if (this._helper) { - return this._helper.user; - } - }, + getUser: function () { + if (this._helper) { + return this._helper.user; + } + }, - getPreferences: function () { - if (this._helper) { - return this._helper.preferences; - } - }, + getPreferences: function () { + if (this._helper) { + return this._helper.preferences; + } + }, - getConfig: function () { - if (this._helper) { - return this._helper.settings; - } - }, + getConfig: function () { + if (this._helper) { + return this._helper.settings; + } + }, - getAcl: function () { - if (this._helper) { - return this._helper.acl; - } - }, + getAcl: function () { + if (this._helper) { + return this._helper.acl; + } + }, - getModelFactory: function () { - if (this._helper) { - return this._helper.modelFactory; - } - }, + getModelFactory: function () { + if (this._helper) { + return this._helper.modelFactory; + } + }, - getCollectionFactory: function () { - if (this._helper) { - return this._helper.collectionFactory; - } - }, + getCollectionFactory: function () { + if (this._helper) { + return this._helper.collectionFactory; + } + }, - getRouter: function () { - if (this._helper) { - return this._helper.router; - } - }, + getRouter: function () { + if (this._helper) { + return this._helper.router; + } + }, - getStorage: function () { - if (this._helper) { - return this._helper.storage; - } - }, + getStorage: function () { + if (this._helper) { + return this._helper.storage; + } + }, - getLanguage: function () { - if (this._helper) { - return this._helper.language; - } - }, + getLanguage: function () { + if (this._helper) { + return this._helper.language; + } + }, - getMetadata: function () { - if (this._helper) { - return this._helper.metadata; - } - }, + getMetadata: function () { + if (this._helper) { + return this._helper.metadata; + } + }, - getCache: function () { - if (this._helper) { - return this._helper.cache; - } - }, + getCache: function () { + if (this._helper) { + return this._helper.cache; + } + }, - getStorage: function () { - if (this._helper) { - return this._helper.storage; - } - }, + getStorage: function () { + if (this._helper) { + return this._helper.storage; + } + }, - getDateTime: function () { - if (this._helper) { - return this._helper.dateTime; - } - }, + getDateTime: function () { + if (this._helper) { + return this._helper.dateTime; + } + }, - getFieldManager: function () { - if (this._helper) { - return this._helper.fieldManager; - } - }, - - getBaseController: function () { - if (this._helper) { - return this._helper.baseController; - } - }, + getFieldManager: function () { + if (this._helper) { + return this._helper.fieldManager; + } + }, + + getBaseController: function () { + if (this._helper) { + return this._helper.baseController; + } + }, - updatePageTitle: function () { - var title = this.getConfig().get('applicationTitle') || 'EspoCRM'; - this.setPageTitle(title); - }, + updatePageTitle: function () { + var title = this.getConfig().get('applicationTitle') || 'EspoCRM'; + this.setPageTitle(title); + }, - setPageTitle: function (title) { - $('head title').text(title); - }, + setPageTitle: function (title) { + $('head title').text(title); + }, - translate: function (label, category, scope) { - return this.getLanguage().translate(label, category, scope); - }, - }); + translate: function (label, category, scope) { + return this.getLanguage().translate(label, category, scope); + }, + }); }).call(this, Espo, Backbone, _, Bull, $); diff --git a/frontend/client/src/views/about.js b/frontend/client/src/views/about.js index 5cde26354c..c7a3cd8e86 100644 --- a/frontend/client/src/views/about.js +++ b/frontend/client/src/views/about.js @@ -21,18 +21,18 @@ Espo.define('Views.About', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'about', + template: 'about', - el: '#main', - - data: function () { - return { - version: this.getConfig().get('version') - }; - } + el: '#main', + + data: function () { + return { + version: this.getConfig().get('version') + }; + } - }); + }); }); diff --git a/frontend/client/src/views/admin/auth-token/list.js b/frontend/client/src/views/admin/auth-token/list.js index 2e2b520135..20112a3a21 100644 --- a/frontend/client/src/views/admin/auth-token/list.js +++ b/frontend/client/src/views/admin/auth-token/list.js @@ -21,23 +21,23 @@ Espo.define('Views.Admin.AuthToken.List', 'Views.List', function (Dep) { - return Dep.extend({ - - searchPanel: false, + return Dep.extend({ + + searchPanel: false, - setup: function () { - Dep.prototype.setup.call(this); - - this.menu.buttons = []; - }, + setup: function () { + Dep.prototype.setup.call(this); + + this.menu.buttons = []; + }, - getHeader: function () { - return '' + this.translate('Administration') + " » " + this.getLanguage().translate('Auth Tokens', 'labels', 'Administration'); - }, + getHeader: function () { + return '' + this.translate('Administration') + " » " + this.getLanguage().translate('Auth Tokens', 'labels', 'Administration'); + }, - updatePageTitle: function () { - this.setPageTitle(this.getLanguage().translate('Auth Tokens', 'labels', 'Administration')); - }, - }); + updatePageTitle: function () { + this.setPageTitle(this.getLanguage().translate('Auth Tokens', 'labels', 'Administration')); + }, + }); }); diff --git a/frontend/client/src/views/admin/auth-token/record/list.js b/frontend/client/src/views/admin/auth-token/record/list.js index a4cc16f2cd..0878cb3fbe 100644 --- a/frontend/client/src/views/admin/auth-token/record/list.js +++ b/frontend/client/src/views/admin/auth-token/record/list.js @@ -21,24 +21,24 @@ Espo.define('Views.Admin.AuthToken.Record.List', 'Views.Record.List', function (Dep) { - return Dep.extend({ - - rowActionsView: 'Admin.AuthToken.Record.RowActions.Remove', - - setup: function () { - Dep.prototype.setup.call(this); - - var actions = []; - - this.actions.forEach(function (item) { - if (item.name == 'delete') { - actions.push(item); - } - }, this); - - this.actions = actions; - }, + return Dep.extend({ + + rowActionsView: 'Admin.AuthToken.Record.RowActions.Remove', + + setup: function () { + Dep.prototype.setup.call(this); + + var actions = []; + + this.actions.forEach(function (item) { + if (item.name == 'delete') { + actions.push(item); + } + }, this); + + this.actions = actions; + }, - }); + }); }); diff --git a/frontend/client/src/views/admin/auth-token/record/row-actions/remove.js b/frontend/client/src/views/admin/auth-token/record/row-actions/remove.js index 0ff339b962..16e362cf35 100644 --- a/frontend/client/src/views/admin/auth-token/record/row-actions/remove.js +++ b/frontend/client/src/views/admin/auth-token/record/row-actions/remove.js @@ -21,16 +21,16 @@ Espo.define('Views.Admin.AuthToken.Record.RowActions.Remove', 'View', function (Dep) { - return Dep.extend({ - - _template: '{{translate "Remove"}}', - - data: function () { - return { - id: this.model.id - }; - } + return Dep.extend({ + + _template: '{{translate "Remove"}}', + + data: function () { + return { + id: this.model.id + }; + } - }); + }); }); diff --git a/frontend/client/src/views/admin/authentication.js b/frontend/client/src/views/admin/authentication.js index 5cc9b97607..738fa2ffe4 100644 --- a/frontend/client/src/views/admin/authentication.js +++ b/frontend/client/src/views/admin/authentication.js @@ -19,104 +19,104 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ -Espo.define('Views.Admin.Authentication', 'Views.Settings.Record.Edit', function (Dep) { +Espo.define('Views.Admin.Authentication', 'Views.Settings.Record.Edit', function (Dep) { - return Dep.extend({ - - layoutName: 'authentication', - - dependencyDefs: { - 'ldapAuth': { - map: { - true: [ - { - action: 'show', - fields: ['ldapUsername', 'ldapPassword'] - } - ] - }, - default: [ - { - action: 'hide', - fields: ['ldapUsername', 'ldapPassword'] - } - ] - }, - 'ldapAccountCanonicalForm': { - map: { - 'Backslash': [ - { - action: 'show', - fields: ['ldapAccountDomainName', 'ldapAccountDomainNameShort'] - } - ], - 'Principal': [ - { - action: 'show', - fields: ['ldapAccountDomainName', 'ldapAccountDomainNameShort'] - } - ] - }, - default: [ - { - action: 'hide', - fields: ['ldapAccountDomainName', 'ldapAccountDomainNameShort'] - } - ] - } - }, - - setup: function () { - Dep.prototype.setup.call(this); - - this.methodList = this.getMetadata().get('entityDefs.Settings.fields.authenticationMethod.options') || []; - - this.authFields = { - 'LDAP': [ - 'ldapHost', 'ldapPort', 'ldapAuth', 'ldapSecurity', - 'ldapUsername', 'ldapPassword', 'ldapBindRequiresDn', - 'ldapUserLoginFilter', 'ldapBaseDn', 'ldapAccountCanonicalForm', - 'ldapAccountDomainName', 'ldapAccountDomainNameShort', 'ldapAccountDomainName', - 'ldapAccountDomainNameShort', 'ldapTryUsernameSplit', 'ldapOptReferrals', - 'ldapCreateEspoUser' - ] - }; - }, + return Dep.extend({ + + layoutName: 'authentication', + + dependencyDefs: { + 'ldapAuth': { + map: { + true: [ + { + action: 'show', + fields: ['ldapUsername', 'ldapPassword'] + } + ] + }, + default: [ + { + action: 'hide', + fields: ['ldapUsername', 'ldapPassword'] + } + ] + }, + 'ldapAccountCanonicalForm': { + map: { + 'Backslash': [ + { + action: 'show', + fields: ['ldapAccountDomainName', 'ldapAccountDomainNameShort'] + } + ], + 'Principal': [ + { + action: 'show', + fields: ['ldapAccountDomainName', 'ldapAccountDomainNameShort'] + } + ] + }, + default: [ + { + action: 'hide', + fields: ['ldapAccountDomainName', 'ldapAccountDomainNameShort'] + } + ] + } + }, + + setup: function () { + Dep.prototype.setup.call(this); + + this.methodList = this.getMetadata().get('entityDefs.Settings.fields.authenticationMethod.options') || []; + + this.authFields = { + 'LDAP': [ + 'ldapHost', 'ldapPort', 'ldapAuth', 'ldapSecurity', + 'ldapUsername', 'ldapPassword', 'ldapBindRequiresDn', + 'ldapUserLoginFilter', 'ldapBaseDn', 'ldapAccountCanonicalForm', + 'ldapAccountDomainName', 'ldapAccountDomainNameShort', 'ldapAccountDomainName', + 'ldapAccountDomainNameShort', 'ldapTryUsernameSplit', 'ldapOptReferrals', + 'ldapCreateEspoUser' + ] + }; + }, - - afterRender: function () { - this.handlePanelsVisibility(); - this.listenTo(this.model, 'change:authenticationMethod', function () { - this.handlePanelsVisibility(); - }, this); - }, - - handlePanelsVisibility: function () { - var authenticationMethod = this.model.get('authenticationMethod'); + + afterRender: function () { + this.handlePanelsVisibility(); + this.listenTo(this.model, 'change:authenticationMethod', function () { + this.handlePanelsVisibility(); + }, this); + }, + + handlePanelsVisibility: function () { + var authenticationMethod = this.model.get('authenticationMethod'); - this.methodList.forEach(function (method) { - var list = (this.authFields[method] || []); - if (method != authenticationMethod) { - this.$el.find('.panel[data-panel-name="'+method+'"]').addClass('hidden'); - list.forEach(function (field) { - this.hideField(field); - }, this); - } else { - this.$el.find('.panel[data-panel-name="'+method+'"]').removeClass('hidden'); - - list.forEach(function (field) { - this.showField(field); - }, this); - Object.keys(this.dependencyDefs || {}).forEach(function (attr) { - if (~list.indexOf(attr)) { - this._handleDependencyAttribute(attr); - } - }, this); - } - }, this); - }, - - }); - + this.methodList.forEach(function (method) { + var list = (this.authFields[method] || []); + if (method != authenticationMethod) { + this.$el.find('.panel[data-panel-name="'+method+'"]').addClass('hidden'); + list.forEach(function (field) { + this.hideField(field); + }, this); + } else { + this.$el.find('.panel[data-panel-name="'+method+'"]').removeClass('hidden'); + + list.forEach(function (field) { + this.showField(field); + }, this); + Object.keys(this.dependencyDefs || {}).forEach(function (attr) { + if (~list.indexOf(attr)) { + this._handleDependencyAttribute(attr); + } + }, this); + } + }, this); + }, + + }); + }); diff --git a/frontend/client/src/views/admin/currency.js b/frontend/client/src/views/admin/currency.js index ba09af2a97..348a4348ac 100644 --- a/frontend/client/src/views/admin/currency.js +++ b/frontend/client/src/views/admin/currency.js @@ -19,51 +19,51 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ -Espo.define('Views.Admin.Currency', 'Views.Settings.Record.Edit', function (Dep) { +Espo.define('Views.Admin.Currency', 'Views.Settings.Record.Edit', function (Dep) { - return Dep.extend({ - - layoutName: 'currency', - - setup: function () { - Dep.prototype.setup.call(this); - }, - - afterRender: function () { - var currencyListField = this.getFieldView('currencyList'); - var defaultCurrencyField = this.getFieldView('defaultCurrency'); - var baseCurrencyField = this.getFieldView('baseCurrency'); - - var currencyRatesField = this.getFieldView('currencyRates'); - - if (currencyListField) { - this.listenTo(currencyListField, 'change', function () { - var data = currencyListField.fetch(); - var options = data.currencyList; - if (defaultCurrencyField) { - defaultCurrencyField.params.options = options; - defaultCurrencyField.render(); - } - if (baseCurrencyField) { - baseCurrencyField.params.options = options; - baseCurrencyField.render(); - } - if (currencyRatesField) { - currencyRatesField.render(); - } - }, this); - } - - if (baseCurrencyField) { - this.listenTo(baseCurrencyField, 'change', function () { - if (currencyRatesField) { - currencyRatesField.render(); - } - }, this); - } - }, - - }); - + return Dep.extend({ + + layoutName: 'currency', + + setup: function () { + Dep.prototype.setup.call(this); + }, + + afterRender: function () { + var currencyListField = this.getFieldView('currencyList'); + var defaultCurrencyField = this.getFieldView('defaultCurrency'); + var baseCurrencyField = this.getFieldView('baseCurrency'); + + var currencyRatesField = this.getFieldView('currencyRates'); + + if (currencyListField) { + this.listenTo(currencyListField, 'change', function () { + var data = currencyListField.fetch(); + var options = data.currencyList; + if (defaultCurrencyField) { + defaultCurrencyField.params.options = options; + defaultCurrencyField.render(); + } + if (baseCurrencyField) { + baseCurrencyField.params.options = options; + baseCurrencyField.render(); + } + if (currencyRatesField) { + currencyRatesField.render(); + } + }, this); + } + + if (baseCurrencyField) { + this.listenTo(baseCurrencyField, 'change', function () { + if (currencyRatesField) { + currencyRatesField.render(); + } + }, this); + } + }, + + }); + }); diff --git a/frontend/client/src/views/admin/extensions/done.js b/frontend/client/src/views/admin/extensions/done.js index 8ecbca0822..6ac20a37a5 100644 --- a/frontend/client/src/views/admin/extensions/done.js +++ b/frontend/client/src/views/admin/extensions/done.js @@ -21,40 +21,40 @@ Espo.define('Views.Admin.Extensions.Done', 'Views.Modal', function (Dep) { - return Dep.extend({ - - cssName: 'done-modal', - - header: false, - - template: 'admin.extensions.done', - - createButton: true, - - data: function () { - return { - version: this.options.version, - name: this.options.name, - text: this.translate('extensionInstalled', 'messages', 'Admin').replace('{version}', this.options.version) - .replace('{name}', this.options.name) - }; - }, - - setup: function () { - this.buttons = [ - { - name: 'close', - label: 'Close', - onClick: function (dialog) { - dialog.close(); - }.bind(this) - } - ]; - - this.header = this.getLanguage().translate('Installed successfully', 'labels', 'Admin'); - - }, - - }); + return Dep.extend({ + + cssName: 'done-modal', + + header: false, + + template: 'admin.extensions.done', + + createButton: true, + + data: function () { + return { + version: this.options.version, + name: this.options.name, + text: this.translate('extensionInstalled', 'messages', 'Admin').replace('{version}', this.options.version) + .replace('{name}', this.options.name) + }; + }, + + setup: function () { + this.buttons = [ + { + name: 'close', + label: 'Close', + onClick: function (dialog) { + dialog.close(); + }.bind(this) + } + ]; + + this.header = this.getLanguage().translate('Installed successfully', 'labels', 'Admin'); + + }, + + }); }); diff --git a/frontend/client/src/views/admin/extensions/index.js b/frontend/client/src/views/admin/extensions/index.js index de7c8b3cfe..e00282c4e2 100644 --- a/frontend/client/src/views/admin/extensions/index.js +++ b/frontend/client/src/views/admin/extensions/index.js @@ -19,185 +19,185 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ -Espo.define('Views.Admin.Extensions.Index', 'View', function (Dep) { +Espo.define('Views.Admin.Extensions.Index', 'View', function (Dep) { - return Dep.extend({ - - template: "admin.extensions.index", - - packageContents: null, - - events: { - 'change input[name="package"]': function (e) { - this.$el.find('button[data-action="upload"]').addClass('disabled'); - this.$el.find('.message-container').html(''); - var files = e.currentTarget.files; - if (files.length) { - this.selectFile(files[0]); - } - }, - 'click button[data-action="upload"]': function () { - this.upload(); - }, - 'click [data-action="install"]': function (e) { - var id = $(e.currentTarget).data('id'); - - var name = this.collection.get(id).get('name'); - var version = this.collection.get(id).get('version'); - - this.run(id, name, version); - - }, - 'click [data-action="uninstall"]': function (e) { - var id = $(e.currentTarget).data('id'); - - var name = this.collection.get(id).get('name'); - - var self = this; - if (confirm(this.translate('uninstallConfirmation', 'messages', 'Admin'))) { - Espo.Ui.notify(this.translate('Uninstalling...', 'labels', 'Admin')); - - $.ajax({ - url: 'Extension/action/uninstall', - type: 'POST', - data: JSON.stringify({ - id: id - }), - error: function (xhr) { - var msg = xhr.getResponseHeader('X-Status-Reason'); - this.showErrorNotification(this.translate('Error') + ': ' + msg); - }.bind(this) - }).done(function () { - this.listenToOnce(this.collection, 'sync', function () { - Espo.Ui.success(this.translate('uninstalled', 'messages', 'Extension').replace('{name}', name)); - }, this); - this.collection.fetch(); - - }.bind(this)); - } - } - }, - - setup: function () { - this.getCollectionFactory().create('Extension', function (collection) { - this.collection = collection; - - collection.maxSize = this.getConfig().get('recordsPerPage'); - - this.wait(true); - this.listenToOnce(collection, 'sync', function () { - this.createView('list', 'Extension.Record.List', { - collection: collection, - el: this.options.el + ' > .list-container', - }); - if (collection.length == 0) { - this.once('after:render', function () { - this.$el.find('.list-container').addClass('hidden'); - }.bind(this)); - } - this.wait(false); - }); - - collection.fetch(); - - }, this); - }, - - selectFile: function (file) { - var fileReader = new FileReader(); - fileReader.onload = function (e) { - this.packageContents = e.target.result; - this.$el.find('button[data-action="upload"]').removeClass('disabled'); - }.bind(this); - fileReader.readAsDataURL(file); - }, - - showError: function (msg) { - msg = this.translate(msg, 'errors', 'Admin'); - this.$el.find('.message-container').html(msg); - }, - - showErrorNotification: function (msg) { - if (!msg) { - this.$el.find('.notify-text').addClass('hidden'); - } else { - msg = this.translate(msg, 'errors', 'Admin'); - this.$el.find('.notify-text').html(msg); - this.$el.find('.notify-text').removeClass('hidden'); - } - }, - - upload: function () { - this.$el.find('button[data-action="upload"]').addClass('disabled'); - this.notify('Uploading...'); - $.ajax({ - url: 'Extension/action/upload', - type: 'POST', - contentType: 'application/zip', - timeout: 0, - data: this.packageContents, - error: function (xhr, t, e) { - this.showError(xhr.getResponseHeader('X-Status-Reason')); - this.notify(false); - }.bind(this) - }).done(function (data) { - if (!data.id) { - this.showError(this.translate('Error occured')); - return; - } - this.notify(false); - this.createView('popup', 'Admin.Extensions.Ready', { - upgradeData: data - }, function (view) { - view.render(); - this.$el.find('button[data-action="upload"]').removeClass('disabled'); - - view.once('run', function () { - view.close(); - this.$el.find('.panel.upload').addClass('hidden'); - this.run(data.id, data.version, data.name); - }, this); - }.bind(this)); - }.bind(this)).error; - }, - - run: function (id, version, name) { - var msg = this.translate('Installing...', 'labels', 'Admin'); - this.notify('Please wait...'); - - this.showError(false); - this.showErrorNotification(false); - - $.ajax({ - url: 'Extension/action/install', - type: 'POST', - data: JSON.stringify({ - id: id - }), - error: function (xhr) { - this.$el.find('.panel.upload').removeClass('hidden'); - var msg = xhr.getResponseHeader('X-Status-Reason'); - this.showErrorNotification(this.translate('Error') + ': ' + msg); - }.bind(this) - }).done(function () { - var cache = this.getCache(); - if (cache) { - cache.clear(); - } - this.createView('popup', 'Admin.Extensions.Done', { - version: version, - name: name - }, function (view) { - this.collection.fetch(); - this.$el.find('.list-container').removeClass('hidden'); - this.$el.find('.panel.upload').removeClass('hidden'); - this.notify(false); - view.render(); - }.bind(this)); - }.bind(this)); - }, - - }); - + return Dep.extend({ + + template: "admin.extensions.index", + + packageContents: null, + + events: { + 'change input[name="package"]': function (e) { + this.$el.find('button[data-action="upload"]').addClass('disabled'); + this.$el.find('.message-container').html(''); + var files = e.currentTarget.files; + if (files.length) { + this.selectFile(files[0]); + } + }, + 'click button[data-action="upload"]': function () { + this.upload(); + }, + 'click [data-action="install"]': function (e) { + var id = $(e.currentTarget).data('id'); + + var name = this.collection.get(id).get('name'); + var version = this.collection.get(id).get('version'); + + this.run(id, name, version); + + }, + 'click [data-action="uninstall"]': function (e) { + var id = $(e.currentTarget).data('id'); + + var name = this.collection.get(id).get('name'); + + var self = this; + if (confirm(this.translate('uninstallConfirmation', 'messages', 'Admin'))) { + Espo.Ui.notify(this.translate('Uninstalling...', 'labels', 'Admin')); + + $.ajax({ + url: 'Extension/action/uninstall', + type: 'POST', + data: JSON.stringify({ + id: id + }), + error: function (xhr) { + var msg = xhr.getResponseHeader('X-Status-Reason'); + this.showErrorNotification(this.translate('Error') + ': ' + msg); + }.bind(this) + }).done(function () { + this.listenToOnce(this.collection, 'sync', function () { + Espo.Ui.success(this.translate('uninstalled', 'messages', 'Extension').replace('{name}', name)); + }, this); + this.collection.fetch(); + + }.bind(this)); + } + } + }, + + setup: function () { + this.getCollectionFactory().create('Extension', function (collection) { + this.collection = collection; + + collection.maxSize = this.getConfig().get('recordsPerPage'); + + this.wait(true); + this.listenToOnce(collection, 'sync', function () { + this.createView('list', 'Extension.Record.List', { + collection: collection, + el: this.options.el + ' > .list-container', + }); + if (collection.length == 0) { + this.once('after:render', function () { + this.$el.find('.list-container').addClass('hidden'); + }.bind(this)); + } + this.wait(false); + }); + + collection.fetch(); + + }, this); + }, + + selectFile: function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (e) { + this.packageContents = e.target.result; + this.$el.find('button[data-action="upload"]').removeClass('disabled'); + }.bind(this); + fileReader.readAsDataURL(file); + }, + + showError: function (msg) { + msg = this.translate(msg, 'errors', 'Admin'); + this.$el.find('.message-container').html(msg); + }, + + showErrorNotification: function (msg) { + if (!msg) { + this.$el.find('.notify-text').addClass('hidden'); + } else { + msg = this.translate(msg, 'errors', 'Admin'); + this.$el.find('.notify-text').html(msg); + this.$el.find('.notify-text').removeClass('hidden'); + } + }, + + upload: function () { + this.$el.find('button[data-action="upload"]').addClass('disabled'); + this.notify('Uploading...'); + $.ajax({ + url: 'Extension/action/upload', + type: 'POST', + contentType: 'application/zip', + timeout: 0, + data: this.packageContents, + error: function (xhr, t, e) { + this.showError(xhr.getResponseHeader('X-Status-Reason')); + this.notify(false); + }.bind(this) + }).done(function (data) { + if (!data.id) { + this.showError(this.translate('Error occured')); + return; + } + this.notify(false); + this.createView('popup', 'Admin.Extensions.Ready', { + upgradeData: data + }, function (view) { + view.render(); + this.$el.find('button[data-action="upload"]').removeClass('disabled'); + + view.once('run', function () { + view.close(); + this.$el.find('.panel.upload').addClass('hidden'); + this.run(data.id, data.version, data.name); + }, this); + }.bind(this)); + }.bind(this)).error; + }, + + run: function (id, version, name) { + var msg = this.translate('Installing...', 'labels', 'Admin'); + this.notify('Please wait...'); + + this.showError(false); + this.showErrorNotification(false); + + $.ajax({ + url: 'Extension/action/install', + type: 'POST', + data: JSON.stringify({ + id: id + }), + error: function (xhr) { + this.$el.find('.panel.upload').removeClass('hidden'); + var msg = xhr.getResponseHeader('X-Status-Reason'); + this.showErrorNotification(this.translate('Error') + ': ' + msg); + }.bind(this) + }).done(function () { + var cache = this.getCache(); + if (cache) { + cache.clear(); + } + this.createView('popup', 'Admin.Extensions.Done', { + version: version, + name: name + }, function (view) { + this.collection.fetch(); + this.$el.find('.list-container').removeClass('hidden'); + this.$el.find('.panel.upload').removeClass('hidden'); + this.notify(false); + view.render(); + }.bind(this)); + }.bind(this)); + }, + + }); + }); diff --git a/frontend/client/src/views/admin/extensions/ready.js b/frontend/client/src/views/admin/extensions/ready.js index b951f08962..b5d30ca25f 100644 --- a/frontend/client/src/views/admin/extensions/ready.js +++ b/frontend/client/src/views/admin/extensions/ready.js @@ -21,54 +21,54 @@ Espo.define('Views.Admin.Extensions.Ready', 'Views.Modal', function (Dep) { - return Dep.extend({ - - cssName: 'ready-modal', - - header: false, - - template: 'admin.extensions.ready', - - createButton: true, - - data: function () { - return { - version: this.upgradeData.version, - text: this.translate('installExtension', 'messages', 'Admin').replace('{version}', this.upgradeData.version) - .replace('{name}', this.upgradeData.name) - }; - }, - - setup: function () { - - this.buttons = [ - { - name: 'run', - text: this.translate('Install', 'labels', 'Admin'), - style: 'danger', - onClick: function (dialog) { - this.run(); - }.bind(this) - }, - { - name: 'cancel', - label: 'Cancel', - onClick: function (dialog) { - dialog.close(); - } - } - ]; - - this.upgradeData = this.options.upgradeData; - - this.header = this.getLanguage().translate('Ready for installation', 'labels', 'Admin'); - - }, - - run: function () { - this.trigger('run'); - this.remove(); - } - }); + return Dep.extend({ + + cssName: 'ready-modal', + + header: false, + + template: 'admin.extensions.ready', + + createButton: true, + + data: function () { + return { + version: this.upgradeData.version, + text: this.translate('installExtension', 'messages', 'Admin').replace('{version}', this.upgradeData.version) + .replace('{name}', this.upgradeData.name) + }; + }, + + setup: function () { + + this.buttons = [ + { + name: 'run', + text: this.translate('Install', 'labels', 'Admin'), + style: 'danger', + onClick: function (dialog) { + this.run(); + }.bind(this) + }, + { + name: 'cancel', + label: 'Cancel', + onClick: function (dialog) { + dialog.close(); + } + } + ]; + + this.upgradeData = this.options.upgradeData; + + this.header = this.getLanguage().translate('Ready for installation', 'labels', 'Admin'); + + }, + + run: function () { + this.trigger('run'); + this.remove(); + } + }); }); diff --git a/frontend/client/src/views/admin/field-manager/edit.js b/frontend/client/src/views/admin/field-manager/edit.js index 1a7f0337b7..1c77e68dd9 100644 --- a/frontend/client/src/views/admin/field-manager/edit.js +++ b/frontend/client/src/views/admin/field-manager/edit.js @@ -20,170 +20,170 @@ ************************************************************************/ Espo.define('Views.Admin.FieldManager.Edit', 'View', function (Dep) { - - return Dep.extend({ - - template: 'admin.field-manager.edit', - - data: function () { - return { - scope: this.scope, - field: this.field, - defs: this.defs, - params: this.params, - type: this.type, - fieldList: this.fieldList, - }; - }, - - events: { - 'click button[data-action="cancel"]': function () { - this.getRouter().navigate('#Admin/fieldManager/scope=' + this.scope, {trigger: true}); - }, - 'click button[data-action="save"]': function () { - this.save(); - }, - }, - - setup: function () { - this.scope = this.options.scope; - this.field = this.options.field; - this.type = this.options.type; - this.defs = {}; - - this.fieldList = []; - - this.isNew = false; - if (!this.field) { - this.isNew = true; - } - - this.model = new Espo.Model(); - this.model.name = 'Admin'; - this.model.urlRoot = 'Admin/fieldManager/' + this.scope; - - this.model.defs = { - fields: { - name: {required: true}, - label: {required: true}, - }, - }; - - if (!this.isNew) { - this.model.id = this.field; - this.model.set('name', this.field); - this.model.set('label', this.getLanguage().translate(this.field, 'fields', this.scope)); - } else { - this.model.set('type', this.type); - } + + return Dep.extend({ + + template: 'admin.field-manager.edit', + + data: function () { + return { + scope: this.scope, + field: this.field, + defs: this.defs, + params: this.params, + type: this.type, + fieldList: this.fieldList, + }; + }, + + events: { + 'click button[data-action="cancel"]': function () { + this.getRouter().navigate('#Admin/fieldManager/scope=' + this.scope, {trigger: true}); + }, + 'click button[data-action="save"]': function () { + this.save(); + }, + }, + + setup: function () { + this.scope = this.options.scope; + this.field = this.options.field; + this.type = this.options.type; + this.defs = {}; + + this.fieldList = []; + + this.isNew = false; + if (!this.field) { + this.isNew = true; + } + + this.model = new Espo.Model(); + this.model.name = 'Admin'; + this.model.urlRoot = 'Admin/fieldManager/' + this.scope; + + this.model.defs = { + fields: { + name: {required: true}, + label: {required: true}, + }, + }; + + if (!this.isNew) { + this.model.id = this.field; + this.model.set('name', this.field); + this.model.set('label', this.getLanguage().translate(this.field, 'fields', this.scope)); + } else { + this.model.set('type', this.type); + } - - this.wait(true); - this.getModelFactory().create(this.scope, function (model) { - - if (!this.isNew) { - this.type = model.getFieldType(this.field); - this.defs = model.defs.fields[this.field]; - } - - - - this.params = this.getFieldManager().getParams(this.type) || []; - - this.params.forEach(function (o) { - this.model.defs.fields[o.name] = o; - }, this); - - this.model.set(this.defs); - - if (this.isNew) { - this.model.populateDefaults(); - } - - this.createFieldView('varchar', 'name', !this.isNew); - this.createFieldView('varchar', 'label'); - + + this.wait(true); + this.getModelFactory().create(this.scope, function (model) { + + if (!this.isNew) { + this.type = model.getFieldType(this.field); + this.defs = model.defs.fields[this.field]; + } + + + + this.params = this.getFieldManager().getParams(this.type) || []; + + this.params.forEach(function (o) { + this.model.defs.fields[o.name] = o; + }, this); + + this.model.set(this.defs); + + if (this.isNew) { + this.model.populateDefaults(); + } + + this.createFieldView('varchar', 'name', !this.isNew); + this.createFieldView('varchar', 'label'); + - - this.getView('name').on('change', function (m) { - var name = this.model.get('name'); - this.model.set('label', name); - if (name) { - name = name.replace('-', '').replace(/[^\w\s]/gi, '').replace(/ (.)/g, function(match, g) { - return g.toUpperCase(); - }).replace(' ', ''); - if (name.length) { - name = name.charAt(0).toLowerCase() + name.slice(1); - } - } - this.model.set('name', name); - }, this); - - this.params.forEach(function (o) { - if (o.hidden) { - return; - } - this.createFieldView(o.type, o.name, null, o); - }, this); - - - this.wait(false); - }.bind(this)); - - }, - - createFieldView: function (type, name, readOnly, params) { - this.createView(name, this.getFieldManager().getViewName(type), { - model: this.model, - el: this.options.el + ' .field-' + name, - defs: { - name: name, - params: params - }, - mode: readOnly ? 'detail' : 'edit', - readOnly: readOnly, - }); - this.fieldList.push(name); - }, - - save: function () { - this.fieldList.forEach(function (field) { - var view = this.getView(field); - if (!view.readOnly) { - view.fetchToModel(); - } - }, this); - - var notValid = false; - this.fieldList.forEach(function (field) { - notValid = this.getView(field).validate() || notValid; - }, this); - - if (notValid) { - this.notify('Not valid', 'error'); - return; - } - - this.listenToOnce(this.model, 'sync', function () { - this.getMetadata().data['entityDefs'][this.scope]['fields'][this.model.get('name')] = this.model.toJSON(); - this.getMetadata().storeToCache(); - this.notify('Saved', 'success'); - - var data = this.getLanguage().data; - if (this.scope in data) { - if (!('fields' in data[this.scope])) { - data[this.scope]['fields'] = {}; - } - data[this.scope]['fields'][this.model.get('name')] = this.model.get('label'); - } - - this.getRouter().navigate('#Admin/fieldManager/scope=' + this.scope + '&field=' + this.model.get('name'), {trigger: true}); - }.bind(this)); - - this.notify('Saving...'); - this.model.save(); - }, - - }); + + this.getView('name').on('change', function (m) { + var name = this.model.get('name'); + this.model.set('label', name); + if (name) { + name = name.replace('-', '').replace(/[^\w\s]/gi, '').replace(/ (.)/g, function(match, g) { + return g.toUpperCase(); + }).replace(' ', ''); + if (name.length) { + name = name.charAt(0).toLowerCase() + name.slice(1); + } + } + this.model.set('name', name); + }, this); + + this.params.forEach(function (o) { + if (o.hidden) { + return; + } + this.createFieldView(o.type, o.name, null, o); + }, this); + + + this.wait(false); + }.bind(this)); + + }, + + createFieldView: function (type, name, readOnly, params) { + this.createView(name, this.getFieldManager().getViewName(type), { + model: this.model, + el: this.options.el + ' .field-' + name, + defs: { + name: name, + params: params + }, + mode: readOnly ? 'detail' : 'edit', + readOnly: readOnly, + }); + this.fieldList.push(name); + }, + + save: function () { + this.fieldList.forEach(function (field) { + var view = this.getView(field); + if (!view.readOnly) { + view.fetchToModel(); + } + }, this); + + var notValid = false; + this.fieldList.forEach(function (field) { + notValid = this.getView(field).validate() || notValid; + }, this); + + if (notValid) { + this.notify('Not valid', 'error'); + return; + } + + this.listenToOnce(this.model, 'sync', function () { + this.getMetadata().data['entityDefs'][this.scope]['fields'][this.model.get('name')] = this.model.toJSON(); + this.getMetadata().storeToCache(); + this.notify('Saved', 'success'); + + var data = this.getLanguage().data; + if (this.scope in data) { + if (!('fields' in data[this.scope])) { + data[this.scope]['fields'] = {}; + } + data[this.scope]['fields'][this.model.get('name')] = this.model.get('label'); + } + + this.getRouter().navigate('#Admin/fieldManager/scope=' + this.scope + '&field=' + this.model.get('name'), {trigger: true}); + }.bind(this)); + + this.notify('Saving...'); + this.model.save(); + }, + + }); }); diff --git a/frontend/client/src/views/admin/field-manager/index.js b/frontend/client/src/views/admin/field-manager/index.js index 9a018c931f..12a3ae489a 100644 --- a/frontend/client/src/views/admin/field-manager/index.js +++ b/frontend/client/src/views/admin/field-manager/index.js @@ -21,148 +21,148 @@ Espo.define('Views.Admin.FieldManager.Index', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'admin.field-manager.index', + template: 'admin.field-manager.index', - scopeList: null, + scopeList: null, - scope: null, + scope: null, - type: null, + type: null, - data: function () { - return { - scopeList: this.scopeList, - scope: this.scope, - }; - }, + data: function () { + return { + scopeList: this.scopeList, + scope: this.scope, + }; + }, - events: { - 'click #scopes-menu a.scope-link': function (e) { - var scope = $(e.currentTarget).data('scope'); - this.openScope(scope); - }, - - 'click #fields-content a.field-link': function (e) { - var scope = $(e.currentTarget).data('scope'); - var field = $(e.currentTarget).data('field'); - this.openField(scope, field); - }, - - 'click a[data-action="addField"]': function (e) { - var scope = $(e.currentTarget).data('scope'); - var type = $(e.currentTarget).data('type'); - this.createField(scope, type); - }, - }, + events: { + 'click #scopes-menu a.scope-link': function (e) { + var scope = $(e.currentTarget).data('scope'); + this.openScope(scope); + }, + + 'click #fields-content a.field-link': function (e) { + var scope = $(e.currentTarget).data('scope'); + var field = $(e.currentTarget).data('field'); + this.openField(scope, field); + }, + + 'click a[data-action="addField"]': function (e) { + var scope = $(e.currentTarget).data('scope'); + var type = $(e.currentTarget).data('type'); + this.createField(scope, type); + }, + }, - setup: function () { - this.scopeList = []; - var scopesAll = Object.keys(this.getMetadata().get('scopes')).sort(); - scopesAll.forEach(function (scope) { - if (this.getMetadata().get('scopes.' + scope + '.entity')) { - if (this.getMetadata().get('scopes.' + scope + '.customizable')) { - this.scopeList.push(scope); - } - } - }.bind(this)); + setup: function () { + this.scopeList = []; + var scopesAll = Object.keys(this.getMetadata().get('scopes')).sort(); + scopesAll.forEach(function (scope) { + if (this.getMetadata().get('scopes.' + scope + '.entity')) { + if (this.getMetadata().get('scopes.' + scope + '.customizable')) { + this.scopeList.push(scope); + } + } + }.bind(this)); - this.scope = this.options.scope || null; - this.field = this.options.field || null; - - this.on('after:render', function () { - this.renderFieldsHeader(); - if (!this.scope) { - this.renderDefaultPage(); - } else { - if (!this.field) { - this.openScope(this.scope); - } else { - this.openField(this.scope, this.field); - } - } - }); - }, + this.scope = this.options.scope || null; + this.field = this.options.field || null; + + this.on('after:render', function () { + this.renderFieldsHeader(); + if (!this.scope) { + this.renderDefaultPage(); + } else { + if (!this.field) { + this.openScope(this.scope); + } else { + this.openField(this.scope, this.field); + } + } + }); + }, - openScope: function (scope) { - this.scope = scope; - this.field = null; - - this.getRouter().navigate('#Admin/fieldManager/scope=' + scope, {trigger: false}); - - this.notify('Loading...'); - this.createView('content', 'Admin.FieldManager.List', { - el: '#fields-content', - scope: scope, - }, function (view) { - this.renderFieldsHeader(); - view.render(); - this.notify(false); - $(window).scrollTop(0); - }.bind(this)); - }, - - openField: function (scope, field) { - this.scope = scope; - this.field = field - - this.getRouter().navigate('#Admin/fieldManager/scope=' + scope + '&field=' + field, {trigger: false}); - - this.notify('Loading...'); - this.createView('content', 'Admin.FieldManager.Edit', { - el: '#fields-content', - scope: scope, - field: field, - }, function (view) { - this.renderFieldsHeader(); - view.render(); - this.notify(false); - $(window).scrollTop(0); - }.bind(this)); - }, - - createField: function (scope, type) { - this.scope = scope; - this.type = type; - - this.getRouter().navigate('#Admin/fieldManager/scope=' + scope + '&type=' + type + '&create=true', {trigger: false}); - - this.notify('Loading...'); - this.createView('content', 'Admin.FieldManager.Edit', { - el: '#fields-content', - scope: scope, - type: type, - }, function (view) { - this.renderFieldsHeader(); - view.render(); - this.notify(false); - $(window).scrollTop(0); - }.bind(this)); - }, + openScope: function (scope) { + this.scope = scope; + this.field = null; + + this.getRouter().navigate('#Admin/fieldManager/scope=' + scope, {trigger: false}); + + this.notify('Loading...'); + this.createView('content', 'Admin.FieldManager.List', { + el: '#fields-content', + scope: scope, + }, function (view) { + this.renderFieldsHeader(); + view.render(); + this.notify(false); + $(window).scrollTop(0); + }.bind(this)); + }, + + openField: function (scope, field) { + this.scope = scope; + this.field = field + + this.getRouter().navigate('#Admin/fieldManager/scope=' + scope + '&field=' + field, {trigger: false}); + + this.notify('Loading...'); + this.createView('content', 'Admin.FieldManager.Edit', { + el: '#fields-content', + scope: scope, + field: field, + }, function (view) { + this.renderFieldsHeader(); + view.render(); + this.notify(false); + $(window).scrollTop(0); + }.bind(this)); + }, + + createField: function (scope, type) { + this.scope = scope; + this.type = type; + + this.getRouter().navigate('#Admin/fieldManager/scope=' + scope + '&type=' + type + '&create=true', {trigger: false}); + + this.notify('Loading...'); + this.createView('content', 'Admin.FieldManager.Edit', { + el: '#fields-content', + scope: scope, + type: type, + }, function (view) { + this.renderFieldsHeader(); + view.render(); + this.notify(false); + $(window).scrollTop(0); + }.bind(this)); + }, - renderDefaultPage: function () { - $('#fields-header').html('').hide(); - $('#fields-content').html(this.translate('selectEntityType', 'messages', 'Admin')); - }, + renderDefaultPage: function () { + $('#fields-header').html('').hide(); + $('#fields-content').html(this.translate('selectEntityType', 'messages', 'Admin')); + }, - renderFieldsHeader: function () { - if (!this.scope) { - $('#fields-header').html(''); - return; - } - - if (this.field) { - $('#fields-header').show().html('' + this.getLanguage().translate(this.scope, 'scopeNamesPlural') + ' » ' + this.field); - } else { - $('#fields-header').show().html(this.getLanguage().translate(this.scope, 'scopeNamesPlural')); - } - }, + renderFieldsHeader: function () { + if (!this.scope) { + $('#fields-header').html(''); + return; + } + + if (this.field) { + $('#fields-header').show().html('' + this.getLanguage().translate(this.scope, 'scopeNamesPlural') + ' » ' + this.field); + } else { + $('#fields-header').show().html(this.getLanguage().translate(this.scope, 'scopeNamesPlural')); + } + }, - updatePageTitle: function () { - this.setPageTitle(this.getLanguage().translate('Field Manager')); - }, - }); + updatePageTitle: function () { + this.setPageTitle(this.getLanguage().translate('Field Manager')); + }, + }); }); diff --git a/frontend/client/src/views/admin/field-manager/list.js b/frontend/client/src/views/admin/field-manager/list.js index 8c71a8ffcc..a65757dc43 100644 --- a/frontend/client/src/views/admin/field-manager/list.js +++ b/frontend/client/src/views/admin/field-manager/list.js @@ -20,82 +20,82 @@ ************************************************************************/ Espo.define('Views.Admin.FieldManager.List', 'View', function (Dep) { - - return Dep.extend({ - - template: 'admin.field-manager.list', - - data: function () { - return { - scope: this.scope, - fieldDefsArray: this.fieldDefsArray, - typeList: this.typeList - }; - }, - - events: { - 'click [data-action="removeField"]': function (e) { - var field = $(e.currentTarget).data('name'); - - if (confirm(this.translate('confirmation', 'messages'))) { - this.notify('Removing...'); - $.ajax({ - url: 'Admin/fieldManager/' + this.scope + '/' + field, - type: 'DELETE', - success: function () { - this.notify('Removed', 'success'); - var data = this.getMetadata().data; - delete data['entityDefs'][this.scope]['fields'][field]; - this.getMetadata().storeToCache(); - $(e.currentTarget).closest('tr').remove(); - }.bind(this), - }); - } - } - }, - - setup: function () { - this.scope = this.options.scope; - - this.typeList = []; - - var fieldDefs = this.getMetadata().get('fields'); - - Object.keys(this.getMetadata().get('fields')).forEach(function (type) { - if (type in fieldDefs) { - if (!fieldDefs[type].notCreatable) { - this.typeList.push(type); - } - } - }, this); - - - - - - this.wait(true); - this.getModelFactory().create(this.scope, function (model) { - - this.fields = model.defs.fields; - - this.fieldList = Object.keys(this.fields).sort(); - - this.fieldDefsArray = []; - this.fieldList.forEach(function (field) { - var defs = this.fields[field]; - this.fieldDefsArray.push({ - name: field, - isCustom: defs.isCustom || false, - type: defs.type - }); - }, this); + + return Dep.extend({ + + template: 'admin.field-manager.list', + + data: function () { + return { + scope: this.scope, + fieldDefsArray: this.fieldDefsArray, + typeList: this.typeList + }; + }, + + events: { + 'click [data-action="removeField"]': function (e) { + var field = $(e.currentTarget).data('name'); + + if (confirm(this.translate('confirmation', 'messages'))) { + this.notify('Removing...'); + $.ajax({ + url: 'Admin/fieldManager/' + this.scope + '/' + field, + type: 'DELETE', + success: function () { + this.notify('Removed', 'success'); + var data = this.getMetadata().data; + delete data['entityDefs'][this.scope]['fields'][field]; + this.getMetadata().storeToCache(); + $(e.currentTarget).closest('tr').remove(); + }.bind(this), + }); + } + } + }, + + setup: function () { + this.scope = this.options.scope; + + this.typeList = []; + + var fieldDefs = this.getMetadata().get('fields'); + + Object.keys(this.getMetadata().get('fields')).forEach(function (type) { + if (type in fieldDefs) { + if (!fieldDefs[type].notCreatable) { + this.typeList.push(type); + } + } + }, this); + + + + + + this.wait(true); + this.getModelFactory().create(this.scope, function (model) { + + this.fields = model.defs.fields; + + this.fieldList = Object.keys(this.fields).sort(); + + this.fieldDefsArray = []; + this.fieldList.forEach(function (field) { + var defs = this.fields[field]; + this.fieldDefsArray.push({ + name: field, + isCustom: defs.isCustom || false, + type: defs.type + }); + }, this); - - this.wait(false); - }.bind(this)); - - }, - - }); + + this.wait(false); + }.bind(this)); + + }, + + }); }); diff --git a/frontend/client/src/views/admin/index.js b/frontend/client/src/views/admin/index.js index f0994524a4..db19ccfe53 100644 --- a/frontend/client/src/views/admin/index.js +++ b/frontend/client/src/views/admin/index.js @@ -19,24 +19,24 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Views.Admin.Index', 'View', function (Dep) { - - return Dep.extend({ - - template: 'admin.index', - - data: function () { - return { - links: this.links - }; - }, - - setup: function () { - this.links = this.getMetadata().get('app.adminPanel'); - }, - - updatePageTitle: function () { - this.setPageTitle(this.getLanguage().translate('Administration')); - }, - - }); + + return Dep.extend({ + + template: 'admin.index', + + data: function () { + return { + links: this.links + }; + }, + + setup: function () { + this.links = this.getMetadata().get('app.adminPanel'); + }, + + updatePageTitle: function () { + this.setPageTitle(this.getLanguage().translate('Administration')); + }, + + }); }); diff --git a/frontend/client/src/views/admin/integrations/edit.js b/frontend/client/src/views/admin/integrations/edit.js index 272bbbefa9..d456496e6f 100644 --- a/frontend/client/src/views/admin/integrations/edit.js +++ b/frontend/client/src/views/admin/integrations/edit.js @@ -20,155 +20,155 @@ ************************************************************************/ Espo.define('Views.Admin.Integrations.Edit', 'View', function (Dep) { - - return Dep.extend({ - - template: 'admin.integrations.edit', - - data: function () { - return { - integration: this.integration, - dataFieldList: this.dataFieldList, - helpText: this.helpText - }; - }, - - events: { - 'click button[data-action="cancel"]': function () { - this.getRouter().navigate('#Admin/integrations', {trigger: true}); - }, - 'click button[data-action="save"]': function () { - this.save(); - }, - }, - - setup: function () { - this.integration = this.options.integration; - - this.helpText = false; - if (this.getLanguage().has(this.integration, 'help', 'Integration')) { - this.helpText = this.translate(this.integration, 'help', 'Integration'); - } - - this.fieldList = []; - - this.dataFieldList = []; - - this.model = new Espo.Model(); - this.model.id = this.integration; - this.model.name = 'Integration'; - this.model.urlRoot = 'Integration'; - - this.model.defs = { - fields: { - enabled: { - required: true, - type: 'bool' - }, - } - }; - - this.wait(true); - - var fields = this.fields = this.getMetadata().get('integrations.' + this.integration + '.fields'); + + return Dep.extend({ + + template: 'admin.integrations.edit', + + data: function () { + return { + integration: this.integration, + dataFieldList: this.dataFieldList, + helpText: this.helpText + }; + }, + + events: { + 'click button[data-action="cancel"]': function () { + this.getRouter().navigate('#Admin/integrations', {trigger: true}); + }, + 'click button[data-action="save"]': function () { + this.save(); + }, + }, + + setup: function () { + this.integration = this.options.integration; + + this.helpText = false; + if (this.getLanguage().has(this.integration, 'help', 'Integration')) { + this.helpText = this.translate(this.integration, 'help', 'Integration'); + } + + this.fieldList = []; + + this.dataFieldList = []; + + this.model = new Espo.Model(); + this.model.id = this.integration; + this.model.name = 'Integration'; + this.model.urlRoot = 'Integration'; + + this.model.defs = { + fields: { + enabled: { + required: true, + type: 'bool' + }, + } + }; + + this.wait(true); + + var fields = this.fields = this.getMetadata().get('integrations.' + this.integration + '.fields'); - Object.keys(this.fields).forEach(function (name) { - this.model.defs.fields[name] = this.fields[name]; - this.dataFieldList.push(name); - }, this); - - this.model.populateDefaults(); - - this.listenToOnce(this.model, 'sync', function () { - this.createFieldView('bool', 'enabled'); - Object.keys(this.fields).forEach(function (name) { - this.createFieldView(this.fields[name]['type'], name, null, this.fields[name]); - }, this); - - this.wait(false); - }, this); - - this.model.fetch(); - }, - - hideField: function (name) { - this.$el.find('label.field-label-' + name).addClass('hide'); - this.$el.find('div.field-' + name).addClass('hide'); - var view = this.getView(name); - if (view) { - view.enabled = false; - } - }, - - showField: function (name) { - this.$el.find('label.field-label-' + name).removeClass('hide'); - this.$el.find('div.field-' + name).removeClass('hide'); - var view = this.getView(name); - if (view) { - view.enabled = true; - } - }, - - afterRender: function () { - if (!this.model.get('enabled')) { - this.dataFieldList.forEach(function (name) { - this.hideField(name); - }, this); - } - - this.listenTo(this.model, 'change:enabled', function () { - if (this.model.get('enabled')) { - this.dataFieldList.forEach(function (name) { - this.showField(name); - }, this); - } else { - this.dataFieldList.forEach(function (name) { - this.hideField(name); - }, this); - } - }, this); - }, - - createFieldView: function (type, name, readOnly, params) { - this.createView(name, this.getFieldManager().getViewName(type), { - model: this.model, - el: this.options.el + ' .field-' + name, - defs: { - name: name, - params: params - }, - mode: readOnly ? 'detail' : 'edit', - readOnly: readOnly, - }); - this.fieldList.push(name); - }, - - save: function () { - this.fieldList.forEach(function (field) { - var view = this.getView(field); - if (!view.readOnly) { - view.fetchToModel(); - } - }, this); - - var notValid = false; - this.fieldList.forEach(function (field) { - notValid = this.getView(field).validate() || notValid; - }, this); - - if (notValid) { - this.notify('Not valid', 'error'); - return; - } - - this.listenToOnce(this.model, 'sync', function () { - this.notify('Saved', 'success'); - }, this); - - this.notify('Saving...'); - this.model.save(); - }, - - }); + Object.keys(this.fields).forEach(function (name) { + this.model.defs.fields[name] = this.fields[name]; + this.dataFieldList.push(name); + }, this); + + this.model.populateDefaults(); + + this.listenToOnce(this.model, 'sync', function () { + this.createFieldView('bool', 'enabled'); + Object.keys(this.fields).forEach(function (name) { + this.createFieldView(this.fields[name]['type'], name, null, this.fields[name]); + }, this); + + this.wait(false); + }, this); + + this.model.fetch(); + }, + + hideField: function (name) { + this.$el.find('label.field-label-' + name).addClass('hide'); + this.$el.find('div.field-' + name).addClass('hide'); + var view = this.getView(name); + if (view) { + view.enabled = false; + } + }, + + showField: function (name) { + this.$el.find('label.field-label-' + name).removeClass('hide'); + this.$el.find('div.field-' + name).removeClass('hide'); + var view = this.getView(name); + if (view) { + view.enabled = true; + } + }, + + afterRender: function () { + if (!this.model.get('enabled')) { + this.dataFieldList.forEach(function (name) { + this.hideField(name); + }, this); + } + + this.listenTo(this.model, 'change:enabled', function () { + if (this.model.get('enabled')) { + this.dataFieldList.forEach(function (name) { + this.showField(name); + }, this); + } else { + this.dataFieldList.forEach(function (name) { + this.hideField(name); + }, this); + } + }, this); + }, + + createFieldView: function (type, name, readOnly, params) { + this.createView(name, this.getFieldManager().getViewName(type), { + model: this.model, + el: this.options.el + ' .field-' + name, + defs: { + name: name, + params: params + }, + mode: readOnly ? 'detail' : 'edit', + readOnly: readOnly, + }); + this.fieldList.push(name); + }, + + save: function () { + this.fieldList.forEach(function (field) { + var view = this.getView(field); + if (!view.readOnly) { + view.fetchToModel(); + } + }, this); + + var notValid = false; + this.fieldList.forEach(function (field) { + notValid = this.getView(field).validate() || notValid; + }, this); + + if (notValid) { + this.notify('Not valid', 'error'); + return; + } + + this.listenToOnce(this.model, 'sync', function () { + this.notify('Saved', 'success'); + }, this); + + this.notify('Saving...'); + this.model.save(); + }, + + }); }); diff --git a/frontend/client/src/views/admin/integrations/index.js b/frontend/client/src/views/admin/integrations/index.js index 8605dc398d..248a90b5dd 100644 --- a/frontend/client/src/views/admin/integrations/index.js +++ b/frontend/client/src/views/admin/integrations/index.js @@ -21,78 +21,78 @@ Espo.define('Views.Admin.Integrations.Index', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'admin.integrations.index', + template: 'admin.integrations.index', - integrationList: null, + integrationList: null, - integration: null, + integration: null, - data: function () { - return { - integrationList: this.integrationList, - integration: this.integration, - }; - }, + data: function () { + return { + integrationList: this.integrationList, + integration: this.integration, + }; + }, - events: { - 'click #integrations-menu a.integration-link': function (e) { - var name = $(e.currentTarget).data('name'); - this.openIntegration(name); - }, - }, + events: { + 'click #integrations-menu a.integration-link': function (e) { + var name = $(e.currentTarget).data('name'); + this.openIntegration(name); + }, + }, - setup: function () { - this.integrationList = Object.keys(this.getMetadata().get('integrations') || {});; + setup: function () { + this.integrationList = Object.keys(this.getMetadata().get('integrations') || {});; - this.integration = this.options.integration || null; - - this.on('after:render', function () { - this.renderHeader(); - if (!this.integration) { - this.renderDefaultPage(); - } else { - this.openIntegration(this.integration); - } - }); - }, + this.integration = this.options.integration || null; + + this.on('after:render', function () { + this.renderHeader(); + if (!this.integration) { + this.renderDefaultPage(); + } else { + this.openIntegration(this.integration); + } + }); + }, - openIntegration: function (integration) { - this.integration = integration; - - this.getRouter().navigate('#Admin/integrations/name=' + integration, {trigger: false}); - - var viewName = 'Admin.Integrations.' + this.getMetadata().get('integrations.' + integration + '.authMethod'); - this.notify('Loading...'); - this.createView('content', viewName, { - el: '#integration-content', - integration: integration, - }, function (view) { - this.renderHeader(); - view.render(); - this.notify(false); - $(window).scrollTop(0); - }.bind(this)); - }, + openIntegration: function (integration) { + this.integration = integration; + + this.getRouter().navigate('#Admin/integrations/name=' + integration, {trigger: false}); + + var viewName = 'Admin.Integrations.' + this.getMetadata().get('integrations.' + integration + '.authMethod'); + this.notify('Loading...'); + this.createView('content', viewName, { + el: '#integration-content', + integration: integration, + }, function (view) { + this.renderHeader(); + view.render(); + this.notify(false); + $(window).scrollTop(0); + }.bind(this)); + }, - renderDefaultPage: function () { - $('#integration-header').html('').hide(); - $('#integration-content').html(this.translate('selectIntegration', 'messages', 'Integration')); - }, + renderDefaultPage: function () { + $('#integration-header').html('').hide(); + $('#integration-content').html(this.translate('selectIntegration', 'messages', 'Integration')); + }, - renderHeader: function () { - if (!this.integration) { - $('#integration-header').html(''); - return; - } - $('#integration-header').show().html(this.integration); - }, + renderHeader: function () { + if (!this.integration) { + $('#integration-header').html(''); + return; + } + $('#integration-header').show().html(this.integration); + }, - updatePageTitle: function () { - this.setPageTitle(this.getLanguage().translate('Integrations', 'labels', 'Admin')); - }, - }); + updatePageTitle: function () { + this.setPageTitle(this.getLanguage().translate('Integrations', 'labels', 'Admin')); + }, + }); }); diff --git a/frontend/client/src/views/admin/integrations/oauth2.js b/frontend/client/src/views/admin/integrations/oauth2.js index 87377f5782..353e073470 100644 --- a/frontend/client/src/views/admin/integrations/oauth2.js +++ b/frontend/client/src/views/admin/integrations/oauth2.js @@ -20,19 +20,19 @@ ************************************************************************/ Espo.define('Views.Admin.Integrations.OAuth2', 'Views.Admin.Integrations.Edit', function (Dep) { - - return Dep.extend({ - - template: 'admin.integrations.oauth2', - - data: function () { - - return _.extend({ - // TODO fetch from server - redirectUri: this.getConfig().get('siteUrl') + '/oauthcallback' - }, Dep.prototype.data.call(this)); - }, - - }); + + return Dep.extend({ + + template: 'admin.integrations.oauth2', + + data: function () { + + return _.extend({ + // TODO fetch from server + redirectUri: this.getConfig().get('siteUrl') + '/oauthcallback' + }, Dep.prototype.data.call(this)); + }, + + }); }); diff --git a/frontend/client/src/views/admin/layouts/base.js b/frontend/client/src/views/admin/layouts/base.js index f22e383dd7..44f15949f1 100644 --- a/frontend/client/src/views/admin/layouts/base.js +++ b/frontend/client/src/views/admin/layouts/base.js @@ -19,155 +19,155 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ -Espo.define('Views.Admin.Layouts.Base', 'View', function (Dep) { +Espo.define('Views.Admin.Layouts.Base', 'View', function (Dep) { - return Dep.extend({ - - scope: null, - - type: null, - - events: { - 'click button[data-action="save"]': function () { - this.disableButtons(); - this.notify('Saving...'); - this.save(this.enableButtons.bind(this)); - }, - 'click button[data-action="cancel"]': function () { - this.getRouter().navigate('#Admin/layouts', {trigger: true}); - }, - }, - - buttons: [ - { - name: 'save', - label: 'Save', - style: 'primary', - }, - { - name: 'cancel', - label: 'Cancel', - } - ], - - dataAttributes: null, - - dataAttributesDefs: null, - - disableButtons: function () { - this.$el.find('.button-container button').attr('disabled', true); - }, - - enableButtons: function () { - this.$el.find('.button-container button').removeAttr('disabled'); - }, - - save: function (callback) { - var layout = this.fetch(); - - if (!this.validate(layout)) { - this.enableButtons(); - return false; - } - - this.getHelper().layoutManager.set(this.scope, this.type, layout, function () { - this.notify('Saved', 'success', 2000); - - if (typeof callback == 'function') { - callback(); - } - }.bind(this)); - }, - - cancel: function () { - this.loadLayout(function () { - this.render(); - }.bind(this)); - }, - - reset: function () { - this.render(); - }, - - fetch: function () {}, - - setup: function () { - this.dataAttributes = _.clone(this.dataAttributes); - this.buttons = _.clone(this.buttons); - this.events = _.clone(this.events); - this.scope = this.options.scope; - this.type = this.options.type; - }, - - unescape: function (string) { - if (string == null) { - return ''; - } - - var map = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; - var reg = new RegExp('(' + _.keys(map).join('|') + ')', 'g'); + return Dep.extend({ + + scope: null, + + type: null, + + events: { + 'click button[data-action="save"]': function () { + this.disableButtons(); + this.notify('Saving...'); + this.save(this.enableButtons.bind(this)); + }, + 'click button[data-action="cancel"]': function () { + this.getRouter().navigate('#Admin/layouts', {trigger: true}); + }, + }, + + buttons: [ + { + name: 'save', + label: 'Save', + style: 'primary', + }, + { + name: 'cancel', + label: 'Cancel', + } + ], + + dataAttributes: null, + + dataAttributesDefs: null, + + disableButtons: function () { + this.$el.find('.button-container button').attr('disabled', true); + }, + + enableButtons: function () { + this.$el.find('.button-container button').removeAttr('disabled'); + }, + + save: function (callback) { + var layout = this.fetch(); + + if (!this.validate(layout)) { + this.enableButtons(); + return false; + } + + this.getHelper().layoutManager.set(this.scope, this.type, layout, function () { + this.notify('Saved', 'success', 2000); + + if (typeof callback == 'function') { + callback(); + } + }.bind(this)); + }, + + cancel: function () { + this.loadLayout(function () { + this.render(); + }.bind(this)); + }, + + reset: function () { + this.render(); + }, + + fetch: function () {}, + + setup: function () { + this.dataAttributes = _.clone(this.dataAttributes); + this.buttons = _.clone(this.buttons); + this.events = _.clone(this.events); + this.scope = this.options.scope; + this.type = this.options.type; + }, + + unescape: function (string) { + if (string == null) { + return ''; + } + + var map = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + var reg = new RegExp('(' + _.keys(map).join('|') + ')', 'g'); - return ('' + string).replace(reg, function (match) { - return map[match]; - }); - }, - - openEditDialog: function (data) { - var tpl = this.unescape($("#edit-dialog-tpl").html()); - - var dialog = new Espo.Ui.Dialog({ - header: 'Field: ' + data.name, - body: _.template(tpl, data), - buttons: [ - { - name: 'ok', - text: '  Ok  ', - onClick: function (dialog) { - var o = this.parseDataAttributes(dialog); - var li = $("#layout ul > li[data-name='" + data.name + "']"); - for (var key in o) { - li.attr('data-' + key, o[key]); - li.data(key, o[key]); - li.find('.' + key + '-value').text(o[key]); - } - dialog.close(); - }.bind(this), - }, - { - name: 'cancel', - text: 'Cancel', - onClick: function (dialog) { - dialog.close(); - } - } - ] - }); - - this.dataAttributes.forEach(function (attr) { - var type = this.dataAttributesDefs[attr] || 'text'; - var value = data[attr]; - if (type == 'bool') { - if (value) { - value = "true"; - } - } - dialog.$el.find("[name='"+attr+"']").val(value); - }.bind(this)); - - dialog.show(); - }, - - parseDataAttributes: function () {}, - - validate: function (layout) { - return true; - }, - }); + return ('' + string).replace(reg, function (match) { + return map[match]; + }); + }, + + openEditDialog: function (data) { + var tpl = this.unescape($("#edit-dialog-tpl").html()); + + var dialog = new Espo.Ui.Dialog({ + header: 'Field: ' + data.name, + body: _.template(tpl, data), + buttons: [ + { + name: 'ok', + text: '  Ok  ', + onClick: function (dialog) { + var o = this.parseDataAttributes(dialog); + var li = $("#layout ul > li[data-name='" + data.name + "']"); + for (var key in o) { + li.attr('data-' + key, o[key]); + li.data(key, o[key]); + li.find('.' + key + '-value').text(o[key]); + } + dialog.close(); + }.bind(this), + }, + { + name: 'cancel', + text: 'Cancel', + onClick: function (dialog) { + dialog.close(); + } + } + ] + }); + + this.dataAttributes.forEach(function (attr) { + var type = this.dataAttributesDefs[attr] || 'text'; + var value = data[attr]; + if (type == 'bool') { + if (value) { + value = "true"; + } + } + dialog.$el.find("[name='"+attr+"']").val(value); + }.bind(this)); + + dialog.show(); + }, + + parseDataAttributes: function () {}, + + validate: function (layout) { + return true; + }, + }); }); diff --git a/frontend/client/src/views/admin/layouts/detail-convert.js b/frontend/client/src/views/admin/layouts/detail-convert.js index 266295abd6..ed6032a176 100644 --- a/frontend/client/src/views/admin/layouts/detail-convert.js +++ b/frontend/client/src/views/admin/layouts/detail-convert.js @@ -18,12 +18,12 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.DetailConvert', 'Views.Admin.Layouts.Detail', function (Dep) { + +Espo.define('Views.Admin.Layouts.DetailConvert', 'Views.Admin.Layouts.Detail', function (Dep) { - return Dep.extend({ - - - }); + return Dep.extend({ + + + }); }); diff --git a/frontend/client/src/views/admin/layouts/detail-small.js b/frontend/client/src/views/admin/layouts/detail-small.js index ba143ce0b5..6a0ace1019 100644 --- a/frontend/client/src/views/admin/layouts/detail-small.js +++ b/frontend/client/src/views/admin/layouts/detail-small.js @@ -18,13 +18,13 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.DetailSmall', 'Views.Admin.Layouts.Detail', function (Dep) { + +Espo.define('Views.Admin.Layouts.DetailSmall', 'Views.Admin.Layouts.Detail', function (Dep) { - return Dep.extend({ - - columnCount: 1, - - }); + return Dep.extend({ + + columnCount: 1, + + }); }); diff --git a/frontend/client/src/views/admin/layouts/detail.js b/frontend/client/src/views/admin/layouts/detail.js index b25cd05479..de382e0525 100644 --- a/frontend/client/src/views/admin/layouts/detail.js +++ b/frontend/client/src/views/admin/layouts/detail.js @@ -18,79 +18,79 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.Detail', 'Views.Admin.Layouts.Grid', function (Dep) { + +Espo.define('Views.Admin.Layouts.Detail', 'Views.Admin.Layouts.Grid', function (Dep) { - return Dep.extend({ - - dataAttributes: ['name', 'fullWidth'], - - dataAttributesDefs: { - fullWidth: 'bool', - }, - - ignoreList: ['modifiedAt', 'createdAt', 'modifiedBy', 'createdBy', 'assignedUser', 'teams'], - - setup: function () { - Dep.prototype.setup.call(this); - - this.wait(true); - this.loadLayout(function () { - this.wait(false); - }.bind(this)); - }, - - loadLayout: function (callback) { - this.getModelFactory().create(this.scope, function (model) { - this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { - this.readDataFromLayout(model, layout); - if (callback) { - callback(); - } - }.bind(this), false); - }.bind(this)); - }, - - readDataFromLayout: function (model, layout) { - var allFields = []; - for (var field in model.defs.fields) { - if (this.isFieldEnabled(model, field)) { - allFields.push(field); - } - } - - this.enabledFields = []; - this.disabledFields = []; - - this.panels = layout; - - layout.forEach(function (panel) { - panel.rows.forEach(function (row) { - row.forEach(function (cell, i) { - if (i == this.columnCount) { - return; - } - this.enabledFields.push(cell.name); - }.bind(this)); - }.bind(this)); - }.bind(this)); - - - allFields.sort(); - - for (var i in allFields) { - if (!_.contains(this.enabledFields, allFields[i])) { - this.disabledFields.push(allFields[i]); - } - } - }, - - isFieldEnabled: function (model, name) { - if (this.ignoreList.indexOf(name) != -1) { - return false; - } - return !model.getFieldParam(name, 'disabled'); - } - }); + return Dep.extend({ + + dataAttributes: ['name', 'fullWidth'], + + dataAttributesDefs: { + fullWidth: 'bool', + }, + + ignoreList: ['modifiedAt', 'createdAt', 'modifiedBy', 'createdBy', 'assignedUser', 'teams'], + + setup: function () { + Dep.prototype.setup.call(this); + + this.wait(true); + this.loadLayout(function () { + this.wait(false); + }.bind(this)); + }, + + loadLayout: function (callback) { + this.getModelFactory().create(this.scope, function (model) { + this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { + this.readDataFromLayout(model, layout); + if (callback) { + callback(); + } + }.bind(this), false); + }.bind(this)); + }, + + readDataFromLayout: function (model, layout) { + var allFields = []; + for (var field in model.defs.fields) { + if (this.isFieldEnabled(model, field)) { + allFields.push(field); + } + } + + this.enabledFields = []; + this.disabledFields = []; + + this.panels = layout; + + layout.forEach(function (panel) { + panel.rows.forEach(function (row) { + row.forEach(function (cell, i) { + if (i == this.columnCount) { + return; + } + this.enabledFields.push(cell.name); + }.bind(this)); + }.bind(this)); + }.bind(this)); + + + allFields.sort(); + + for (var i in allFields) { + if (!_.contains(this.enabledFields, allFields[i])) { + this.disabledFields.push(allFields[i]); + } + } + }, + + isFieldEnabled: function (model, name) { + if (this.ignoreList.indexOf(name) != -1) { + return false; + } + return !model.getFieldParam(name, 'disabled'); + } + }); }); diff --git a/frontend/client/src/views/admin/layouts/filters.js b/frontend/client/src/views/admin/layouts/filters.js index aa7b0992ba..964b1e5358 100644 --- a/frontend/client/src/views/admin/layouts/filters.js +++ b/frontend/client/src/views/admin/layouts/filters.js @@ -18,86 +18,86 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.Filters', 'Views.Admin.Layouts.Rows', function (Dep) { + +Espo.define('Views.Admin.Layouts.Filters', 'Views.Admin.Layouts.Rows', function (Dep) { - return Dep.extend({ - - dataAttributes: ['name'], - - editable: false, - - ignoreList: [], - - setup: function () { - Dep.prototype.setup.call(this); - - this.wait(true); - - this.getModelFactory().create(this.scope, function (model) { - this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { - - var allFields = []; - for (var field in model.defs.fields) { - if (this.checkFieldType(model.getFieldParam(field, 'type')) && this.isFieldEnabled(model, field)) { - allFields.push(field); - } - } - - this.enabledFieldsList = []; - - this.enabledFields = []; - this.disabledFields = []; - for (var i in layout) { - this.enabledFields.push({ - name: layout[i], - label: this.getLanguage().translate(layout[i], 'fields', this.scope) - }); - this.enabledFieldsList.push(layout[i]); - } - - for (var i in allFields) { - if (!_.contains(this.enabledFieldsList, allFields[i])) { - this.disabledFields.push({ - name: allFields[i], - label: this.getLanguage().translate(allFields[i], 'fields', this.scope) - }); - } - } - this.rowLayout = this.enabledFields; - - for (var i in this.rowLayout) { - this.rowLayout[i].label = this.getLanguage().translate(this.rowLayout[i].name, 'fields', this.scope); - } - - this.wait(false); - }.bind(this), false); - }.bind(this)); - }, - - fetch: function () { - var layout = []; - $("#layout ul.enabled > li").each(function (i, el) { - layout.push($(el).data('name')); - }.bind(this)); - return layout; - }, - - checkFieldType: function (type) { - return this.getFieldManager().checkFilter(type); - }, - - validate: function () { - return true; - }, - - isFieldEnabled: function (model, name) { - if (this.ignoreList.indexOf(name) != -1) { - return false; - } - return !model.getFieldParam(name, 'disabled'); - } - - }); + return Dep.extend({ + + dataAttributes: ['name'], + + editable: false, + + ignoreList: [], + + setup: function () { + Dep.prototype.setup.call(this); + + this.wait(true); + + this.getModelFactory().create(this.scope, function (model) { + this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { + + var allFields = []; + for (var field in model.defs.fields) { + if (this.checkFieldType(model.getFieldParam(field, 'type')) && this.isFieldEnabled(model, field)) { + allFields.push(field); + } + } + + this.enabledFieldsList = []; + + this.enabledFields = []; + this.disabledFields = []; + for (var i in layout) { + this.enabledFields.push({ + name: layout[i], + label: this.getLanguage().translate(layout[i], 'fields', this.scope) + }); + this.enabledFieldsList.push(layout[i]); + } + + for (var i in allFields) { + if (!_.contains(this.enabledFieldsList, allFields[i])) { + this.disabledFields.push({ + name: allFields[i], + label: this.getLanguage().translate(allFields[i], 'fields', this.scope) + }); + } + } + this.rowLayout = this.enabledFields; + + for (var i in this.rowLayout) { + this.rowLayout[i].label = this.getLanguage().translate(this.rowLayout[i].name, 'fields', this.scope); + } + + this.wait(false); + }.bind(this), false); + }.bind(this)); + }, + + fetch: function () { + var layout = []; + $("#layout ul.enabled > li").each(function (i, el) { + layout.push($(el).data('name')); + }.bind(this)); + return layout; + }, + + checkFieldType: function (type) { + return this.getFieldManager().checkFilter(type); + }, + + validate: function () { + return true; + }, + + isFieldEnabled: function (model, name) { + if (this.ignoreList.indexOf(name) != -1) { + return false; + } + return !model.getFieldParam(name, 'disabled'); + } + + }); }); diff --git a/frontend/client/src/views/admin/layouts/grid.js b/frontend/client/src/views/admin/layouts/grid.js index 68f64baa1a..a91f4d5627 100644 --- a/frontend/client/src/views/admin/layouts/grid.js +++ b/frontend/client/src/views/admin/layouts/grid.js @@ -18,281 +18,281 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.Grid', 'Views.Admin.Layouts.Base', function (Dep) { + +Espo.define('Views.Admin.Layouts.Grid', 'Views.Admin.Layouts.Base', function (Dep) { - return Dep.extend({ - - template: 'admin.layouts.grid', - - dataAttributes: null, - - panels: null, - - columnCount: 2, - - data: function () { - return { - scope: this.scope, - type: this.type, - buttons: this.buttons, - enabledFields: this.enabledFields, - disabledFields: this.disabledFields, - panels: this.panels, - columnCount: this.columnCount - }; - }, - - events: _.extend({ - 'click #layout a[data-action="addPanel"]': function () { - this.addPanel(); - this.makeDraggable(); - }, - 'click #layout a[data-action="removePanel"]': function (e) { - $(e.target).closest('ul.panels > li').find('ul.cells > li').each(function (i, li) { - if ($(li).attr('data-name')) { - $(li).appendTo($('#layout ul.disabled')); - } - }); - $(e.target).closest('ul.panels > li').remove(); - }, - 'click #layout a[data-action="addRow"]': function (e) { - var tpl = this.unescape($("#layout-row-tpl").html()); - var html = _.template(tpl); - $(e.target).closest('ul.panels > li').find('ul.rows').append(html); - this.makeDraggable(); - }, - 'click #layout a[data-action="removeRow"]': function (e) { - $(e.target).closest('ul.rows > li').find('ul.cells > li').each(function (i, li) { - if ($(li).attr('data-name')) { - $(li).appendTo($('#layout ul.disabled')); - } - }); - $(e.target).closest('ul.rows > li').remove(); - }, - 'click #layout a[data-action="removeField"]': function (e) { - var el = $(e.target).closest('li'); - var index = el.index(); - var parent = el.parent(); - - el.appendTo($("ul.disabled")); - - var empty = $('
  • '); - if (el.data('full-width')) { - for (var i = 0; i < this.columnCount; i++) { - parent.append(empty.clone()); - } - } else { - - if (index == 0) { - parent.prepend(empty); - } else { - empty.insertAfter(parent.children(':nth-child(' + index + ')')); - } - } - - el.data('full-width', null); - el.removeAttr('data-full-width'); - - this.makeDraggable(); - }, - 'click #layout a[data-action="minusCell"]': function (e) { - if (this.columnCount < 2) { - return; - } - $li = $(e.currentTarget).closest('li'); - $ul = $li.parent(); - - var count = 0; - - var isEmpty = false; - if ($ul.children('li:not(.empty)').size() == 0) { - isEmpty = true; - } - - $ul.children('li.empty').remove(); - $ul.children('li:not(:first-child)').remove(); - $ul.children('li').data('full-width', true).attr('data-full-width', true); - - if (isEmpty) { - $ul.append($('
  • ').data('full-width', true).attr('data-full-width', true)); - this.makeDraggable(); - } - - }, - 'click #layout a[data-action="edit-panel-label"]': function (e) { - var el = $(e.target).closest('header').children('label'); - var value = el.text(); - - var dialog = new Espo.Ui.Dialog({ - modal: true, - body: '', - buttons: [ - { - name: 'ok', - text: '  Ok  ', - onClick: function (dialog) { - el.text(dialog.$el.find('input[name="label"]').val()); - dialog.close(); - }.bind(this), - }, - { - name: 'cancel', - text: 'Cancel', - onClick: function (dialog) { - dialog.close(); - } - } - ] - }); - dialog.show(); - } - }, Dep.prototype.events), - - addPanel: function (data) { - var tpl = this.unescape($("#layout-panel-tpl").html()); - - var empty = false; - if (!data) { - empty = true; - } - - data = data || {label: 'new panel', rows: [[]]}; - - data.rows.forEach(function (row) { - var rest = this.columnCount - row.length; - - if (empty) { - for (var i = 0; i < rest; i++) { - row.push(false); - } - } - for (var i in row) { - if (row[i] != false) { - row[i].label = this.getLanguage().translate(row[i].name, 'fields', this.scope); - } - - } - }.bind(this)); - - - var html = _.template(tpl, data); - $("#layout .panels").append(html); - }, - - makeDraggable: function () { - $('#layout ul.panels').sortable({distance: 4}); - $('#layout ul.panels').disableSelection(); - - $('#layout ul.rows').sortable({ - distance: 4, - connectWith: '.rows', - }); - $('#layout ul.rows').disableSelection(); - - $('#layout ul.cells > li').draggable({revert: 'invalid', revertDuration: 200, zIndex: 10}).css('cursor', 'pointer'); - - $('#layout ul.cells > li').droppable().droppable('destroy'); - - var self = this; - $('#layout ul.cells:not(.disabled) > li').droppable({ - accept: '.cell', - zIndex: 10, - drop: function (e, ui) { - var index = ui.draggable.index(); - var parent = ui.draggable.parent(); - - if (parent.get(0) == $(this).parent().get(0)) { - if ($(this).index() < ui.draggable.index()) { - $(this).before(ui.draggable); - } else { - $(this).after(ui.draggable); - } - } else { - ui.draggable.insertAfter($(this)); - - if (index == 0) { - $(this).prependTo(parent); - } else { - $(this).insertAfter(parent.children(':nth-child(' + (index) + ')')); - } - } - - if ($(this).data('full-width')) { - $(ui.draggable).data('full-width', true).attr('data-full-width', true); - } - - ui.draggable.css({ - top: 0, - left: 0, - }); - - if ($(this).parent().hasClass('disabled') && !$(this).data('name')) { - $(this).remove(); - } - - self.makeDraggable(); - } - }); - }, - - afterRender: function () { - this.panels.forEach(function (panel) { - this.addPanel(panel); - }.bind(this)); - this.makeDraggable(); - }, - - fetch: function () { - var layout = []; - var self = this; - $("#layout ul.panels > li").each(function () { - var o = { - label: $(this).find('header label').text(), - rows: [] - }; - $(this).find('ul.rows > li').each(function (i, li) { - var row = []; - $(li).find('ul.cells > li').each(function (i, li) { - var cell = false; - if (!$(li).hasClass('empty')) { - cell = {}; - self.dataAttributes.forEach(function (attr) { - var value = $(li).data(Espo.Utils.toDom(attr)) || null; - if (value) { - cell[attr] = value; - } - }); - } - row.push(cell); - }); - o.rows.push(row); - }); - - layout.push(o); - }); - - return layout; - }, - - validate: function (layout) { - var fieldCount = 0; - layout.forEach(function (panel) { - panel.rows.forEach(function (row) { - row.forEach(function (cell) { - if (cell != false) { - fieldCount++; - } - }); - }); - }); - if (fieldCount == 0) { - alert('Layout cannot be empty.'); - return false; - } - return true; - }, - }); + return Dep.extend({ + + template: 'admin.layouts.grid', + + dataAttributes: null, + + panels: null, + + columnCount: 2, + + data: function () { + return { + scope: this.scope, + type: this.type, + buttons: this.buttons, + enabledFields: this.enabledFields, + disabledFields: this.disabledFields, + panels: this.panels, + columnCount: this.columnCount + }; + }, + + events: _.extend({ + 'click #layout a[data-action="addPanel"]': function () { + this.addPanel(); + this.makeDraggable(); + }, + 'click #layout a[data-action="removePanel"]': function (e) { + $(e.target).closest('ul.panels > li').find('ul.cells > li').each(function (i, li) { + if ($(li).attr('data-name')) { + $(li).appendTo($('#layout ul.disabled')); + } + }); + $(e.target).closest('ul.panels > li').remove(); + }, + 'click #layout a[data-action="addRow"]': function (e) { + var tpl = this.unescape($("#layout-row-tpl").html()); + var html = _.template(tpl); + $(e.target).closest('ul.panels > li').find('ul.rows').append(html); + this.makeDraggable(); + }, + 'click #layout a[data-action="removeRow"]': function (e) { + $(e.target).closest('ul.rows > li').find('ul.cells > li').each(function (i, li) { + if ($(li).attr('data-name')) { + $(li).appendTo($('#layout ul.disabled')); + } + }); + $(e.target).closest('ul.rows > li').remove(); + }, + 'click #layout a[data-action="removeField"]': function (e) { + var el = $(e.target).closest('li'); + var index = el.index(); + var parent = el.parent(); + + el.appendTo($("ul.disabled")); + + var empty = $('
  • '); + if (el.data('full-width')) { + for (var i = 0; i < this.columnCount; i++) { + parent.append(empty.clone()); + } + } else { + + if (index == 0) { + parent.prepend(empty); + } else { + empty.insertAfter(parent.children(':nth-child(' + index + ')')); + } + } + + el.data('full-width', null); + el.removeAttr('data-full-width'); + + this.makeDraggable(); + }, + 'click #layout a[data-action="minusCell"]': function (e) { + if (this.columnCount < 2) { + return; + } + $li = $(e.currentTarget).closest('li'); + $ul = $li.parent(); + + var count = 0; + + var isEmpty = false; + if ($ul.children('li:not(.empty)').size() == 0) { + isEmpty = true; + } + + $ul.children('li.empty').remove(); + $ul.children('li:not(:first-child)').remove(); + $ul.children('li').data('full-width', true).attr('data-full-width', true); + + if (isEmpty) { + $ul.append($('
  • ').data('full-width', true).attr('data-full-width', true)); + this.makeDraggable(); + } + + }, + 'click #layout a[data-action="edit-panel-label"]': function (e) { + var el = $(e.target).closest('header').children('label'); + var value = el.text(); + + var dialog = new Espo.Ui.Dialog({ + modal: true, + body: '', + buttons: [ + { + name: 'ok', + text: '  Ok  ', + onClick: function (dialog) { + el.text(dialog.$el.find('input[name="label"]').val()); + dialog.close(); + }.bind(this), + }, + { + name: 'cancel', + text: 'Cancel', + onClick: function (dialog) { + dialog.close(); + } + } + ] + }); + dialog.show(); + } + }, Dep.prototype.events), + + addPanel: function (data) { + var tpl = this.unescape($("#layout-panel-tpl").html()); + + var empty = false; + if (!data) { + empty = true; + } + + data = data || {label: 'new panel', rows: [[]]}; + + data.rows.forEach(function (row) { + var rest = this.columnCount - row.length; + + if (empty) { + for (var i = 0; i < rest; i++) { + row.push(false); + } + } + for (var i in row) { + if (row[i] != false) { + row[i].label = this.getLanguage().translate(row[i].name, 'fields', this.scope); + } + + } + }.bind(this)); + + + var html = _.template(tpl, data); + $("#layout .panels").append(html); + }, + + makeDraggable: function () { + $('#layout ul.panels').sortable({distance: 4}); + $('#layout ul.panels').disableSelection(); + + $('#layout ul.rows').sortable({ + distance: 4, + connectWith: '.rows', + }); + $('#layout ul.rows').disableSelection(); + + $('#layout ul.cells > li').draggable({revert: 'invalid', revertDuration: 200, zIndex: 10}).css('cursor', 'pointer'); + + $('#layout ul.cells > li').droppable().droppable('destroy'); + + var self = this; + $('#layout ul.cells:not(.disabled) > li').droppable({ + accept: '.cell', + zIndex: 10, + drop: function (e, ui) { + var index = ui.draggable.index(); + var parent = ui.draggable.parent(); + + if (parent.get(0) == $(this).parent().get(0)) { + if ($(this).index() < ui.draggable.index()) { + $(this).before(ui.draggable); + } else { + $(this).after(ui.draggable); + } + } else { + ui.draggable.insertAfter($(this)); + + if (index == 0) { + $(this).prependTo(parent); + } else { + $(this).insertAfter(parent.children(':nth-child(' + (index) + ')')); + } + } + + if ($(this).data('full-width')) { + $(ui.draggable).data('full-width', true).attr('data-full-width', true); + } + + ui.draggable.css({ + top: 0, + left: 0, + }); + + if ($(this).parent().hasClass('disabled') && !$(this).data('name')) { + $(this).remove(); + } + + self.makeDraggable(); + } + }); + }, + + afterRender: function () { + this.panels.forEach(function (panel) { + this.addPanel(panel); + }.bind(this)); + this.makeDraggable(); + }, + + fetch: function () { + var layout = []; + var self = this; + $("#layout ul.panels > li").each(function () { + var o = { + label: $(this).find('header label').text(), + rows: [] + }; + $(this).find('ul.rows > li').each(function (i, li) { + var row = []; + $(li).find('ul.cells > li').each(function (i, li) { + var cell = false; + if (!$(li).hasClass('empty')) { + cell = {}; + self.dataAttributes.forEach(function (attr) { + var value = $(li).data(Espo.Utils.toDom(attr)) || null; + if (value) { + cell[attr] = value; + } + }); + } + row.push(cell); + }); + o.rows.push(row); + }); + + layout.push(o); + }); + + return layout; + }, + + validate: function (layout) { + var fieldCount = 0; + layout.forEach(function (panel) { + panel.rows.forEach(function (row) { + row.forEach(function (cell) { + if (cell != false) { + fieldCount++; + } + }); + }); + }); + if (fieldCount == 0) { + alert('Layout cannot be empty.'); + return false; + } + return true; + }, + }); }); diff --git a/frontend/client/src/views/admin/layouts/index.js b/frontend/client/src/views/admin/layouts/index.js index 4fc346baa7..3caf61f321 100644 --- a/frontend/client/src/views/admin/layouts/index.js +++ b/frontend/client/src/views/admin/layouts/index.js @@ -21,123 +21,123 @@ Espo.define('Views.Admin.Layouts.Index', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'admin.layouts.index', + template: 'admin.layouts.index', - scopeList: null, + scopeList: null, - typeList: ['list', 'detail', 'listSmall', 'detailSmall', 'filters', 'massUpdate', 'relationships'], - - additionalLayouts: { - 'Opportunity': ['detailConvert'], - 'Contact': ['detailConvert'], - 'Account': ['detailConvert'], - }, + typeList: ['list', 'detail', 'listSmall', 'detailSmall', 'filters', 'massUpdate', 'relationships'], + + additionalLayouts: { + 'Opportunity': ['detailConvert'], + 'Contact': ['detailConvert'], + 'Account': ['detailConvert'], + }, - scope: null, + scope: null, - type: null, + type: null, - data: function () { - return { - scopeList: this.scopeList, - typeList: this.typeList, - scope: this.scope, - layoutScopeDataList: (function () { - var dataList = []; - this.scopeList.forEach(function (scope) { - var d = {}; - d.scope = scope; - d.typeList = _.clone(this.typeList); - (this.additionalLayouts[scope] || []).forEach(function (item) { - d.typeList.push(item); - }); - - dataList.push(d); - }, this); - return dataList; - }).call(this) - }; - }, + data: function () { + return { + scopeList: this.scopeList, + typeList: this.typeList, + scope: this.scope, + layoutScopeDataList: (function () { + var dataList = []; + this.scopeList.forEach(function (scope) { + var d = {}; + d.scope = scope; + d.typeList = _.clone(this.typeList); + (this.additionalLayouts[scope] || []).forEach(function (item) { + d.typeList.push(item); + }); + + dataList.push(d); + }, this); + return dataList; + }).call(this) + }; + }, - events: { - 'click #layouts-menu button.layout-link': function (e) { - var scope = $(e.currentTarget).data('scope'); - var type = $(e.currentTarget).data('type'); - if (this.getView('content')) { - if (this.scope == scope && this.type == type) { - return; - } - } - $("#layouts-menu button.layout-link").removeClass('disabled'); - $(e.target).addClass('disabled'); - this.openLayout(scope, type); - }, - }, + events: { + 'click #layouts-menu button.layout-link': function (e) { + var scope = $(e.currentTarget).data('scope'); + var type = $(e.currentTarget).data('type'); + if (this.getView('content')) { + if (this.scope == scope && this.type == type) { + return; + } + } + $("#layouts-menu button.layout-link").removeClass('disabled'); + $(e.target).addClass('disabled'); + this.openLayout(scope, type); + }, + }, - setup: function () { - this.scopeList = []; - var scopesAll = Object.keys(this.getMetadata().get('scopes')).sort(); - scopesAll.forEach(function (scope) { - if (this.getMetadata().get('scopes.' + scope + '.entity') && - this.getMetadata().get('scopes.' + scope + '.layouts')) { - this.scopeList.push(scope); - } - }.bind(this)); + setup: function () { + this.scopeList = []; + var scopesAll = Object.keys(this.getMetadata().get('scopes')).sort(); + scopesAll.forEach(function (scope) { + if (this.getMetadata().get('scopes.' + scope + '.entity') && + this.getMetadata().get('scopes.' + scope + '.layouts')) { + this.scopeList.push(scope); + } + }.bind(this)); - this.on('after:render', function () { - $("#layouts-menu button[data-scope='" + this.options.scope + "'][data-type='" + this.options.type + "']").addClass('disabled'); - this.renderLayoutHeader(); - if (!this.options.scope) { - this.renderDefaultPage(); - } - if (this.scope) { - this.openLayout(this.options.scope, this.options.type); - } - }); + this.on('after:render', function () { + $("#layouts-menu button[data-scope='" + this.options.scope + "'][data-type='" + this.options.type + "']").addClass('disabled'); + this.renderLayoutHeader(); + if (!this.options.scope) { + this.renderDefaultPage(); + } + if (this.scope) { + this.openLayout(this.options.scope, this.options.type); + } + }); - this.scope = this.options.scope || null; - this.type = this.options.type || null; - }, + this.scope = this.options.scope || null; + this.type = this.options.type || null; + }, - openLayout: function (scope, type) { - this.scope = scope; - this.type = type; + openLayout: function (scope, type) { + this.scope = scope; + this.type = type; - this.getRouter().navigate('#Admin/layouts/scope=' + scope + '&type=' + type, {trigger: false}); + this.getRouter().navigate('#Admin/layouts/scope=' + scope + '&type=' + type, {trigger: false}); - this.notify('Loading...'); + this.notify('Loading...'); - this.createView('content', 'Admin.Layouts.' + Espo.Utils.upperCaseFirst(type), { - el: '#layout-content', - scope: scope, - type: type, - }, function (view) { - this.renderLayoutHeader(); - view.render(); - this.notify(false); - $(window).scrollTop(0); - }.bind(this)); - }, + this.createView('content', 'Admin.Layouts.' + Espo.Utils.upperCaseFirst(type), { + el: '#layout-content', + scope: scope, + type: type, + }, function (view) { + this.renderLayoutHeader(); + view.render(); + this.notify(false); + $(window).scrollTop(0); + }.bind(this)); + }, - renderDefaultPage: function () { - $("#layout-header").html('').hide(); - $("#layout-content").html(this.translate('selectLayout', 'messages', 'Admin')); - }, + renderDefaultPage: function () { + $("#layout-header").html('').hide(); + $("#layout-content").html(this.translate('selectLayout', 'messages', 'Admin')); + }, - renderLayoutHeader: function () { - if (!this.scope) { - $("#layout-header").html(""); - return; - } - $("#layout-header").show().html(this.getLanguage().translate(this.scope, 'scopeNamesPlural') + " » " + this.getLanguage().translate(this.type, 'layouts', 'Admin')); - }, + renderLayoutHeader: function () { + if (!this.scope) { + $("#layout-header").html(""); + return; + } + $("#layout-header").show().html(this.getLanguage().translate(this.scope, 'scopeNamesPlural') + " » " + this.getLanguage().translate(this.type, 'layouts', 'Admin')); + }, - updatePageTitle: function () { - this.setPageTitle(this.getLanguage().translate('Layout Manager')); - }, - }); + updatePageTitle: function () { + this.setPageTitle(this.getLanguage().translate('Layout Manager')); + }, + }); }); diff --git a/frontend/client/src/views/admin/layouts/list-small.js b/frontend/client/src/views/admin/layouts/list-small.js index a63d58ee07..d163c5d135 100644 --- a/frontend/client/src/views/admin/layouts/list-small.js +++ b/frontend/client/src/views/admin/layouts/list-small.js @@ -18,11 +18,11 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.ListSmall', 'Views.Admin.Layouts.List', function (Dep) { + +Espo.define('Views.Admin.Layouts.ListSmall', 'Views.Admin.Layouts.List', function (Dep) { - return Dep.extend({ - }); + return Dep.extend({ + }); }); diff --git a/frontend/client/src/views/admin/layouts/list.js b/frontend/client/src/views/admin/layouts/list.js index 644c225998..b0642fad7c 100644 --- a/frontend/client/src/views/admin/layouts/list.js +++ b/frontend/client/src/views/admin/layouts/list.js @@ -18,108 +18,108 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.List', 'Views.Admin.Layouts.Rows', function (Dep) { + +Espo.define('Views.Admin.Layouts.List', 'Views.Admin.Layouts.Rows', function (Dep) { - return Dep.extend({ - - dataAttributes: ['name', 'width', 'link'], - - dataAttributesDefs: { - link: 'bool', - width: 'text', - }, - - editable: true, - - ignoreList: [], - - setup: function () { - Dep.prototype.setup.call(this); - - this.wait(true); - this.loadLayout(function () { - this.wait(false); - }.bind(this)); - }, - - loadLayout: function (callback) { - this.getModelFactory().create(Espo.Utils.hyphenToUpperCamelCase(this.scope), function (model) { - this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { - this.readDataFromLayout(model, layout); - if (callback) { - callback(); - } - }.bind(this), false); - }.bind(this)); - }, - - readDataFromLayout: function (model, layout) { - var allFields = []; - for (var field in model.defs.fields) { - if (this.checkFieldType(model.getFieldParam(field, 'type')) && this.isFieldEnabled(model, field)) { - - allFields.push(field); - } - } - - this.enabledFieldsList = []; - - this.enabledFields = []; - this.disabledFields = []; - - for (var i in layout) { - this.enabledFields.push({ - name: layout[i].name, - label: this.getLanguage().translate(layout[i].name, 'fields', this.scope) - }); - this.enabledFieldsList.push(layout[i].name); - } - - - - for (var i in allFields) { - if (!_.contains(this.enabledFieldsList, allFields[i])) { - this.disabledFields.push({ - name: allFields[i], - label: this.getLanguage().translate(allFields[i], 'fields', this.scope) - }); - } - } - - this.rowLayout = layout; - - for (var i in this.rowLayout) { - this.rowLayout[i].label = this.getLanguage().translate(this.rowLayout[i].name, 'fields', this.scope); - } - }, - - parseDataAttributes: function (dialog) { - var width = parseFloat(dialog.$el.find("[name='width']").val()); - if (isNaN(width) || width > 100 || width < 0) { - width = ''; - } - return { - width: width, - link: dialog.$el.find("[name='link']").val() - }; - }, - - checkFieldType: function (type) { - if (['linkMultiple'].indexOf(type) != -1) { - return false; - } - return true; - }, - - isFieldEnabled: function (model, name) { - if (this.ignoreList.indexOf(name) != -1) { - return false; - } - return !model.getFieldParam(name, 'disabled'); - } - - }); + return Dep.extend({ + + dataAttributes: ['name', 'width', 'link'], + + dataAttributesDefs: { + link: 'bool', + width: 'text', + }, + + editable: true, + + ignoreList: [], + + setup: function () { + Dep.prototype.setup.call(this); + + this.wait(true); + this.loadLayout(function () { + this.wait(false); + }.bind(this)); + }, + + loadLayout: function (callback) { + this.getModelFactory().create(Espo.Utils.hyphenToUpperCamelCase(this.scope), function (model) { + this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { + this.readDataFromLayout(model, layout); + if (callback) { + callback(); + } + }.bind(this), false); + }.bind(this)); + }, + + readDataFromLayout: function (model, layout) { + var allFields = []; + for (var field in model.defs.fields) { + if (this.checkFieldType(model.getFieldParam(field, 'type')) && this.isFieldEnabled(model, field)) { + + allFields.push(field); + } + } + + this.enabledFieldsList = []; + + this.enabledFields = []; + this.disabledFields = []; + + for (var i in layout) { + this.enabledFields.push({ + name: layout[i].name, + label: this.getLanguage().translate(layout[i].name, 'fields', this.scope) + }); + this.enabledFieldsList.push(layout[i].name); + } + + + + for (var i in allFields) { + if (!_.contains(this.enabledFieldsList, allFields[i])) { + this.disabledFields.push({ + name: allFields[i], + label: this.getLanguage().translate(allFields[i], 'fields', this.scope) + }); + } + } + + this.rowLayout = layout; + + for (var i in this.rowLayout) { + this.rowLayout[i].label = this.getLanguage().translate(this.rowLayout[i].name, 'fields', this.scope); + } + }, + + parseDataAttributes: function (dialog) { + var width = parseFloat(dialog.$el.find("[name='width']").val()); + if (isNaN(width) || width > 100 || width < 0) { + width = ''; + } + return { + width: width, + link: dialog.$el.find("[name='link']").val() + }; + }, + + checkFieldType: function (type) { + if (['linkMultiple'].indexOf(type) != -1) { + return false; + } + return true; + }, + + isFieldEnabled: function (model, name) { + if (this.ignoreList.indexOf(name) != -1) { + return false; + } + return !model.getFieldParam(name, 'disabled'); + } + + }); }); diff --git a/frontend/client/src/views/admin/layouts/mass-update.js b/frontend/client/src/views/admin/layouts/mass-update.js index 36ebdd6c9f..ece3944606 100644 --- a/frontend/client/src/views/admin/layouts/mass-update.js +++ b/frontend/client/src/views/admin/layouts/mass-update.js @@ -18,82 +18,82 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.MassUpdate', 'Views.Admin.Layouts.Rows', function (Dep) { + +Espo.define('Views.Admin.Layouts.MassUpdate', 'Views.Admin.Layouts.Rows', function (Dep) { - return Dep.extend({ - - dataAttributes: ['name'], - - editable: false, - - ignoreList: [], - - setup: function () { - Dep.prototype.setup.call(this); - - this.wait(true); - - this.getModelFactory().create(this.scope, function (model) { - this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { - - var allFields = []; - for (var field in model.defs.fields) { - if (!model.getFieldParam(field, 'readOnly') && this.isFieldEnabled(model, field)) { - allFields.push(field); - } - } - - this.enabledFieldsList = []; - - this.enabledFields = []; - this.disabledFields = []; - for (var i in layout) { - this.enabledFields.push({ - name: layout[i], - label: this.getLanguage().translate(layout[i], 'fields', this.scope) - }); - this.enabledFieldsList.push(layout[i]); - } - - for (var i in allFields) { - if (!_.contains(this.enabledFieldsList, allFields[i])) { - this.disabledFields.push({ - name: allFields[i], - label: this.getLanguage().translate(allFields[i], 'fields', this.scope) - }); - } - } - this.rowLayout = this.enabledFields; - - for (var i in this.rowLayout) { - this.rowLayout[i].label = this.getLanguage().translate(this.rowLayout[i].name, 'fields', this.scope); - } - - this.wait(false); - }.bind(this), false); - }.bind(this)); - }, - - fetch: function () { - var layout = []; - $("#layout ul.enabled > li").each(function (i, el) { - layout.push($(el).data('name')); - }.bind(this)); - return layout; - }, - - validate: function () { - return true; - }, - - isFieldEnabled: function (model, name) { - if (this.ignoreList.indexOf(name) != -1) { - return false; - } - return !model.getFieldParam(name, 'disabled'); - } - - }); + return Dep.extend({ + + dataAttributes: ['name'], + + editable: false, + + ignoreList: [], + + setup: function () { + Dep.prototype.setup.call(this); + + this.wait(true); + + this.getModelFactory().create(this.scope, function (model) { + this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { + + var allFields = []; + for (var field in model.defs.fields) { + if (!model.getFieldParam(field, 'readOnly') && this.isFieldEnabled(model, field)) { + allFields.push(field); + } + } + + this.enabledFieldsList = []; + + this.enabledFields = []; + this.disabledFields = []; + for (var i in layout) { + this.enabledFields.push({ + name: layout[i], + label: this.getLanguage().translate(layout[i], 'fields', this.scope) + }); + this.enabledFieldsList.push(layout[i]); + } + + for (var i in allFields) { + if (!_.contains(this.enabledFieldsList, allFields[i])) { + this.disabledFields.push({ + name: allFields[i], + label: this.getLanguage().translate(allFields[i], 'fields', this.scope) + }); + } + } + this.rowLayout = this.enabledFields; + + for (var i in this.rowLayout) { + this.rowLayout[i].label = this.getLanguage().translate(this.rowLayout[i].name, 'fields', this.scope); + } + + this.wait(false); + }.bind(this), false); + }.bind(this)); + }, + + fetch: function () { + var layout = []; + $("#layout ul.enabled > li").each(function (i, el) { + layout.push($(el).data('name')); + }.bind(this)); + return layout; + }, + + validate: function () { + return true; + }, + + isFieldEnabled: function (model, name) { + if (this.ignoreList.indexOf(name) != -1) { + return false; + } + return !model.getFieldParam(name, 'disabled'); + } + + }); }); diff --git a/frontend/client/src/views/admin/layouts/relationships.js b/frontend/client/src/views/admin/layouts/relationships.js index 5dcb5e763e..c0264f0b4a 100644 --- a/frontend/client/src/views/admin/layouts/relationships.js +++ b/frontend/client/src/views/admin/layouts/relationships.js @@ -21,69 +21,69 @@ Espo.define('Views.Admin.Layouts.Relationships', 'Views.Admin.Layouts.Rows', function (Dep) { - return Dep.extend({ + return Dep.extend({ - dataAttributes: ['name'], + dataAttributes: ['name'], - editable: false, + editable: false, - setup: function () { - Dep.prototype.setup.call(this); + setup: function () { + Dep.prototype.setup.call(this); - this.wait(true); + this.wait(true); - this.getModelFactory().create(this.scope, function (model) { - this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { + this.getModelFactory().create(this.scope, function (model) { + this.getHelper().layoutManager.get(this.scope, this.type, function (layout) { - var allFields = []; - for (var field in model.defs.links) { - if (['hasMany', 'hasChildren'].indexOf(model.defs.links[field].type) != -1) { - allFields.push(field); - } - } + var allFields = []; + for (var field in model.defs.links) { + if (['hasMany', 'hasChildren'].indexOf(model.defs.links[field].type) != -1) { + allFields.push(field); + } + } - this.enabledFieldsList = []; + this.enabledFieldsList = []; - this.enabledFields = []; - this.disabledFields = []; - for (var i in layout) { - this.enabledFields.push({ - name: layout[i], - label: this.getLanguage().translate(layout[i], 'links', this.scope) - }); - this.enabledFieldsList.push(layout[i]); - } + this.enabledFields = []; + this.disabledFields = []; + for (var i in layout) { + this.enabledFields.push({ + name: layout[i], + label: this.getLanguage().translate(layout[i], 'links', this.scope) + }); + this.enabledFieldsList.push(layout[i]); + } - for (var i in allFields) { - if (!_.contains(this.enabledFieldsList, allFields[i])) { - this.disabledFields.push({ - name: allFields[i], - label: this.getLanguage().translate(allFields[i], 'links', this.scope) - }); - } - } - this.rowLayout = this.enabledFields; + for (var i in allFields) { + if (!_.contains(this.enabledFieldsList, allFields[i])) { + this.disabledFields.push({ + name: allFields[i], + label: this.getLanguage().translate(allFields[i], 'links', this.scope) + }); + } + } + this.rowLayout = this.enabledFields; - for (var i in this.rowLayout) { - this.rowLayout[i].label = this.getLanguage().translate(this.rowLayout[i].name, 'links', this.scope); - } + for (var i in this.rowLayout) { + this.rowLayout[i].label = this.getLanguage().translate(this.rowLayout[i].name, 'links', this.scope); + } - this.wait(false); - }.bind(this), false); - }.bind(this)); - }, + this.wait(false); + }.bind(this), false); + }.bind(this)); + }, - fetch: function () { - var layout = []; - $("#layout ul.enabled > li").each(function (i, el) { - layout.push($(el).data('name')); - }.bind(this)); - return layout; - }, + fetch: function () { + var layout = []; + $("#layout ul.enabled > li").each(function (i, el) { + layout.push($(el).data('name')); + }.bind(this)); + return layout; + }, - validate: function () { - return true; - }, - }); + validate: function () { + return true; + }, + }); }); diff --git a/frontend/client/src/views/admin/layouts/rows.js b/frontend/client/src/views/admin/layouts/rows.js index 68ede95161..03ef9833a8 100644 --- a/frontend/client/src/views/admin/layouts/rows.js +++ b/frontend/client/src/views/admin/layouts/rows.js @@ -18,72 +18,72 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.Layouts.Rows', 'Views.Admin.Layouts.Base', function (Dep) { + +Espo.define('Views.Admin.Layouts.Rows', 'Views.Admin.Layouts.Base', function (Dep) { - return Dep.extend({ - - template: 'admin.layouts.rows', + return Dep.extend({ + + template: 'admin.layouts.rows', - - events: _.extend({ - 'click #layout a[data-action="editField"]': function (e) { - var data = {}; - this.dataAttributes.forEach(function (attr) { - data[attr] = $(e.target).closest('li').data(Espo.Utils.toDom(attr)) - }); - this.openEditDialog(data); - }, - }, Dep.prototype.events), - - dataAttributes: null, - - dataAttributesDefs: {}, - - editable: false, - - data: function () { - return { - scope: this.scope, - type: this.type, - buttons: this.buttons, - enabledFields: this.enabledFields, - disabledFields: this.disabledFields, - layout: this.rowLayout, - dataAttributes: this.dataAttributes, - dataAttributesDefs: this.dataAttributesDefs, - editable: this.editable, - }; - }, - - afterRender: function () { - $('#layout ul.enabled, #layout ul.disabled').sortable({ - connectWith: '#layout ul.connected' - }); - }, - - fetch: function () { - var layout = []; - $("#layout ul.enabled > li").each(function (i, el) { - var o = {}; - this.dataAttributes.forEach(function (attr) { - var value = $(el).data(Espo.Utils.toDom(attr)) || null; - if (value) { - o[attr] = value; - } - }); - layout.push(o); - }.bind(this)); - return layout; - }, - - validate: function (layout) { - if (layout.length == 0) { - this.notify('Layout cannot be empty', 'error'); - return false; - } - return true; - }, - }); + + events: _.extend({ + 'click #layout a[data-action="editField"]': function (e) { + var data = {}; + this.dataAttributes.forEach(function (attr) { + data[attr] = $(e.target).closest('li').data(Espo.Utils.toDom(attr)) + }); + this.openEditDialog(data); + }, + }, Dep.prototype.events), + + dataAttributes: null, + + dataAttributesDefs: {}, + + editable: false, + + data: function () { + return { + scope: this.scope, + type: this.type, + buttons: this.buttons, + enabledFields: this.enabledFields, + disabledFields: this.disabledFields, + layout: this.rowLayout, + dataAttributes: this.dataAttributes, + dataAttributesDefs: this.dataAttributesDefs, + editable: this.editable, + }; + }, + + afterRender: function () { + $('#layout ul.enabled, #layout ul.disabled').sortable({ + connectWith: '#layout ul.connected' + }); + }, + + fetch: function () { + var layout = []; + $("#layout ul.enabled > li").each(function (i, el) { + var o = {}; + this.dataAttributes.forEach(function (attr) { + var value = $(el).data(Espo.Utils.toDom(attr)) || null; + if (value) { + o[attr] = value; + } + }); + layout.push(o); + }.bind(this)); + return layout; + }, + + validate: function (layout) { + if (layout.length == 0) { + this.notify('Layout cannot be empty', 'error'); + return false; + } + return true; + }, + }); }); diff --git a/frontend/client/src/views/admin/outbound-email.js b/frontend/client/src/views/admin/outbound-email.js index df7f5312c7..8d94b92c29 100644 --- a/frontend/client/src/views/admin/outbound-email.js +++ b/frontend/client/src/views/admin/outbound-email.js @@ -18,73 +18,73 @@ * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ - -Espo.define('Views.Admin.OutboundEmail', 'Views.Settings.Record.Edit', function (Dep) { + +Espo.define('Views.Admin.OutboundEmail', 'Views.Settings.Record.Edit', function (Dep) { - return Dep.extend({ - - layoutName: 'outboundEmail', - - dependencyDefs: { - 'assignmentEmailNotifications': { - map: { - true: [ - { - action: 'show', - fields: ['assignmentEmailNotificationsEntityList'] - } - ] - }, - default: [ - { - action: 'hide', - fields: ['assignmentEmailNotificationsEntityList'] - } - ] - }, - 'smtpAuth': { - map: { - true: [ - { - action: 'show', - fields: ['smtpUsername', 'smtpPassword'] - } - ] - }, - default: [ - { - action: 'hide', - fields: ['smtpUsername', 'smtpPassword'] - } - ] - } - }, - - setup: function () { - Dep.prototype.setup.call(this); - - this.model.defs.fields.assignmentEmailNotificationsEntityList.options = Object.keys(this.getMetadata().get('scopes')).filter(function (scope) { - return this.getMetadata().get('scopes.' + scope + '.tab') && this.getMetadata().get('scopes.' + scope + '.entity'); - }, this); - }, - - afterRender: function () { - Dep.prototype.afterRender.call(this); - - var smtpSecurityField = this.getFieldView('smtpSecurity'); - this.listenTo(smtpSecurityField, 'change', function () { - var smtpSecurity = smtpSecurityField.fetch()['smtpSecurity']; - if (smtpSecurity == 'SSL') { - this.model.set('smtpPort', '465'); - } else if (smtpSecurity == 'TLS') { - this.model.set('smtpPort', '587'); - } else { - this.model.set('smtpPort', '25'); - } - }.bind(this)); - }, - - }); - + return Dep.extend({ + + layoutName: 'outboundEmail', + + dependencyDefs: { + 'assignmentEmailNotifications': { + map: { + true: [ + { + action: 'show', + fields: ['assignmentEmailNotificationsEntityList'] + } + ] + }, + default: [ + { + action: 'hide', + fields: ['assignmentEmailNotificationsEntityList'] + } + ] + }, + 'smtpAuth': { + map: { + true: [ + { + action: 'show', + fields: ['smtpUsername', 'smtpPassword'] + } + ] + }, + default: [ + { + action: 'hide', + fields: ['smtpUsername', 'smtpPassword'] + } + ] + } + }, + + setup: function () { + Dep.prototype.setup.call(this); + + this.model.defs.fields.assignmentEmailNotificationsEntityList.options = Object.keys(this.getMetadata().get('scopes')).filter(function (scope) { + return this.getMetadata().get('scopes.' + scope + '.tab') && this.getMetadata().get('scopes.' + scope + '.entity'); + }, this); + }, + + afterRender: function () { + Dep.prototype.afterRender.call(this); + + var smtpSecurityField = this.getFieldView('smtpSecurity'); + this.listenTo(smtpSecurityField, 'change', function () { + var smtpSecurity = smtpSecurityField.fetch()['smtpSecurity']; + if (smtpSecurity == 'SSL') { + this.model.set('smtpPort', '465'); + } else if (smtpSecurity == 'TLS') { + this.model.set('smtpPort', '587'); + } else { + this.model.set('smtpPort', '25'); + } + }.bind(this)); + }, + + }); + }); diff --git a/frontend/client/src/views/admin/settings.js b/frontend/client/src/views/admin/settings.js index 90f6b2a04e..43e5489363 100644 --- a/frontend/client/src/views/admin/settings.js +++ b/frontend/client/src/views/admin/settings.js @@ -21,15 +21,15 @@ Espo.define('Views.Admin.Settings', 'Views.Settings.Record.Edit', function (Dep) { - return Dep.extend({ - - layoutName: 'settings', + return Dep.extend({ + + layoutName: 'settings', - afterRender: function () { - Dep.prototype.afterRender.call(this); + afterRender: function () { + Dep.prototype.afterRender.call(this); - }, + }, - }); + }); }); diff --git a/frontend/client/src/views/admin/upgrade/done.js b/frontend/client/src/views/admin/upgrade/done.js index 190ecaf91d..319753b91a 100644 --- a/frontend/client/src/views/admin/upgrade/done.js +++ b/frontend/client/src/views/admin/upgrade/done.js @@ -21,41 +21,41 @@ Espo.define('Views.Admin.Upgrade.Done', 'Views.Modal', function (Dep) { - return Dep.extend({ - - cssName: 'done-modal', - - header: false, - - template: 'admin.upgrade.done', - - createButton: true, - - data: function () { - return { - version: this.options.version, - text: this.translate('upgradeDone', 'messages', 'Admin').replace('{version}', this.options.version) - }; - }, - - setup: function () { - this.buttons = [ - { - name: 'close', - label: 'Close', - onClick: function (dialog) { - setTimeout(function () { - this.getRouter().navigate('#Admin', {trigger: true}); - }.bind(this), 500); - dialog.close(); - }.bind(this) - } - ]; - - this.header = this.getLanguage().translate('Upgraded successfully', 'labels', 'Admin'); - - }, - - }); + return Dep.extend({ + + cssName: 'done-modal', + + header: false, + + template: 'admin.upgrade.done', + + createButton: true, + + data: function () { + return { + version: this.options.version, + text: this.translate('upgradeDone', 'messages', 'Admin').replace('{version}', this.options.version) + }; + }, + + setup: function () { + this.buttons = [ + { + name: 'close', + label: 'Close', + onClick: function (dialog) { + setTimeout(function () { + this.getRouter().navigate('#Admin', {trigger: true}); + }.bind(this), 500); + dialog.close(); + }.bind(this) + } + ]; + + this.header = this.getLanguage().translate('Upgraded successfully', 'labels', 'Admin'); + + }, + + }); }); diff --git a/frontend/client/src/views/admin/upgrade/index.js b/frontend/client/src/views/admin/upgrade/index.js index d3c2010e99..3d36816a93 100644 --- a/frontend/client/src/views/admin/upgrade/index.js +++ b/frontend/client/src/views/admin/upgrade/index.js @@ -21,119 +21,119 @@ Espo.define('Views.Admin.Upgrade.Index', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'admin.upgrade.index', - - packageContents: null, + template: 'admin.upgrade.index', + + packageContents: null, - data: function () { - return { - backupsMsg: this.translate('upgradeBackup', 'messages', 'Admin') - }; - }, + data: function () { + return { + backupsMsg: this.translate('upgradeBackup', 'messages', 'Admin') + }; + }, - events: { - 'change input[name="package"]': function (e) { - this.$el.find('button[data-action="upload"]').addClass('disabled'); - this.$el.find('.message-container').html(''); - var files = e.currentTarget.files; - if (files.length) { - this.selectFile(files[0]); - } - }, - 'click button[data-action="upload"]': function () { - this.upload(); - } - }, + events: { + 'change input[name="package"]': function (e) { + this.$el.find('button[data-action="upload"]').addClass('disabled'); + this.$el.find('.message-container').html(''); + var files = e.currentTarget.files; + if (files.length) { + this.selectFile(files[0]); + } + }, + 'click button[data-action="upload"]': function () { + this.upload(); + } + }, - setup: function () { + setup: function () { - }, - - selectFile: function (file) { - var fileReader = new FileReader(); - fileReader.onload = function (e) { - this.packageContents = e.target.result; - this.$el.find('button[data-action="upload"]').removeClass('disabled'); - }.bind(this); - fileReader.readAsDataURL(file); - }, - - showError: function (msg) { - msg = this.translate(msg, 'errors', 'Admin'); - this.$el.find('.message-container').html(msg); - }, - - upload: function () { - this.$el.find('button[data-action="upload"]').addClass('disabled'); - this.notify('Uploading...'); - $.ajax({ - url: 'Admin/action/uploadUpgradePackage', - type: 'POST', - contentType: 'application/zip', - timeout: 0, - data: this.packageContents, - error: function (xhr, t, e) { - this.showError(xhr.getResponseHeader('X-Status-Reason')); - this.notify(false); - }.bind(this) - }).done(function (data) { - if (!data.id) { - this.showError(this.translate('Error occured')); - return; - } - this.notify(false); - this.createView('popup', 'Admin.Upgrade.Ready', { - upgradeData: data - }, function (view) { - view.render(); - this.$el.find('button[data-action="upload"]').removeClass('disabled'); - - view.once('run', function () { - view.close(); - this.$el.find('.panel.upload').addClass('hidden'); - this.run(data.id, data.version); - }, this); - }.bind(this)); - }.bind(this)).error; - }, - - textNotification: function (text) { - this.$el.find('.notify-text').html(text); - }, - - run: function (id, version) { - var msg = this.translate('Upgrading...', 'labels', 'Admin'); - this.notify('Please wait...'); - this.textNotification(msg); - - $.ajax({ - url: 'Admin/action/runUpgrade', - type: 'POST', - data: JSON.stringify({ - id: id - }), - error: function (xhr) { - this.$el.find('.panel.upload').removeClass('hidden'); - var msg = xhr.getResponseHeader('X-Status-Reason'); - this.textNotification(this.translate('Error') + ': ' + msg); - }.bind(this) - }).done(function () { - var cache = this.getCache(); - if (cache) { - cache.clear(); - } - this.createView('popup', 'Admin.Upgrade.Done', { - version: version - }, function (view) { - this.notify(false); - view.render(); - }.bind(this)); - }.bind(this)); - }, + }, + + selectFile: function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (e) { + this.packageContents = e.target.result; + this.$el.find('button[data-action="upload"]').removeClass('disabled'); + }.bind(this); + fileReader.readAsDataURL(file); + }, + + showError: function (msg) { + msg = this.translate(msg, 'errors', 'Admin'); + this.$el.find('.message-container').html(msg); + }, + + upload: function () { + this.$el.find('button[data-action="upload"]').addClass('disabled'); + this.notify('Uploading...'); + $.ajax({ + url: 'Admin/action/uploadUpgradePackage', + type: 'POST', + contentType: 'application/zip', + timeout: 0, + data: this.packageContents, + error: function (xhr, t, e) { + this.showError(xhr.getResponseHeader('X-Status-Reason')); + this.notify(false); + }.bind(this) + }).done(function (data) { + if (!data.id) { + this.showError(this.translate('Error occured')); + return; + } + this.notify(false); + this.createView('popup', 'Admin.Upgrade.Ready', { + upgradeData: data + }, function (view) { + view.render(); + this.$el.find('button[data-action="upload"]').removeClass('disabled'); + + view.once('run', function () { + view.close(); + this.$el.find('.panel.upload').addClass('hidden'); + this.run(data.id, data.version); + }, this); + }.bind(this)); + }.bind(this)).error; + }, + + textNotification: function (text) { + this.$el.find('.notify-text').html(text); + }, + + run: function (id, version) { + var msg = this.translate('Upgrading...', 'labels', 'Admin'); + this.notify('Please wait...'); + this.textNotification(msg); + + $.ajax({ + url: 'Admin/action/runUpgrade', + type: 'POST', + data: JSON.stringify({ + id: id + }), + error: function (xhr) { + this.$el.find('.panel.upload').removeClass('hidden'); + var msg = xhr.getResponseHeader('X-Status-Reason'); + this.textNotification(this.translate('Error') + ': ' + msg); + }.bind(this) + }).done(function () { + var cache = this.getCache(); + if (cache) { + cache.clear(); + } + this.createView('popup', 'Admin.Upgrade.Done', { + version: version + }, function (view) { + this.notify(false); + view.render(); + }.bind(this)); + }.bind(this)); + }, - }); + }); }); diff --git a/frontend/client/src/views/admin/upgrade/ready.js b/frontend/client/src/views/admin/upgrade/ready.js index bd2c2dade0..7d51b8dd36 100644 --- a/frontend/client/src/views/admin/upgrade/ready.js +++ b/frontend/client/src/views/admin/upgrade/ready.js @@ -21,53 +21,53 @@ Espo.define('Views.Admin.Upgrade.Ready', 'Views.Modal', function (Dep) { - return Dep.extend({ - - cssName: 'ready-modal', - - header: false, - - template: 'admin.upgrade.ready', - - createButton: true, - - data: function () { - return { - version: this.upgradeData.version, - text: this.translate('upgradeVersion', 'messages', 'Admin').replace('{version}', this.upgradeData.version) - }; - }, - - setup: function () { - - this.buttons = [ - { - name: 'run', - label: this.translate('Run Upgrade', 'labels', 'Admin'), - style: 'danger', - onClick: function (dialog) { - this.run(); - }.bind(this) - }, - { - name: 'cancel', - label: 'Cancel', - onClick: function (dialog) { - dialog.close(); - } - } - ]; - - this.upgradeData = this.options.upgradeData; - - this.header = this.getLanguage().translate('Ready for upgrade', 'labels', 'Admin'); - - }, - - run: function () { - this.trigger('run'); - this.remove(); - } - }); + return Dep.extend({ + + cssName: 'ready-modal', + + header: false, + + template: 'admin.upgrade.ready', + + createButton: true, + + data: function () { + return { + version: this.upgradeData.version, + text: this.translate('upgradeVersion', 'messages', 'Admin').replace('{version}', this.upgradeData.version) + }; + }, + + setup: function () { + + this.buttons = [ + { + name: 'run', + label: this.translate('Run Upgrade', 'labels', 'Admin'), + style: 'danger', + onClick: function (dialog) { + this.run(); + }.bind(this) + }, + { + name: 'cancel', + label: 'Cancel', + onClick: function (dialog) { + dialog.close(); + } + } + ]; + + this.upgradeData = this.options.upgradeData; + + this.header = this.getLanguage().translate('Ready for upgrade', 'labels', 'Admin'); + + }, + + run: function () { + this.trigger('run'); + this.remove(); + } + }); }); diff --git a/frontend/client/src/views/admin/user-interface.js b/frontend/client/src/views/admin/user-interface.js index 26ffcdbbdb..86ee9e39dd 100644 --- a/frontend/client/src/views/admin/user-interface.js +++ b/frontend/client/src/views/admin/user-interface.js @@ -19,25 +19,25 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ -Espo.define('Views.Admin.UserInterface', 'Views.Settings.Record.Edit', function (Dep) { +Espo.define('Views.Admin.UserInterface', 'Views.Settings.Record.Edit', function (Dep) { - return Dep.extend({ - - layoutName: 'userInterface', - - setup: function () { - Dep.prototype.setup.call(this); - - this.model.defs.fields.tabList.options = Object.keys(this.getMetadata().get('scopes')).filter(function (scope) { - return this.getMetadata().get('scopes.' + scope + '.tab'); - }, this); - - this.model.defs.fields.quickCreateList.options = Object.keys(this.getMetadata().get('scopes')).filter(function (scope) { - return this.getMetadata().get('scopes.' + scope + '.entity') && this.getMetadata().get('scopes.' + scope + '.tab'); - }, this); - }, - - }); - + return Dep.extend({ + + layoutName: 'userInterface', + + setup: function () { + Dep.prototype.setup.call(this); + + this.model.defs.fields.tabList.options = Object.keys(this.getMetadata().get('scopes')).filter(function (scope) { + return this.getMetadata().get('scopes.' + scope + '.tab'); + }, this); + + this.model.defs.fields.quickCreateList.options = Object.keys(this.getMetadata().get('scopes')).filter(function (scope) { + return this.getMetadata().get('scopes.' + scope + '.entity') && this.getMetadata().get('scopes.' + scope + '.tab'); + }, this); + }, + + }); + }); diff --git a/frontend/client/src/views/base.js b/frontend/client/src/views/base.js index f0c41b27ae..5383a89fb0 100644 --- a/frontend/client/src/views/base.js +++ b/frontend/client/src/views/base.js @@ -19,8 +19,8 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Views.Base', 'View', function (Dep) { - - return Dep.extend({ - }); + + return Dep.extend({ + }); }); diff --git a/frontend/client/src/views/dashboard.js b/frontend/client/src/views/dashboard.js index 05cbaec82e..8f4efc3a74 100644 --- a/frontend/client/src/views/dashboard.js +++ b/frontend/client/src/views/dashboard.js @@ -21,146 +21,146 @@ Espo.define('Views.Dashboard', 'View', function (Dep) { - return Dep.extend({ - - template: 'dashboard', - - dashboardLayout: null, - - events: { - 'click button.add-dashlet': function () { - this.createView('addDashlet', 'Modals.AddDashlet', {}, function (view) { - view.render(); - }); - }, - }, - - getDashletsLayout: function (callback) { - var dashboardLayout = this.dashboardLayout = this.getPreferences().get('dashboardLayout') || [[],[]]; - - if (this.dashboardLayout.length == 0) { - this.dashboardLayout = dashboardLayout = [[], []]; - } - - var layout = { - type: 'columns-2', - layout: [], - }; - dashboardLayout.forEach(function (col) { - var c = []; - col.forEach(function (defs) { - if (defs && defs.name && defs.id) { - var o = { - name: 'dashlet-' + defs.id, - id: 'dashlet-container-' + defs.id, - view: 'Dashlet', - options: { - name: defs.name, - id: defs.id, - } - }; - c.push(o); - } - }); - layout.layout.push(c); - }); - callback(layout); - }, - - setup: function () { - }, - - afterRender: function () { - this.getDashletsLayout(function (layout) { - this.createView('dashlets', 'Base', { - _layout: layout, - el: '#dashlets', - noCache: true, - }, function (view) { - - view.once('after:render', function () { - this.makeSortable(); - }.bind(this)); - view.render(); - }.bind(this)); - }.bind(this)); - }, - - makeSortable: function () { - $('#dashlets > div').css('min-height', '100px'); - $('#dashlets > div').sortable({ - handle: '.dashlet .panel-heading', - connectWith: '#dashlets > div', - forcePlaceholderSize: true, - placeholder: 'dashlet-placeholder', - start: function (e, ui) { - $(ui.placeholder).css('height', $(ui.item).height()); - }, - stop: function (e, ui) { - this.updateDom(); - this.updateDashletsLayout(); - }.bind(this) - }); - }, - - updateDom: function () { - var layout = []; - $('#dashlets > div').each(function (i, col) { - var c = []; - $(col).children().each(function (i, cell) { - var name = $(cell).find('.dashlet').data('name'); - var id = $(cell).find('.dashlet').data('id'); - c.push({ - name: name, - id: id, - }); - }); - layout.push(c); - }); - this.dashboardLayout = layout; - }, - - updateDashletsLayout: function () { - this.getPreferences().set('dashboardLayout', this.dashboardLayout); - this.getPreferences().save({patch: true}); - this.getPreferences().trigger('update'); - }, - - removeDashlet: function (id) { - this.dashboardLayout.forEach(function (col, i) { - col.forEach(function (o, j) { - if (o.id == id) { - col.splice(j, 1); - return; - } - }); - }); - - this.getPreferences().unsetDashletOptions(id); - this.updateDashletsLayout(); - }, - - addDashlet: function (name) { - var id = 'd' + (Math.floor(Math.random() * 1000001)).toString(); - - this.dashboardLayout[0].unshift({ - name: name, - id: id - }); - - this.updateDashletsLayout(); - - $('#dashlets').children().first().prepend('
    '); - - this.getView('dashlets').createView('dashlet-' + id, 'Dashlet', { - label: name, - name: name, - id: id, - el: '#dashlet-container-' + id - }, function (view) { - view.render(); - }); - }, - }); + return Dep.extend({ + + template: 'dashboard', + + dashboardLayout: null, + + events: { + 'click button.add-dashlet': function () { + this.createView('addDashlet', 'Modals.AddDashlet', {}, function (view) { + view.render(); + }); + }, + }, + + getDashletsLayout: function (callback) { + var dashboardLayout = this.dashboardLayout = this.getPreferences().get('dashboardLayout') || [[],[]]; + + if (this.dashboardLayout.length == 0) { + this.dashboardLayout = dashboardLayout = [[], []]; + } + + var layout = { + type: 'columns-2', + layout: [], + }; + dashboardLayout.forEach(function (col) { + var c = []; + col.forEach(function (defs) { + if (defs && defs.name && defs.id) { + var o = { + name: 'dashlet-' + defs.id, + id: 'dashlet-container-' + defs.id, + view: 'Dashlet', + options: { + name: defs.name, + id: defs.id, + } + }; + c.push(o); + } + }); + layout.layout.push(c); + }); + callback(layout); + }, + + setup: function () { + }, + + afterRender: function () { + this.getDashletsLayout(function (layout) { + this.createView('dashlets', 'Base', { + _layout: layout, + el: '#dashlets', + noCache: true, + }, function (view) { + + view.once('after:render', function () { + this.makeSortable(); + }.bind(this)); + view.render(); + }.bind(this)); + }.bind(this)); + }, + + makeSortable: function () { + $('#dashlets > div').css('min-height', '100px'); + $('#dashlets > div').sortable({ + handle: '.dashlet .panel-heading', + connectWith: '#dashlets > div', + forcePlaceholderSize: true, + placeholder: 'dashlet-placeholder', + start: function (e, ui) { + $(ui.placeholder).css('height', $(ui.item).height()); + }, + stop: function (e, ui) { + this.updateDom(); + this.updateDashletsLayout(); + }.bind(this) + }); + }, + + updateDom: function () { + var layout = []; + $('#dashlets > div').each(function (i, col) { + var c = []; + $(col).children().each(function (i, cell) { + var name = $(cell).find('.dashlet').data('name'); + var id = $(cell).find('.dashlet').data('id'); + c.push({ + name: name, + id: id, + }); + }); + layout.push(c); + }); + this.dashboardLayout = layout; + }, + + updateDashletsLayout: function () { + this.getPreferences().set('dashboardLayout', this.dashboardLayout); + this.getPreferences().save({patch: true}); + this.getPreferences().trigger('update'); + }, + + removeDashlet: function (id) { + this.dashboardLayout.forEach(function (col, i) { + col.forEach(function (o, j) { + if (o.id == id) { + col.splice(j, 1); + return; + } + }); + }); + + this.getPreferences().unsetDashletOptions(id); + this.updateDashletsLayout(); + }, + + addDashlet: function (name) { + var id = 'd' + (Math.floor(Math.random() * 1000001)).toString(); + + this.dashboardLayout[0].unshift({ + name: name, + id: id + }); + + this.updateDashletsLayout(); + + $('#dashlets').children().first().prepend('
    '); + + this.getView('dashlets').createView('dashlet-' + id, 'Dashlet', { + label: name, + name: name, + id: id, + el: '#dashlet-container-' + id + }, function (view) { + view.render(); + }); + }, + }); }); diff --git a/frontend/client/src/views/dashlet.js b/frontend/client/src/views/dashlet.js index 8f2337aead..097da6128a 100644 --- a/frontend/client/src/views/dashlet.js +++ b/frontend/client/src/views/dashlet.js @@ -21,80 +21,80 @@ Espo.define('Views.Dashlet', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: null, + name: null, - id: null, + id: null, - elId: null, + elId: null, - template: 'dashlet', + template: 'dashlet', - data: function () { - return { - name: this.name, - id: this.id, - title: this.getOption('title'), - isDoubleHeight: this.getOption('isDoubleHeight') - }; - }, + data: function () { + return { + name: this.name, + id: this.id, + title: this.getOption('title'), + isDoubleHeight: this.getOption('isDoubleHeight') + }; + }, - setup: function () { - this.events = this.events || {}; - this.name = this.options.name; - this.id = this.options.id; + setup: function () { + this.events = this.events || {}; + this.name = this.options.name; + this.id = this.options.id; - this.events['click [data-action="refresh"]'] = function (e) { - this.actionRefresh(); - }.bind(this); - this.events['click [data-action="options"]'] = function (e) { - this.actionOptions(); - }; - this.events['click [data-action="remove"]'] = function (e) { - this.actionRemove(); - }; + this.events['click [data-action="refresh"]'] = function (e) { + this.actionRefresh(); + }.bind(this); + this.events['click [data-action="options"]'] = function (e) { + this.actionOptions(); + }; + this.events['click [data-action="remove"]'] = function (e) { + this.actionRemove(); + }; - var bodySelector = '#dashlet-' + this.id + ' .dashlet-body'; - var view = this.getMetadata().get('dashlets.' + this.name + '.view') || 'Dashlets.' + this.name; - - this.createView('body', view, {el: bodySelector, id: this.id}); - }, - - refresh: function () { - this.getView('body').actionRefresh(); - }, + var bodySelector = '#dashlet-' + this.id + ' .dashlet-body'; + var view = this.getMetadata().get('dashlets.' + this.name + '.view') || 'Dashlets.' + this.name; + + this.createView('body', view, {el: bodySelector, id: this.id}); + }, + + refresh: function () { + this.getView('body').actionRefresh(); + }, - actionRefresh: function () { - this.refresh(); - }, + actionRefresh: function () { + this.refresh(); + }, - actionOptions: function () { - var optionsView = this.getView('body').optionsView; - this.createView('options', optionsView, { - name: this.name, - optionsData: this.getOptionsData(), - fields: this.getView('body').optionsFields, - }, function (view) { - view.render(); - }); - }, + actionOptions: function () { + var optionsView = this.getView('body').optionsView; + this.createView('options', optionsView, { + name: this.name, + optionsData: this.getOptionsData(), + fields: this.getView('body').optionsFields, + }, function (view) { + view.render(); + }); + }, - getOptionsData: function () { - return this.getView('body').optionsData; - }, + getOptionsData: function () { + return this.getView('body').optionsData; + }, - getOption: function (key) { - return this.getView('body').getOption(key); - }, + getOption: function (key) { + return this.getView('body').getOption(key); + }, - actionRemove: function () { - var dashboard = this.getParentView().getParentView(); - dashboard.removeDashlet(this.options.id); - this.$el.remove(); - this.remove(); - }, - }); + actionRemove: function () { + var dashboard = this.getParentView().getParentView(); + dashboard.removeDashlet(this.options.id); + this.$el.remove(); + this.remove(); + }, + }); }); diff --git a/frontend/client/src/views/dashlets/abstract/base.js b/frontend/client/src/views/dashlets/abstract/base.js index d467405ab7..01d282658a 100644 --- a/frontend/client/src/views/dashlets/abstract/base.js +++ b/frontend/client/src/views/dashlets/abstract/base.js @@ -21,73 +21,73 @@ Espo.define('Views.Dashlets.Abstract.Base', 'View', function (Dep) { - return Dep.extend({ + return Dep.extend({ - optionsView: 'Dashlets.Options.Base', + optionsView: 'Dashlets.Options.Base', - defaultOptions: null, + defaultOptions: null, - optionsData: null, + optionsData: null, - actionRefresh: function () { - this.setup(); - this.render(); - }, + actionRefresh: function () { + this.setup(); + this.render(); + }, - actionOptions: function () {}, + actionOptions: function () {}, - optionsFields: { - 'title': { - type: 'varchar', - required: true, - }, - 'autorefreshInterval': { - type: 'enumFloat', - options: [0, 0.5, 1, 2, 5, 10], - }, - }, + optionsFields: { + 'title': { + type: 'varchar', + required: true, + }, + 'autorefreshInterval': { + type: 'enumFloat', + options: [0, 0.5, 1, 2, 5, 10], + }, + }, - init: function () { - this.defaultOptions = _.extend({ - title: this.getLanguage().translate(this.name, 'dashlets'), - }, this.defaultOptions || {}); - - - var options = _.clone(this.defaultOptions); - - for (var key in options) { - if (typeof options[key] == 'function') { - options[key] = options[key].call(this); - } - } + init: function () { + this.defaultOptions = _.extend({ + title: this.getLanguage().translate(this.name, 'dashlets'), + }, this.defaultOptions || {}); + + + var options = _.clone(this.defaultOptions); + + for (var key in options) { + if (typeof options[key] == 'function') { + options[key] = options[key].call(this); + } + } - var storedOptions = this.getPreferences().getDashletOptions(this.options.id) || {}; - - this.optionsData = _.extend(options, storedOptions); - - if (this.optionsData.autorefreshInterval || false) { - var interval = this.optionsData.autorefreshInterval * 60000; - - var t; - var process = function () { - t = setTimeout(function () { - this.actionRefresh(); - process(); - }.bind(this), interval); - }.bind(this); - - process(); - - this.once('remove', function () { - clearTimeout(t); - }, this); - } - }, + var storedOptions = this.getPreferences().getDashletOptions(this.options.id) || {}; + + this.optionsData = _.extend(options, storedOptions); + + if (this.optionsData.autorefreshInterval || false) { + var interval = this.optionsData.autorefreshInterval * 60000; + + var t; + var process = function () { + t = setTimeout(function () { + this.actionRefresh(); + process(); + }.bind(this), interval); + }.bind(this); + + process(); + + this.once('remove', function () { + clearTimeout(t); + }, this); + } + }, - getOption: function (key) { - return this.optionsData[key]; - }, - }); + getOption: function (key) { + return this.optionsData[key]; + }, + }); }); diff --git a/frontend/client/src/views/dashlets/abstract/record-list.js b/frontend/client/src/views/dashlets/abstract/record-list.js index 48a6636a4b..e691b86d3c 100644 --- a/frontend/client/src/views/dashlets/abstract/record-list.js +++ b/frontend/client/src/views/dashlets/abstract/record-list.js @@ -21,70 +21,70 @@ Espo.define('Views.Dashlets.Abstract.RecordList', 'Views.Dashlets.Abstract.Base', function (Dep) { - return Dep.extend({ + return Dep.extend({ - name: 'Leads', + name: 'Leads', - scope: null, + scope: null, - listViewColumn: 'Record.List', + listViewColumn: 'Record.List', - listViewExpanded: 'Record.ListExpanded', + listViewExpanded: 'Record.ListExpanded', - _template: '
    {{{list}}}
    ', + _template: '
    {{{list}}}
    ', - layoutType: 'expanded', - - optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { - 'displayRecords': { - type: 'enumInt', - options: [3,4,5,10,15], - }, - 'isDoubleHeight': { - type: 'bool', - } - }), + layoutType: 'expanded', + + optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { + 'displayRecords': { + type: 'enumInt', + options: [3,4,5,10,15], + }, + 'isDoubleHeight': { + type: 'bool', + } + }), - afterRender: function () { - this.getCollectionFactory().create(this.scope, function (collection) { - var searchManager = new Espo.SearchManager(collection, 'list', null, this.getDateTime(), this.getOption('searchData')); - - if (!this.getAcl().check(this.scope, 'read')) { - this.$el.find('.list-container').html(this.translate('No Access')); - return; - } + afterRender: function () { + this.getCollectionFactory().create(this.scope, function (collection) { + var searchManager = new Espo.SearchManager(collection, 'list', null, this.getDateTime(), this.getOption('searchData')); + + if (!this.getAcl().check(this.scope, 'read')) { + this.$el.find('.list-container').html(this.translate('No Access')); + return; + } - this.collection = collection; - collection.sortBy = this.getOption('sortBy') || this.collection.sortBy; - collection.asc = this.getOption('asc') || this.collection.asc; - collection.maxSize = this.getOption('displayRecords'); - collection.where = searchManager.getWhere(); - - var viewName = (this.layoutType == 'expanded') ? this.listViewExpanded : this.listViewColumn; + this.collection = collection; + collection.sortBy = this.getOption('sortBy') || this.collection.sortBy; + collection.asc = this.getOption('asc') || this.collection.asc; + collection.maxSize = this.getOption('displayRecords'); + collection.where = searchManager.getWhere(); + + var viewName = (this.layoutType == 'expanded') ? this.listViewExpanded : this.listViewColumn; - this.listenToOnce(collection, 'sync', function () { - this.createView('list', viewName, { - collection: collection, - el: this.$el.selector + ' .list-container', - pagination: this.getOption('pagination') ? 'bottom' : false, - type: 'listDashlet', - rowActionsView: false, - checkboxes: false, - showMore: true, - listLayout: this.getOption(this.layoutType + 'Layout') - }, function (view) { - view.render(); - }); - }, this); - - collection.fetch(); + this.listenToOnce(collection, 'sync', function () { + this.createView('list', viewName, { + collection: collection, + el: this.$el.selector + ' .list-container', + pagination: this.getOption('pagination') ? 'bottom' : false, + type: 'listDashlet', + rowActionsView: false, + checkboxes: false, + showMore: true, + listLayout: this.getOption(this.layoutType + 'Layout') + }, function (view) { + view.render(); + }); + }, this); + + collection.fetch(); - }, this); - }, - - actionRefresh: function () { - this.collection.fetch(); - }, - }); + }, this); + }, + + actionRefresh: function () { + this.collection.fetch(); + }, + }); }); diff --git a/frontend/client/src/views/dashlets/options/base.js b/frontend/client/src/views/dashlets/options/base.js index e9779b0029..5889ee82aa 100644 --- a/frontend/client/src/views/dashlets/options/base.js +++ b/frontend/client/src/views/dashlets/options/base.js @@ -21,132 +21,132 @@ Espo.define('Views.Dashlets.Options.Base', ['Views.Modal', 'Views.Record.Detail'], function (Dep, Detail) { - var self; + var self; - return Dep.extend({ + return Dep.extend({ - name: null, + name: null, - template: 'dashlets.options.base', + template: 'dashlets.options.base', - cssName: 'options-modal', + cssName: 'options-modal', - fieldsMode: 'edit', + fieldsMode: 'edit', - data: function () { - return { - options: this.optionsData, - }; - }, + data: function () { + return { + options: this.optionsData, + }; + }, - buttons: [ - { - name: 'save', - label: 'Save', - style: 'primary', - onClick: function (dialog) { - self.save(dialog); - }, - }, - { - name: 'cancel', - label: 'Cancel', - onClick: function (dialog) { - dialog.close(); - } - } - ], + buttons: [ + { + name: 'save', + label: 'Save', + style: 'primary', + onClick: function (dialog) { + self.save(dialog); + }, + }, + { + name: 'cancel', + label: 'Cancel', + onClick: function (dialog) { + dialog.close(); + } + } + ], - getDetailLayout: function () { - var layout = [{rows: []}]; - var i = 0; - var a = []; - for (var field in this.fields) { + getDetailLayout: function () { + var layout = [{rows: []}]; + var i = 0; + var a = []; + for (var field in this.fields) { - if (!(i % 2)) { - a = []; - layout[0].rows.push(a); - } - a.push({name: field}); - i++; - } - return layout; - }, + if (!(i % 2)) { + a = []; + layout[0].rows.push(a); + } + a.push({name: field}); + i++; + } + return layout; + }, - init: function () { - Dep.prototype.init.call(this); - this.fields = this.options.fields; - this.fieldList = Object.keys(this.fields); - this.optionsData = this.options.optionsData; - }, + init: function () { + Dep.prototype.init.call(this); + this.fields = this.options.fields; + this.fieldList = Object.keys(this.fields); + this.optionsData = this.options.optionsData; + }, - setup: function (dialog) { - this.id = 'dashlet-options'; - - self = this; - var model = this.model = new Espo.Model(); - model.name = 'DashletOptions'; - model.defs = { - fields: this.fields - }; - model.set(this.optionsData); + setup: function (dialog) { + this.id = 'dashlet-options'; + + self = this; + var model = this.model = new Espo.Model(); + model.name = 'DashletOptions'; + model.defs = { + fields: this.fields + }; + model.set(this.optionsData); - this.createView('record', 'Base', { - model: model, - _layout: { - type: 'record', - layout: Detail.prototype.convertDetailLayout.call(this, this.getDetailLayout()) - }, - el: this.id + ' .record', - layoutData: { - model: model, - columnCount: 2, - }, - }); + this.createView('record', 'Base', { + model: model, + _layout: { + type: 'record', + layout: Detail.prototype.convertDetailLayout.call(this, this.getDetailLayout()) + }, + el: this.id + ' .record', + layoutData: { + model: model, + columnCount: 2, + }, + }); - this.header = this.getLanguage().translate('Dashlet Options') + ': ' + this.getLanguage().translate(this.name, 'dashlets'); - }, - - save: function (dialog) { - var attributes = {}; - this.fieldList.forEach(function (field) { - var fieldView = this.getView('record').getView(field); - _.extend(attributes, fieldView.fetch()); - }, this); - - this.model.set(attributes, {silent: true}); - - var valid = true; - this.fieldList.forEach(function (field) { - var fieldView = this.getView('record').getView(field); - valid = !fieldView.validate() && valid; - }, this); - - if (!valid) { - this.notify('Not Valid', 'error'); - return; - } - - var id = this.getParentView().id; - - this.notify('Saving...'); - this.getPreferences().setDashletOptions(id, attributes); - - this.getPreferences().once('sync', function () { - this.notify(false); - var dashlet = this.getParentView(); - - this.close(); - - dashlet.setup(); - dashlet.render(); - - }, this); - - this.getPreferences().save(); - this.getPreferences().trigger('update'); - }, - }); + this.header = this.getLanguage().translate('Dashlet Options') + ': ' + this.getLanguage().translate(this.name, 'dashlets'); + }, + + save: function (dialog) { + var attributes = {}; + this.fieldList.forEach(function (field) { + var fieldView = this.getView('record').getView(field); + _.extend(attributes, fieldView.fetch()); + }, this); + + this.model.set(attributes, {silent: true}); + + var valid = true; + this.fieldList.forEach(function (field) { + var fieldView = this.getView('record').getView(field); + valid = !fieldView.validate() && valid; + }, this); + + if (!valid) { + this.notify('Not Valid', 'error'); + return; + } + + var id = this.getParentView().id; + + this.notify('Saving...'); + this.getPreferences().setDashletOptions(id, attributes); + + this.getPreferences().once('sync', function () { + this.notify(false); + var dashlet = this.getParentView(); + + this.close(); + + dashlet.setup(); + dashlet.render(); + + }, this); + + this.getPreferences().save(); + this.getPreferences().trigger('update'); + }, + }); }); diff --git a/frontend/client/src/views/dashlets/stream.js b/frontend/client/src/views/dashlets/stream.js index eaf9901428..f6619c1157 100644 --- a/frontend/client/src/views/dashlets/stream.js +++ b/frontend/client/src/views/dashlets/stream.js @@ -21,56 +21,56 @@ Espo.define('Views.Dashlets.Stream', 'Views.Dashlets.Abstract.Base', function (Dep) { - return Dep.extend({ - - name: 'Stream', + return Dep.extend({ + + name: 'Stream', - defaultOptions: { - displayRecords: 5, - autorefreshInterval: 0.5, - isDoubleHeight: false - }, - - _template: '
    {{{list}}}
    ', - - optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { - 'displayRecords': { - type: 'enumInt', - options: [3,4,5,10,15] - }, - 'isDoubleHeight': { - type: 'bool', - }, - }), - - actionRefresh: function () { - this.getView('list').showNewRecords(); - }, - - afterRender: function () { - - this.getCollectionFactory().create('Note', function (collection) { - this.collection = collection; - - collection.url = 'Stream'; - collection.maxSize = this.getOption('displayRecords'); - - this.listenToOnce(collection, 'sync', function () { - this.createView('list', 'Stream.List', { - el: this.options.el + ' > .list-container', - collection: collection, - isUserStream: true, - }, function (view) { - view.render(); - }); - }.bind(this)); - collection.fetch(); - - }, this); - }, - + defaultOptions: { + displayRecords: 5, + autorefreshInterval: 0.5, + isDoubleHeight: false + }, + + _template: '
    {{{list}}}
    ', + + optionsFields: _.extend(_.clone(Dep.prototype.optionsFields), { + 'displayRecords': { + type: 'enumInt', + options: [3,4,5,10,15] + }, + 'isDoubleHeight': { + type: 'bool', + }, + }), + + actionRefresh: function () { + this.getView('list').showNewRecords(); + }, + + afterRender: function () { + + this.getCollectionFactory().create('Note', function (collection) { + this.collection = collection; + + collection.url = 'Stream'; + collection.maxSize = this.getOption('displayRecords'); + + this.listenToOnce(collection, 'sync', function () { + this.createView('list', 'Stream.List', { + el: this.options.el + ' > .list-container', + collection: collection, + isUserStream: true, + }, function (view) { + view.render(); + }); + }.bind(this)); + collection.fetch(); + + }, this); + }, + - }); + }); }); diff --git a/frontend/client/src/views/detail.js b/frontend/client/src/views/detail.js index afda3ec48b..9dfe3f2f53 100644 --- a/frontend/client/src/views/detail.js +++ b/frontend/client/src/views/detail.js @@ -21,270 +21,270 @@ Espo.define('Views.Detail', 'Views.Main', function (Dep) { - return Dep.extend({ + return Dep.extend({ - template: 'detail', + template: 'detail', - el: '#main', + el: '#main', - scope: null, + scope: null, - name: 'Detail', - - optionsToPass: [], + name: 'Detail', + + optionsToPass: [], - views: { - header: { - selector: '> .page-header', - view: 'Header' - }, - body: { - view: 'Record.Detail', - selector: '> .body', - } - }, - - addUnfollowButtonToMenu: function () { - this.menu.buttons.unshift({ - name: 'unfollow', - label: 'Followed', - style: 'success', - action: 'unfollow' - }); - - var index = -1; - this.menu.buttons.forEach(function (data, i) { - if (data.name == 'follow') { - var index = i; - return; - } - }, this); - if (~index) { - this.menu.buttons.splice(index, 1); - } - }, - - addFollowButtonToMenu: function () { - this.menu.buttons.unshift({ - name: 'follow', - label: 'Follow', - style: 'default', - icon: 'glyphicon glyphicon-share-alt', - action: 'follow' - }); - - var index = -1; - this.menu.buttons.forEach(function (data, i) { - if (data.name == 'unfollow') { - var index = i; - return; - } - }, this); - if (~index) { - this.menu.buttons.splice(index, 1); - } - }, - - setup: function () { - Dep.prototype.setup.call(this); - - if (this.getMetadata().get('scopes.' + this.scope + '.stream')) { - if (this.model.has('isFollowed')) { - if (this.model.get('isFollowed')) { - this.addUnfollowButtonToMenu(); - } else { - this.addFollowButtonToMenu(); - } - } else { - this.once('after:render', function () { - var proceed = function () { - if (this.model.get('isFollowed')) { - this.addUnfollowButton(); - this.addUnfollowButtonToMenu(); - } else { - this.addFollowButton(); - this.addFollowButtonToMenu(); - - } - }.bind(this); - - if (this.model.has('isFollowed')) { - proceed(); - } else { - this.listenToOnce(this.model, 'sync', function () { - if (this.model.has('isFollowed')) { - proceed(); - } - }.bind(this)); - } + views: { + header: { + selector: '> .page-header', + view: 'Header' + }, + body: { + view: 'Record.Detail', + selector: '> .body', + } + }, + + addUnfollowButtonToMenu: function () { + this.menu.buttons.unshift({ + name: 'unfollow', + label: 'Followed', + style: 'success', + action: 'unfollow' + }); + + var index = -1; + this.menu.buttons.forEach(function (data, i) { + if (data.name == 'follow') { + var index = i; + return; + } + }, this); + if (~index) { + this.menu.buttons.splice(index, 1); + } + }, + + addFollowButtonToMenu: function () { + this.menu.buttons.unshift({ + name: 'follow', + label: 'Follow', + style: 'default', + icon: 'glyphicon glyphicon-share-alt', + action: 'follow' + }); + + var index = -1; + this.menu.buttons.forEach(function (data, i) { + if (data.name == 'unfollow') { + var index = i; + return; + } + }, this); + if (~index) { + this.menu.buttons.splice(index, 1); + } + }, + + setup: function () { + Dep.prototype.setup.call(this); + + if (this.getMetadata().get('scopes.' + this.scope + '.stream')) { + if (this.model.has('isFollowed')) { + if (this.model.get('isFollowed')) { + this.addUnfollowButtonToMenu(); + } else { + this.addFollowButtonToMenu(); + } + } else { + this.once('after:render', function () { + var proceed = function () { + if (this.model.get('isFollowed')) { + this.addUnfollowButton(); + this.addUnfollowButtonToMenu(); + } else { + this.addFollowButton(); + this.addFollowButtonToMenu(); + + } + }.bind(this); + + if (this.model.has('isFollowed')) { + proceed(); + } else { + this.listenToOnce(this.model, 'sync', function () { + if (this.model.has('isFollowed')) { + proceed(); + } + }.bind(this)); + } - }, this); - } - } - }, - - addFollowButton: function () { - $el = $('