From e145b2a488f5ddd73b3945bf2bbfe6b516c45ba0 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 7 May 2014 11:04:46 +0300 Subject: [PATCH] fixed problem with rewriting default setting options --- application/Espo/Core/Utils/Config.php | 7 +- application/Espo/Core/defaults/config.php | 229 +++++++++++----------- install/core/init/config.php | 24 +-- 3 files changed, 126 insertions(+), 134 deletions(-) diff --git a/application/Espo/Core/Utils/Config.php b/application/Espo/Core/Utils/Config.php index 5185c5f3ee..c6171939cf 100644 --- a/application/Espo/Core/Utils/Config.php +++ b/application/Espo/Core/Utils/Config.php @@ -143,7 +143,12 @@ class Config $config = array(); } - $this->configData = Util::merge((array) $defaultConfig, (array) $config); + if (!empty($defaultConfig['rewriteOptions'])) { + $this->configData = Util::merge((array) $defaultConfig, (array) $config, 1, $defaultConfig['rewriteOptions']); + } else { + $this->configData = Util::merge((array) $defaultConfig, (array) $config); + } + $this->adminItems = $this->getRestrictItems(); return $this->configData; diff --git a/application/Espo/Core/defaults/config.php b/application/Espo/Core/defaults/config.php index 9b3f206b9d..741826ae0f 100644 --- a/application/Espo/Core/defaults/config.php +++ b/application/Espo/Core/defaults/config.php @@ -21,118 +21,125 @@ ************************************************************************/ return array ( - 'configPath' => 'data/config.php', - 'cachePath' => 'data/cache', + 'configPath' => 'data/config.php', + 'cachePath' => 'data/cache', - 'database' => - array ( - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - ), - 'useCache' => true, - 'recordsPerPage' => 20, - 'recordsPerPageSmall' => 5, - 'applicationName' => 'EspoCRM', - 'version' => '@@version', - 'timeZone' => 'UTC', - 'dateFormat' => 'MM/DD/YYYY', - 'timeFormat' => 'HH:mm', - 'weekStart' => 0, - 'thousandSeparator' => ',', - 'decimalMark' => '.', - 'currencyList' => - array ( - ), - 'defaultCurrency' => 'USD', - 'outboundEmailIsShared' => true, - 'outboundEmailFromName' => 'EspoCRM', - 'outboundEmailFromAddress' => '', - 'smtpServer' => '', - 'smtpPort' => 25, - 'smtpAuth' => true, - 'smtpSecurity' => '', - 'smtpUsername' => '', - 'smtpPassword' => '', - 'languageList' => array( - 'en_US', - ), - 'language' => 'en_US', - 'logger' => - array ( - 'path' => 'data/logs/espo.log', - 'level' => 'ERROR', /*DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY*/ - 'isRotate' => true, /*rotate every day every logs files*/ - 'maxRotateFiles' => 30, /*max number of rotate files*/ - ), - 'defaultPermissions' => - array ( - 'dir' => '0775', - 'file' => '0664', - 'user' => '', - 'group' => '', - ), - '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*/ - ), - 'currency' => - array( - 'base' => 'USD', - 'rate' => array( - 'EUR' => 1.37, + 'database' => + array ( + 'driver' => 'pdo_mysql', + 'host' => 'localhost', ), - ), - 'globalSearchEntityList' => - array ( - 0 => 'Account', - 1 => 'Contact', - 2 => 'Lead', - 3 => 'Prospect', - 4 => 'Opportunity', - ), - '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', - ), - 'adminItems' => - array ( - 'devMode', - 'outboundEmailIsShared', - 'outboundEmailFromName', - 'outboundEmailFromAddress', - 'smtpServer', - 'smtpPort', - 'smtpAuth', - 'smtpSecurity', - 'smtpUsername', - 'smtpPassword', - 'cron', - ), - "tabList" => array("Account", "Contact", "Lead", "Opportunity", "Calendar", "Meeting", "Call", "Task", "Case", "Prospect", "Email"), - "quickCreateList" => array("Account", "Contact", "Lead", "Opportunity", "Meeting", "Call", "Task", "Case", "Prospect"), - 'isInstalled' => false, + 'useCache' => true, + 'recordsPerPage' => 20, + 'recordsPerPageSmall' => 5, + 'applicationName' => 'EspoCRM', + 'version' => '@@version', + 'timeZone' => 'UTC', + 'dateFormat' => 'MM/DD/YYYY', + 'timeFormat' => 'HH:mm', + 'weekStart' => 0, + 'thousandSeparator' => ',', + 'decimalMark' => '.', + 'currencyList' => + array ( + ), + 'defaultCurrency' => 'USD', + 'outboundEmailIsShared' => true, + 'outboundEmailFromName' => 'EspoCRM', + 'outboundEmailFromAddress' => '', + 'smtpServer' => '', + 'smtpPort' => 25, + 'smtpAuth' => true, + 'smtpSecurity' => '', + 'smtpUsername' => '', + 'smtpPassword' => '', + 'languageList' => array( + 'en_US', + ), + 'language' => 'en_US', + 'logger' => + array ( + 'path' => 'data/logs/espo.log', + 'level' => 'ERROR', /*DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY*/ + 'isRotate' => true, /*rotate every day every logs files*/ + 'maxRotateFiles' => 30, /*max number of rotate files*/ + ), + 'defaultPermissions' => + array ( + 'dir' => '0775', + 'file' => '0664', + 'user' => '', + 'group' => '', + ), + '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*/ + ), + 'currency' => + array( + 'base' => 'USD', + 'rate' => array( + 'EUR' => 1.37, + ), + ), + 'globalSearchEntityList' => + array ( + 0 => 'Account', + 1 => 'Contact', + 2 => 'Lead', + 3 => 'Prospect', + 4 => 'Opportunity', + ), + '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', + 'rewriteOptions', + ), + 'adminItems' => + array ( + 'devMode', + 'outboundEmailIsShared', + 'outboundEmailFromName', + 'outboundEmailFromAddress', + 'smtpServer', + 'smtpPort', + 'smtpAuth', + 'smtpSecurity', + 'smtpUsername', + 'smtpPassword', + 'cron', + ), + 'rewriteOptions' => + array ( + 'tabList', + 'quickCreateList', + 'globalSearchEntityList', + ), + "tabList" => array("Account", "Contact", "Lead", "Opportunity", "Calendar", "Meeting", "Call", "Task", "Case", "Prospect", "Email"), + "quickCreateList" => array("Account", "Contact", "Lead", "Opportunity", "Meeting", "Call", "Task", "Case", "Prospect"), + 'isInstalled' => false, ); diff --git a/install/core/init/config.php b/install/core/init/config.php index 810bec64b6..6a982e4020 100644 --- a/install/core/init/config.php +++ b/install/core/init/config.php @@ -18,28 +18,8 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. - ************************************************************************/ + ************************************************************************/ return array( - 'tabList' => - array ( - 'Account', - 'Contact', - 'Lead', - 'Prospect', - 'Opportunity', - 'Calendar', - 'Meeting', - 'Call', - 'Task', - 'Case', - ), - 'quickCreateList' => - array ( - 'Contact', - 'Lead', - 'Meeting', - 'Call', - 'Task', - ), + ); \ No newline at end of file