diff --git a/application/Espo/Core/Upgrades/Base.php b/application/Espo/Core/Upgrades/Base.php index 6ba67d29af..7c5374dd57 100644 --- a/application/Espo/Core/Upgrades/Base.php +++ b/application/Espo/Core/Upgrades/Base.php @@ -319,7 +319,7 @@ abstract class Base $manifestPath = Util::concatPath($upgradePath, $this->manifestName); if (!file_exists($manifestPath)) { - throw new Error('It\'s not an uprgade package.'); + throw new Error('It\'s not an upgrade package.'); } $manifestJson = $this->getFileManager()->getContents($manifestPath); @@ -390,4 +390,4 @@ abstract class Base } -} \ No newline at end of file +} diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php index 58fde57ec4..c6dce4d685 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Bool.php @@ -18,15 +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/. - ************************************************************************/ + ************************************************************************/ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\BooleanType; - -class Bool extends Type +class Bool extends BooleanType { const BOOL = 'bool'; @@ -39,27 +37,4 @@ class Bool extends Type { return 'TINYINT'; } - - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getBooleanTypeDeclarationSQL($fieldDeclaration); - } - - - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return $platform->convertBooleans($value); - } - - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : (bool) $value; - } - - public function getBindingType() - { - return \PDO::PARAM_BOOL; - } } \ 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 cbadfc5f97..0c0c688af0 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Int.php @@ -18,38 +18,18 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. - ************************************************************************/ + ************************************************************************/ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\IntegerType; - -class Int extends Type +class Int extends IntegerType { const INTtype = 'int'; - public function getName() { return self::INTtype; } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getIntegerTypeDeclarationSQL($fieldDeclaration); - } - - - public function convertToPHPValue($value, AbstractPlatform $platform) - { - return (null === $value) ? null : (int) $value; - } - - - public function getBindingType() - { - return \PDO::PARAM_INT; - } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php index b9a03c10ff..5d408dfec6 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Password.php @@ -18,14 +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/. - ************************************************************************/ + ************************************************************************/ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\StringType; -class Password extends Type +class Password extends StringType { const PASSWORD = 'password'; @@ -38,23 +37,5 @@ class Password extends Type { return 'VARCHAR'; } - - public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); - //return "MD5"; - } - - /*public function convertToPHPValue($value, AbstractPlatform $platform) - { - return $value; - } - - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - return $value; - } */ - - } diff --git a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php index 800aaf5402..77910cc1e3 100644 --- a/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php +++ b/application/Espo/Core/Utils/Database/DBAL/FieldTypes/Varchar.php @@ -18,15 +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/. - ************************************************************************/ + ************************************************************************/ namespace Espo\Core\Utils\Database\DBAL\FieldTypes; -use Doctrine\DBAL\Types\Type; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\StringType; - -class Varchar extends Type +class Varchar extends StringType { const VARCHAR = 'varchar'; @@ -34,16 +32,4 @@ class Varchar extends Type { return self::VARCHAR; } - - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); - //return 'varchar'; - } - - - public function getDefaultLength(AbstractPlatform $platform) - { - return $platform->getVarcharDefaultLength(); - } } \ No newline at end of file diff --git a/application/Espo/Core/Utils/File/Unifier.php b/application/Espo/Core/Utils/File/Unifier.php index 788ca6fa03..c0b365eeee 100644 --- a/application/Espo/Core/Utils/File/Unifier.php +++ b/application/Espo/Core/Utils/File/Unifier.php @@ -101,8 +101,8 @@ class Unifier $dirName = $this->getFileManager()->getDirName($dirPath, false); $defaultValues = $this->loadDefaultValues($dirName, $type); - $content= array(); - $unsets= array(); + $content = array(); + $unsets = array(); foreach($fileList as $dirName => $fileName) { if (is_array($fileName)) { /*get content from files in a sub directory*/ @@ -125,7 +125,7 @@ class Unifier } //unset content - $content= Utils\Util::unsetInArray($content, $unsets); + $content = Utils\Util::unsetInArray($content, $unsets); //END: unset content return $content; @@ -141,27 +141,16 @@ class Unifier */ protected function unifyGetContents($paths, $defaults) { - $fileContent= $this->getFileManager()->getContents($paths); - $decoded= Utils\Json::getArrayData($fileContent); + $fileContent = $this->getFileManager()->getContents($paths); - if (empty($decoded) && !is_array($decoded)) { - $GLOBALS['log']->emergency('Syntax error or empty file - '.Utils\Util::concatPath($folderPath, $fileName)); - } else { - //Default values - if (is_string($defaults) && !empty($defaults)) { - $defType= $defaults; - unset($defaults); - $name= $this->getFileManager()->getFileName($fileName, '.json'); + $decoded = Utils\Json::getArrayData($fileContent, null); - $defaults= $this->loadDefaultValues($name, $defType); - } - $mergedValues= Utils\Util::merge($defaults, $decoded); - //END: Default values - - return $mergedValues; + if (!isset($decoded)) { + $GLOBALS['log']->emergency('Syntax error in '.Utils\Util::concatPath($paths)); + return array(); } - return array(); + return $decoded; } /** @@ -174,10 +163,10 @@ class Unifier */ protected function loadDefaultValues($name, $type='metadata') { - $defaultPath= $this->params['defaultsPath']; + $defaultPath = $this->params['defaultsPath']; - $defaultValue= $this->getFileManager()->getContents( array($defaultPath, $type, $name.'.json') ); - if ($defaultValue!==false) { + $defaultValue = $this->getFileManager()->getContents( array($defaultPath, $type, $name.'.json') ); + if ($defaultValue !== false) { //return default array return Utils\Json::decode($defaultValue, true); } diff --git a/application/Espo/Core/Utils/Json.php b/application/Espo/Core/Utils/Json.php index ebcabb36e5..340cb58d01 100644 --- a/application/Espo/Core/Utils/Json.php +++ b/application/Espo/Core/Utils/Json.php @@ -118,7 +118,7 @@ class Json * * @return array */ - public static function getArrayData($data) + public static function getArrayData($data, $returns = array()) { if (is_array($data)) { return $data; @@ -127,7 +127,7 @@ class Json return static::decode($data, true); } - return array(); + return $returns; } 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 7eb46e9dc6..3b029cd72b 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Lead.json +++ b/application/Espo/Modules/Crm/Resources/i18n/nl_NL/Lead.json @@ -2,7 +2,7 @@ "labels": { "Converted To": "Vertaald naar", "Create Lead": "Grote Lead", - "Convert": "Vertaald" + "Convert": "Converteer" }, "fields": { "name": "Record Naam", @@ -29,7 +29,7 @@ "New": "Nieuw", "Assigned": "Toegewezen", "In Process": "In Behandeling", - "Converted": "Vertaald", + "Converted": "Converteren", "Recycled": "Opnieuw verwerkt", "Dead": "Dood" }, diff --git a/application/Espo/Resources/i18n/en_US/Admin.json b/application/Espo/Resources/i18n/en_US/Admin.json index 139d0e95f0..9a772eb985 100644 --- a/application/Espo/Resources/i18n/en_US/Admin.json +++ b/application/Espo/Resources/i18n/en_US/Admin.json @@ -95,7 +95,7 @@ "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", + "selectUpgradePackage": "Select upgrade package", "selectLayout": "Select needed layout in the left menu and edit it." }, "descriptions": { diff --git a/application/Espo/Services/EmailAccount.php b/application/Espo/Services/EmailAccount.php index 477e145def..aa8ceffef8 100644 --- a/application/Espo/Services/EmailAccount.php +++ b/application/Espo/Services/EmailAccount.php @@ -78,6 +78,16 @@ class EmailAccount extends Record 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') { diff --git a/package.json b/package.json index 75d23ce55a..c099a85d7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "2.5.1", + "version": "2.5.2", "description": "", "main": "index.php", "repository": "",