mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 15:06:06 +00:00
fix bad comments
This commit is contained in:
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
@@ -79,25 +78,11 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
throw new Error('Cannot save settings');
|
||||
}
|
||||
|
||||
/** Rebuild for Currency Settings *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Rebuild for Currency Settings */
|
||||
if (isset($data['baseCurrency']) || isset($data['currencyRates'])) {
|
||||
$this->getContainer()->get('dataManager')->rebuildDatabase(array());
|
||||
}
|
||||
/** END Rebuild for Currency Settings *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** END Rebuild for Currency Settings */
|
||||
|
||||
return $this->getConfigData();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
|
||||
class Application
|
||||
{
|
||||
private $metadata;
|
||||
@@ -42,14 +41,7 @@ class Application
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->container = new Container();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
class Container
|
||||
{
|
||||
|
||||
@@ -37,14 +36,7 @@ class Container
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Controllers;
|
||||
|
||||
use \Espo\Core\Container;
|
||||
use \Espo\Core\ServiceFactory;
|
||||
use \Espo\Core\Utils\Util;
|
||||
@@ -76,14 +75,7 @@ abstract class Base
|
||||
* Get request method name (Uppercase)
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getRequestMethod()
|
||||
{
|
||||
return $this->requestMethod;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
use \PDO;
|
||||
use Espo\Core\Utils\Json;
|
||||
use Espo\Core\Exceptions\NotFound;
|
||||
@@ -140,14 +139,7 @@ class CronManager
|
||||
* Run Cron
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
if (!$this->checkLastRunTime()) {
|
||||
@@ -210,14 +202,7 @@ class CronManager
|
||||
* @param array $job
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function runScheduledJob(array $job)
|
||||
{
|
||||
$jobName = $job['method'];
|
||||
@@ -242,14 +227,7 @@ class CronManager
|
||||
* @param array $job
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function runService(array $job)
|
||||
{
|
||||
$serviceName = $job['service_name'];
|
||||
@@ -277,14 +255,7 @@ class CronManager
|
||||
* Check scheduled jobs and create related jobs
|
||||
*
|
||||
* @return array List of created Jobs
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function createJobsFromScheduledJobs()
|
||||
{
|
||||
$entityManager = $this->getEntityManager();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
class DataManager
|
||||
{
|
||||
private $container;
|
||||
@@ -50,14 +49,7 @@ class DataManager
|
||||
* Rebuild the system with metadata, database and cache clearing
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function rebuild($entityList = null)
|
||||
{
|
||||
$result = $this->clearCache();
|
||||
@@ -73,14 +65,7 @@ class DataManager
|
||||
* Clear a cache
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function clearCache()
|
||||
{
|
||||
$result = $this->getContainer()->get('fileManager')->removeInDir($this->cachePath);
|
||||
@@ -98,14 +83,7 @@ class DataManager
|
||||
* Rebuild database
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function rebuildDatabase($entityList = null)
|
||||
{
|
||||
try {
|
||||
@@ -128,14 +106,7 @@ class DataManager
|
||||
* Rebuild metadata
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function rebuildMetadata()
|
||||
{
|
||||
$metadata = $this->getContainer()->get('metadata');
|
||||
@@ -153,14 +124,7 @@ class DataManager
|
||||
* Update cache timestamp
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function updateCacheTimestamp()
|
||||
{
|
||||
$this->getContainer()->get('config')->updateCacheTimestamp();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
use \Espo\Core\Exceptions\NotFound,
|
||||
\Espo\Core\Utils\Util;
|
||||
|
||||
@@ -49,14 +48,7 @@ class EntryPointManager
|
||||
|
||||
/**
|
||||
* @var array - path to entryPoint files
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $paths = array(
|
||||
'corePath' => 'application/Espo/EntryPoints',
|
||||
'modulePath' => 'application/Espo/Modules/{*}/EntryPoints',
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
use \Espo\Core\Exceptions\Error,
|
||||
\Espo\Core\Utils\Util;
|
||||
|
||||
@@ -46,14 +45,7 @@ class HookManager
|
||||
* List of defined hooks
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $hookList = array(
|
||||
'beforeSave',
|
||||
'afterSave',
|
||||
@@ -148,14 +140,7 @@ class HookManager
|
||||
* @param array $hookDirs - it can be an array('Espo/Hooks', 'Espo/Custom/Hooks', 'Espo/Modules/Crm/Hooks')
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getHookData($hookDirs)
|
||||
{
|
||||
if (is_string($hookDirs)) {
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
* of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
@@ -39,14 +38,7 @@
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
|
||||
namespace Espo\Core\Mail\Mail\Header;
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
use \Espo\Core\Utils\Util;
|
||||
@@ -41,14 +40,7 @@ class ServiceFactory
|
||||
|
||||
/**
|
||||
* @var array - path to Service files
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $paths = array(
|
||||
'corePath' => 'application/Espo/Services',
|
||||
'modulePath' => 'application/Espo/Modules/{*}/Services',
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions;
|
||||
|
||||
use Espo\Core\Utils\Util;
|
||||
use Espo\Core\Utils\System;
|
||||
use Espo\Core\Utils\Json;
|
||||
@@ -63,38 +62,17 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* Directory name of files in a package
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
const FILES = 'files';
|
||||
|
||||
/**
|
||||
* Directory name of scripts in a package
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
const SCRIPTS = 'scripts';
|
||||
|
||||
/**
|
||||
* Package types
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $packageTypes = array(
|
||||
'upgrade' => 'upgrade',
|
||||
'extension' => 'extension',
|
||||
@@ -102,14 +80,7 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* Default package type
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $defaultPackageType = 'extension';
|
||||
|
||||
|
||||
@@ -215,14 +186,7 @@ abstract class Base
|
||||
*
|
||||
* @param string $version
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function isAcceptable()
|
||||
{
|
||||
$manifest = $this->getManifest();
|
||||
@@ -285,14 +249,7 @@ abstract class Base
|
||||
{
|
||||
$manifest = $this->getManifest();
|
||||
|
||||
/** check package type *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** check package type */
|
||||
$type = strtolower( $this->getParams('name') );
|
||||
$manifestType = isset($manifest['type']) ? strtolower($manifest['type']) : $this->defaultPackageType;
|
||||
|
||||
@@ -316,14 +273,7 @@ abstract class Base
|
||||
* Run scripts by type
|
||||
* @param string $type Ex. "before", "after"
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function runScript($type)
|
||||
{
|
||||
$packagePath = $this->getPackagePath();
|
||||
@@ -353,14 +303,7 @@ abstract class Base
|
||||
*
|
||||
* @param string $processId
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getPath($name = 'packagePath', $isPackage = false)
|
||||
{
|
||||
$postfix = $isPackage ? $this->packagePostfix : '';
|
||||
@@ -380,14 +323,7 @@ abstract class Base
|
||||
* Get a list of files defined in manifest.json
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getDeleteFileList()
|
||||
{
|
||||
$manifest = $this->getManifest();
|
||||
@@ -403,14 +339,7 @@ abstract class Base
|
||||
* Delete files defined in a manifest
|
||||
*
|
||||
* @return boolen
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function deleteFiles($withEmptyDirs = false)
|
||||
{
|
||||
$deleteFileList = $this->getDeleteFileList();
|
||||
@@ -469,14 +398,7 @@ abstract class Base
|
||||
*
|
||||
* @param string $processId
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function copyFiles()
|
||||
{
|
||||
$packagePath = $this->getPackagePath();
|
||||
@@ -515,14 +437,7 @@ abstract class Base
|
||||
*
|
||||
* @param array $manifest
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function checkManifest(array $manifest)
|
||||
{
|
||||
$requiredFields = array(
|
||||
@@ -543,14 +458,7 @@ abstract class Base
|
||||
* Unzip a package archieve
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function unzipArchive($packagePath = null)
|
||||
{
|
||||
$packagePath = isset($packagePath) ? $packagePath : $this->getPackagePath();
|
||||
@@ -570,14 +478,7 @@ abstract class Base
|
||||
* Delete temporary package files
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function deletePackageFiles()
|
||||
{
|
||||
$packagePath = $this->getPackagePath();
|
||||
@@ -590,14 +491,7 @@ abstract class Base
|
||||
* Delete temporary package archive
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function deletePackageArchive()
|
||||
{
|
||||
$packageArchive = $this->getPackagePath(true);
|
||||
@@ -618,14 +512,7 @@ abstract class Base
|
||||
* @param string $data
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function executeAction($actionName, $data)
|
||||
{
|
||||
$actionManager = $this->getActionManager();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions\Base;
|
||||
|
||||
class Delete extends \Espo\Core\Upgrades\Actions\Base
|
||||
{
|
||||
public function run($data)
|
||||
@@ -47,14 +46,7 @@ class Delete extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->beforeRunAction();
|
||||
|
||||
/* delete a package *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* delete a package */
|
||||
$this->deletePackage();
|
||||
|
||||
$this->afterRunAction();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions\Base;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
use Espo\Core\Utils\Util;
|
||||
|
||||
@@ -39,14 +38,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
*
|
||||
* @param string $processId Upgrade/Extension ID, gotten in upload stage
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function run($data)
|
||||
{
|
||||
$processId = $data['id'];
|
||||
@@ -61,14 +53,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->initialize();
|
||||
|
||||
/** check if an archive is unzipped, if no then unzip *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** check if an archive is unzipped, if no then unzip */
|
||||
$packagePath = $this->getPackagePath();
|
||||
if (!file_exists($packagePath)) {
|
||||
$this->unzipArchive();
|
||||
@@ -82,64 +67,29 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->backupExistingFiles();
|
||||
|
||||
/* run before install script *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* run before install script */
|
||||
$this->runScript('before');
|
||||
|
||||
/* copy files from directory "Files" to EspoCRM files *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* copy files from directory "Files" to EspoCRM files */
|
||||
if (!$this->copyFiles()) {
|
||||
$this->throwErrorAndRemovePackage('Cannot copy files.');
|
||||
}
|
||||
|
||||
/* remove files defined in a manifest *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* remove files defined in a manifest */
|
||||
$this->deleteFiles(true);
|
||||
|
||||
if (!$this->systemRebuild()) {
|
||||
$this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
|
||||
}
|
||||
|
||||
/* run before install script *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* run before install script */
|
||||
$this->runScript('after');
|
||||
|
||||
$this->afterRunAction();
|
||||
|
||||
$this->clearCache();
|
||||
|
||||
/* delete unziped files *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* delete unziped files */
|
||||
$this->deletePackageFiles();
|
||||
|
||||
$this->finalize();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions\Base;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
use Espo\Core\Utils\Util;
|
||||
use Espo\Core\Utils\Json;
|
||||
@@ -53,14 +52,7 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->beforeRunAction();
|
||||
|
||||
/* run before install script *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* run before install script */
|
||||
if (!isset($data['isNotRunScriptBefore']) || !$data['isNotRunScriptBefore']) {
|
||||
$this->runScript('beforeUninstall');
|
||||
}
|
||||
@@ -68,26 +60,12 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
$backupPath = $this->getPath('backupPath');
|
||||
if (file_exists($backupPath)) {
|
||||
|
||||
/* copy core files *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* copy core files */
|
||||
if (!$this->copyFiles()) {
|
||||
$this->throwErrorAndRemovePackage('Cannot copy files.');
|
||||
}
|
||||
|
||||
/* remove extension files, saved in fileList *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* remove extension files, saved in fileList */
|
||||
if (!$this->deleteFiles(true)) {
|
||||
$this->throwErrorAndRemovePackage('Permission denied to delete files.');
|
||||
}
|
||||
@@ -97,14 +75,7 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
$this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
|
||||
}
|
||||
|
||||
/* run after uninstall script *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* run after uninstall script */
|
||||
if (!isset($data['isNotRunScriptAfter']) || !$data['isNotRunScriptAfter']) {
|
||||
$this->runScript('afterUninstall');
|
||||
}
|
||||
@@ -113,14 +84,7 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->clearCache();
|
||||
|
||||
/* delete backup files *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* delete backup files */
|
||||
$this->deletePackageFiles();
|
||||
|
||||
$this->finalize();
|
||||
@@ -163,14 +127,7 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
*
|
||||
* @param string $processId
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getPackagePath($isPackage = false)
|
||||
{
|
||||
if ($isPackage) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions\Base;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class Upload extends \Espo\Core\Upgrades\Actions\Base
|
||||
@@ -38,14 +37,7 @@ class Upload extends \Espo\Core\Upgrades\Actions\Base
|
||||
*
|
||||
* @param [type] $contents
|
||||
* @return string ID of upgrade/extension process
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function run($data)
|
||||
{
|
||||
$processId = $this->createProcessId();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions\Extension;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class Delete extends \Espo\Core\Upgrades\Actions\Base\Delete
|
||||
@@ -39,14 +38,7 @@ class Delete extends \Espo\Core\Upgrades\Actions\Base\Delete
|
||||
* Get entity of this extension
|
||||
*
|
||||
* @return \Espo\Entities\Extension
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getExtensionEntity()
|
||||
{
|
||||
if (!isset($this->extensionEntity)) {
|
||||
@@ -62,14 +54,7 @@ class Delete extends \Espo\Core\Upgrades\Actions\Base\Delete
|
||||
|
||||
protected function afterRunAction()
|
||||
{
|
||||
/** Delete extension entity *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Delete extension entity */
|
||||
$extensionEntity = $this->getExtensionEntity();
|
||||
$this->getEntityManager()->removeEntity($extensionEntity);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions\Extension;
|
||||
|
||||
use Espo\Core\Exceptions\Error,
|
||||
Espo\Core\ExtensionManager;
|
||||
|
||||
@@ -55,28 +54,14 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* Copy Existing files to backup directory
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function backupExistingFiles()
|
||||
{
|
||||
parent::backupExistingFiles();
|
||||
|
||||
$backupPath = $this->getPath('backupPath');
|
||||
|
||||
/** copy scripts files *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** copy scripts files */
|
||||
$packagePath = $this->getPackagePath();
|
||||
$res &= $this->copy(array($packagePath, self::SCRIPTS), array($backupPath, self::SCRIPTS), true);
|
||||
|
||||
@@ -98,14 +83,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* Get extension ID. It's an ID of existing entity (if available) or Installation ID
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getExtensionId()
|
||||
{
|
||||
$extensionEntity = $this->getExtensionEntity();
|
||||
@@ -124,14 +102,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* Get entity of this extension
|
||||
*
|
||||
* @return \Espo\Entities\Extension
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getExtensionEntity()
|
||||
{
|
||||
return $this->extensionEntity;
|
||||
@@ -141,14 +112,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* Find Extension entity
|
||||
*
|
||||
* @return \Espo\Entities\Extension
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function findExtension()
|
||||
{
|
||||
$manifest = $this->getManifest();
|
||||
@@ -165,14 +129,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* Create a record of Extension Entity
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function storeExtension()
|
||||
{
|
||||
$entityManager = $this->getEntityManager();
|
||||
@@ -202,14 +159,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* Compare version between installed and a new extensions
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function compareVersion()
|
||||
{
|
||||
$manifest = $this->getManifest();
|
||||
@@ -229,14 +179,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
*
|
||||
* @param string $errorMessage
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function throwErrorAndRemovePackage($errorMessage = '')
|
||||
{
|
||||
if (!$this->isNew()) {
|
||||
@@ -250,14 +193,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* If extension already installed, uninstall an old version
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function uninstallExtension()
|
||||
{
|
||||
$extensionEntity = $this->getExtensionEntity();
|
||||
@@ -273,14 +209,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* Delete extension package
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function deleteExtension()
|
||||
{
|
||||
$extensionEntity = $this->getExtensionEntity();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions\Extension;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class Uninstall extends \Espo\Core\Upgrades\Actions\Base\Uninstall
|
||||
@@ -39,14 +38,7 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base\Uninstall
|
||||
* Get entity of this extension
|
||||
*
|
||||
* @return \Espo\Entities\Extension
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getExtensionEntity()
|
||||
{
|
||||
if (!isset($this->extensionEntity)) {
|
||||
@@ -62,14 +54,7 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base\Uninstall
|
||||
|
||||
protected function afterRunAction()
|
||||
{
|
||||
/** Set extension entity, isInstalled = false *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Set extension entity, isInstalled = false */
|
||||
$extensionEntity = $this->getExtensionEntity();
|
||||
|
||||
$extensionEntity->set('isInstalled', false);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class Helper
|
||||
@@ -58,14 +57,7 @@ class Helper
|
||||
* @param array | string $dependencyList
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function checkDependencies($dependencyList)
|
||||
{
|
||||
if (!is_array($dependencyList)) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Upgrades\Actions\Upgrade;
|
||||
|
||||
class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
{
|
||||
protected function finalize()
|
||||
@@ -43,14 +42,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
* Delete temporary package files
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function deletePackageFiles()
|
||||
{
|
||||
$res = parent::deletePackageFiles();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Api;
|
||||
|
||||
class Output
|
||||
{
|
||||
private $slim;
|
||||
@@ -57,14 +56,7 @@ class Output
|
||||
* Output the result
|
||||
*
|
||||
* @param mixed $data - JSON
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function render($data = null)
|
||||
{
|
||||
if (is_array($data)) {
|
||||
@@ -96,14 +88,7 @@ class Output
|
||||
* @param int $statusCode
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function displayError($text, $statusCode = 500, $isPrint = false)
|
||||
{
|
||||
$GLOBALS['log']->error('Display Error: '.$text.', Code: '.$statusCode.' URL: '.$_SERVER['REQUEST_URI']);
|
||||
@@ -132,14 +117,7 @@ class Output
|
||||
*
|
||||
* @param int $statusCode
|
||||
* @return string | null
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getCodeDesc($statusCode)
|
||||
{
|
||||
if (isset($this->errorDesc[$statusCode])) {
|
||||
@@ -155,14 +133,7 @@ class Output
|
||||
* @param string $inputData
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function clearPasswords($inputData)
|
||||
{
|
||||
return preg_replace('/"(.*?password.*?)":".*?"/i', '"$1":"*****"', $inputData);
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
namespace Espo\Core\Utils\Api;
|
||||
|
||||
|
||||
class Slim extends \Slim\Slim
|
||||
{
|
||||
|
||||
@@ -37,14 +36,7 @@ class Slim extends \Slim\Slim
|
||||
* Redefine the run method
|
||||
*
|
||||
* We no need to use a Slim handler
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//set_error_handler(array('\Slim\Slim', 'handleErrors')); //Espo: no needs to use this handler
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication;
|
||||
|
||||
use Espo\Core\Exceptions\Error,
|
||||
Espo\Core\Utils\Config,
|
||||
Espo\Core\ORM\EntityManager,
|
||||
@@ -44,14 +43,7 @@ class LDAP extends Base
|
||||
* Espo => LDAP name
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $fields = array(
|
||||
'userName' => 'cn',
|
||||
'firstName' => 'givenname',
|
||||
@@ -87,14 +79,7 @@ class LDAP extends Base
|
||||
* @param string $password
|
||||
* @param \Espo\Entities\AuthToken $authToken
|
||||
* @return \Espo\Entities\User | null
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function login($username, $password, \Espo\Entities\AuthToken $authToken = null)
|
||||
{
|
||||
if ($authToken) {
|
||||
@@ -133,14 +118,7 @@ class LDAP extends Base
|
||||
|
||||
$isCreateUser = $this->getUtils()->getOption('createEspoUser');
|
||||
if (!isset($user) && $isCreateUser) {
|
||||
$this->getAuth()->useNoAuth(); /** Required to fix Acl "isFetched()" error *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
$this->getAuth()->useNoAuth(); /** Required to fix Acl "isFetched()" error */
|
||||
$user = $this->createUser($userData);
|
||||
}
|
||||
|
||||
@@ -153,14 +131,7 @@ class LDAP extends Base
|
||||
* @param string $username
|
||||
* @param \Espo\Entities\AuthToken $authToken
|
||||
* @return \Espo\Entities\User | null
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function loginByToken($username, \Espo\Entities\AuthToken $authToken = null)
|
||||
{
|
||||
if (!isset($authToken)) {
|
||||
@@ -191,14 +162,7 @@ class LDAP extends Base
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @return \Espo\Entities\User | null
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function adminLogin($username, $password)
|
||||
{
|
||||
$hash = $this->getPasswordHash()->hash($password);
|
||||
@@ -219,14 +183,7 @@ class LDAP extends Base
|
||||
*
|
||||
* @param array $userData LDAP entity data
|
||||
* @return \Espo\Entities\User
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function createUser(array $userData)
|
||||
{
|
||||
$data = array();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\LDAP;
|
||||
|
||||
class LDAP extends \Zend\Ldap\Ldap
|
||||
{
|
||||
protected $usernameAttribute = 'cn';
|
||||
@@ -38,14 +37,7 @@ class LDAP extends \Zend\Ldap\Ldap
|
||||
* Get DN depends on options, ex. "cn=test,ou=People,dc=maxcrc,dc=com"
|
||||
*
|
||||
* @return string DN format
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getDn($acctname)
|
||||
{
|
||||
return $this->getAccountDn($acctname, \Zend\Ldap\Ldap::ACCTNAME_FORM_DN);
|
||||
@@ -56,14 +48,7 @@ class LDAP extends \Zend\Ldap\Ldap
|
||||
*
|
||||
* @param string $acctname
|
||||
* @return string - Account DN
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getAccountDn($acctname)
|
||||
{
|
||||
$baseDn = $this->getBaseDn();
|
||||
@@ -91,14 +76,7 @@ class LDAP extends \Zend\Ldap\Ldap
|
||||
* @param int $scope
|
||||
* @param array $attributes
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function searchByLoginFilter($filter, $basedn = null, $scope = self::SEARCH_SCOPE_SUB, array $attributes = array())
|
||||
{
|
||||
$filter = $this->getLoginFilter($filter);
|
||||
@@ -117,14 +95,7 @@ class LDAP extends \Zend\Ldap\Ldap
|
||||
*
|
||||
* @param string $filter
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getLoginFilter($filter)
|
||||
{
|
||||
$baseFilter = '(objectClass=*)';
|
||||
@@ -141,14 +112,7 @@ class LDAP extends \Zend\Ldap\Ldap
|
||||
*
|
||||
* @param string $filter [description]
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function convertToFilterFormat($filter)
|
||||
{
|
||||
$filter = trim($filter);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Authentication\LDAP;
|
||||
|
||||
use \Espo\Core\Utils\Config;
|
||||
|
||||
class Utils
|
||||
@@ -40,14 +39,7 @@ class Utils
|
||||
/**
|
||||
* Association between LDAP and Espo fields
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $fieldMap = array(
|
||||
'host' => 'ldapHost',
|
||||
'port' => 'ldapPort',
|
||||
@@ -72,14 +64,7 @@ class Utils
|
||||
* Permitted Espo Options
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $permittedEspoOptions = array(
|
||||
'createEspoUser' => false,
|
||||
'userLoginFilter' => null,
|
||||
@@ -89,14 +74,7 @@ class Utils
|
||||
* accountCanonicalForm Map between Espo and Zend value
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $accountCanonicalFormMap = array(
|
||||
'Dn' => 1,
|
||||
'Username' => 2,
|
||||
@@ -119,14 +97,7 @@ class Utils
|
||||
* Get Options from espo config according to $this->fieldMap
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
if (isset($this->options)) {
|
||||
@@ -142,14 +113,7 @@ class Utils
|
||||
}
|
||||
}
|
||||
|
||||
/** peculiar fields *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** peculiar fields */
|
||||
$options['useSsl'] = (bool) ($options['useSsl'] == 'SSL');
|
||||
$options['useStartTls'] = (bool) ($options['useStartTls'] == 'TLS');
|
||||
$options['accountCanonicalForm'] = $this->accountCanonicalFormMap[ $options['accountCanonicalForm'] ];
|
||||
@@ -165,14 +129,7 @@ class Utils
|
||||
* @param string $name
|
||||
* @param mixed $returns Return value
|
||||
* @return mixed
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getOption($name, $returns = null)
|
||||
{
|
||||
if (isset($this->options)) {
|
||||
@@ -190,14 +147,7 @@ class Utils
|
||||
* Get Zend options for using Zend\Ldap
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getZendOptions()
|
||||
{
|
||||
$options = $this->getOptions();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
class Config
|
||||
{
|
||||
/**
|
||||
@@ -36,14 +35,7 @@ class Config
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $defaultConfigPath = 'application/Espo/Core/defaults/config.php';
|
||||
|
||||
private $systemConfigPath = 'application/Espo/Core/defaults/systemConfig.php';
|
||||
@@ -57,14 +49,7 @@ class Config
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $adminItems = array();
|
||||
|
||||
|
||||
@@ -73,14 +58,7 @@ class Config
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $data;
|
||||
|
||||
private $changedData = array();
|
||||
@@ -110,14 +88,7 @@ class Config
|
||||
* @param string $name
|
||||
* @param string $default
|
||||
* @return string | array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function get($name, $default = null)
|
||||
{
|
||||
$keys = explode('.', $name);
|
||||
@@ -140,14 +111,7 @@ class Config
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function set($name, $value = '')
|
||||
{
|
||||
if (!is_array($name)) {
|
||||
@@ -170,14 +134,7 @@ class Config
|
||||
*
|
||||
* @param string $name
|
||||
* @return bool | null - null if an option doesn't exist
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function remove($name)
|
||||
{
|
||||
if (array_key_exists($name, $this->data)) {
|
||||
@@ -229,14 +186,7 @@ class Config
|
||||
* Return an Object of all configs
|
||||
* @param boolean $reload
|
||||
* @return array()
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function loadConfig($reload = false)
|
||||
{
|
||||
if (!$reload && isset($this->data) && !empty($this->data)) {
|
||||
@@ -259,14 +209,7 @@ class Config
|
||||
*
|
||||
* @param $isAdmin
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getData($isAdmin = false)
|
||||
{
|
||||
$data = $this->loadConfig();
|
||||
@@ -287,14 +230,7 @@ class Config
|
||||
*
|
||||
* @param $isAdmin
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function setData($data, $isAdmin = false)
|
||||
{
|
||||
$restrictItems = $this->getRestrictItems($isAdmin);
|
||||
@@ -314,14 +250,7 @@ class Config
|
||||
*
|
||||
* @param $onlyValue - If need to return just timestamp array
|
||||
* @return bool | array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function updateCacheTimestamp($onlyValue = false)
|
||||
{
|
||||
$timestamp = array(
|
||||
@@ -339,14 +268,7 @@ class Config
|
||||
* Get admin items
|
||||
*
|
||||
* @return object
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getRestrictItems($onlySystemItems = false)
|
||||
{
|
||||
$data = $this->loadConfig();
|
||||
@@ -369,14 +291,7 @@ class Config
|
||||
* @param $name
|
||||
* @param $isAdmin
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function isAllowed($name, $isAdmin = false)
|
||||
{
|
||||
if (in_array($name, $this->getRestrictItems($isAdmin))) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Cron;
|
||||
|
||||
use \PDO;
|
||||
use \Espo\Core\CronManager;
|
||||
use \Espo\Core\Utils\Config;
|
||||
@@ -69,24 +68,10 @@ class Job
|
||||
* Get Pending Jobs
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getPendingJobs()
|
||||
{
|
||||
/** Mark Failed old jobs and remove pending duplicates *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Mark Failed old jobs and remove pending duplicates */
|
||||
$this->markFailedJobs();
|
||||
$this->markJobAttempts();
|
||||
$this->removePendingJobDuplicates();
|
||||
@@ -112,14 +97,7 @@ class Job
|
||||
* @param string $status
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getActiveJobs($displayColumns = '*', $status = CronManager::PENDING, $fetchMode = PDO::FETCH_ASSOC)
|
||||
{
|
||||
$jobConfigs = $this->getConfig()->get('cron');
|
||||
@@ -149,14 +127,7 @@ class Job
|
||||
* @param string $time
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getJobByScheduledJob($scheduledJobId, $time)
|
||||
{
|
||||
$dateObj = new \DateTime($time);
|
||||
@@ -181,14 +152,7 @@ class Job
|
||||
* Mark pending jobs (all jobs that exceeded jobPeriod)
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function markFailedJobs()
|
||||
{
|
||||
$jobConfigs = $this->getConfig()->get('cron');
|
||||
@@ -226,14 +190,7 @@ class Job
|
||||
* Remove pending duplicate jobs, no need to run twice the same job
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function removePendingJobDuplicates()
|
||||
{
|
||||
$pdo = $this->getEntityManager()->getPDO();
|
||||
@@ -255,14 +212,7 @@ class Job
|
||||
foreach ($duplicateJobs as $row) {
|
||||
if (!empty($row['scheduled_job_id'])) {
|
||||
|
||||
/* no possibility to use limit in update or subqueries *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* 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
|
||||
@@ -284,14 +234,7 @@ class Job
|
||||
* Mark job attempts
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function markJobAttempts()
|
||||
{
|
||||
$query = "SELECT * FROM job WHERE
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Cron;
|
||||
|
||||
use \PDO;
|
||||
use \Espo\Core\Utils\Config;
|
||||
use \Espo\Core\ORM\EntityManager;
|
||||
@@ -59,14 +58,7 @@ class ScheduledJob
|
||||
* Get active Scheduler Jobs
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getActiveJobs()
|
||||
{
|
||||
$query = "SELECT * FROM scheduled_job WHERE
|
||||
@@ -94,14 +86,7 @@ class ScheduledJob
|
||||
* @param string $status
|
||||
*
|
||||
* @return string ID of created ScheduledJobLogRecord
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function addLogRecord($scheduledJobId, $status, $runTime = null)
|
||||
{
|
||||
if (!isset($runTime)) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database;
|
||||
|
||||
use Espo\Core\Utils\Util,
|
||||
Espo\ORM\Entity;
|
||||
|
||||
@@ -80,14 +79,7 @@ class Converter
|
||||
* Main method of convertation from metadata to orm metadata and database schema
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function process()
|
||||
{
|
||||
$GLOBALS['log']->debug('Orm\Converter - Start: orm convertation');
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\DBAL\Platforms;
|
||||
|
||||
use Doctrine\DBAL\Schema\TableDiff;
|
||||
use Doctrine\DBAL\Schema\Index;
|
||||
use Doctrine\DBAL\Schema\Table;
|
||||
@@ -66,14 +65,7 @@ class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform
|
||||
$columnArray = $column->toArray();
|
||||
$columnArray['comment'] = $this->getColumnComment($column);
|
||||
/*$queryParts[] = 'CHANGE ' . $oldColumnName . ' '
|
||||
. $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
. $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); */
|
||||
$queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); //espo: fixed the problem
|
||||
} //espo: END
|
||||
|
||||
@@ -108,14 +100,7 @@ class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform
|
||||
continue;
|
||||
}
|
||||
|
||||
/* @var $columnDiff \Doctrine\DBAL\Schema\ColumnDiff *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* @var $columnDiff \Doctrine\DBAL\Schema\ColumnDiff */
|
||||
$column = $columnDiff->column;
|
||||
$columnArray = $column->toArray();
|
||||
$columnArray['comment'] = $this->getColumnComment($column);
|
||||
|
||||
@@ -29,32 +29,17 @@
|
||||
|
||||
namespace Espo\Core\Utils\Database\DBAL\Schema;
|
||||
|
||||
|
||||
class Column extends \Doctrine\DBAL\Schema\Column
|
||||
{
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $_notnull = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $_unique = false;
|
||||
|
||||
|
||||
@@ -62,14 +47,7 @@ class Column extends \Doctrine\DBAL\Schema\Column
|
||||
* @param boolean $unique
|
||||
*
|
||||
* @return \Doctrine\DBAL\Schema\Column
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function setUnique($unique)
|
||||
{
|
||||
$this->_unique = (bool)$unique;
|
||||
@@ -79,14 +57,7 @@ class Column extends \Doctrine\DBAL\Schema\Column
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getUnique()
|
||||
{
|
||||
return $this->_unique;
|
||||
@@ -94,14 +65,7 @@ class Column extends \Doctrine\DBAL\Schema\Column
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge(array(
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\DBAL\Schema;
|
||||
|
||||
use Doctrine\DBAL\Schema\Column;
|
||||
|
||||
|
||||
@@ -67,28 +66,14 @@ class Comparator extends \Doctrine\DBAL\Schema\Comparator
|
||||
$length1 = $column1->getLength() ?: 255;
|
||||
$length2 = $column2->getLength() ?: 255;
|
||||
|
||||
/** Espo: column length can be increased only *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Espo: column length can be increased only */
|
||||
/*if ($length1 != $length2) {
|
||||
$changedProperties[] = 'length';
|
||||
}*/
|
||||
if ($length2 > $length1) {
|
||||
$changedProperties[] = 'length';
|
||||
}
|
||||
/** Espo: end *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Espo: end */
|
||||
|
||||
if ($column1->getFixed() != $column2->getFixed()) {
|
||||
$changedProperties[] = 'fixed';
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\DBAL\Schema;
|
||||
|
||||
class Schema extends \Doctrine\DBAL\Schema\Schema
|
||||
{
|
||||
|
||||
@@ -38,14 +37,7 @@ class Schema extends \Doctrine\DBAL\Schema\Schema
|
||||
* @param string $tableName
|
||||
*
|
||||
* @return \Doctrine\DBAL\Schema\Table
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function createTable($tableName)
|
||||
{
|
||||
$table = new Table($tableName);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\DBAL\Schema;
|
||||
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
|
||||
class Table extends \Doctrine\DBAL\Schema\Table
|
||||
@@ -40,14 +39,7 @@ class Table extends \Doctrine\DBAL\Schema\Table
|
||||
* @param array $options
|
||||
*
|
||||
* @return \Doctrine\DBAL\Schema\Column
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function addColumn($columnName, $typeName, array $options=array())
|
||||
{
|
||||
$column = new Column($columnName, Type::getType($typeName), $options);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Orm;
|
||||
|
||||
use Espo\Core\Utils\Util;
|
||||
|
||||
class Base
|
||||
@@ -69,14 +68,7 @@ class Base
|
||||
* Set current Field name OR Link name
|
||||
*
|
||||
* @param void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function setItemName($itemName)
|
||||
{
|
||||
$this->itemName = $itemName;
|
||||
@@ -86,14 +78,7 @@ class Base
|
||||
* Get current Field name
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getFieldName()
|
||||
{
|
||||
return $this->itemName;
|
||||
@@ -103,14 +88,7 @@ class Base
|
||||
* Get current Link name
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getLinkName()
|
||||
{
|
||||
return $this->itemName;
|
||||
@@ -120,14 +98,7 @@ class Base
|
||||
* Set current Entity Name
|
||||
*
|
||||
* @param void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function setEntityName($entityName)
|
||||
{
|
||||
$this->entityName = $entityName;
|
||||
@@ -137,14 +108,7 @@ class Base
|
||||
* Get current Entity Name
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getEntityName()
|
||||
{
|
||||
return $this->entityName;
|
||||
@@ -165,14 +129,7 @@ class Base
|
||||
*
|
||||
* @param boolean $isOrmEntityDefs
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getDefs($isOrmEntityDefs = false)
|
||||
{
|
||||
$entityDefs = $isOrmEntityDefs ? $this->getOrmEntityDefs() : $this->getEntityDefs();
|
||||
@@ -187,14 +144,7 @@ class Base
|
||||
* @param bool $isOrmEntityDefs
|
||||
* @param mixed $returns
|
||||
* @return mixed
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getEntityParams($entityName = null, $isOrmEntityDefs = false, $returns = null)
|
||||
{
|
||||
if (!isset($entityName)) {
|
||||
@@ -218,14 +168,7 @@ class Base
|
||||
* @param bool $isOrmEntityDefs
|
||||
* @param mixed $returns
|
||||
* @return mixed
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getFieldParams($fieldName = null, $entityName = null, $isOrmEntityDefs = false, $returns = null)
|
||||
{
|
||||
if (!isset($fieldName)) {
|
||||
@@ -252,14 +195,7 @@ class Base
|
||||
* @param bool $isOrmEntityDefs
|
||||
* @param mixed $returns
|
||||
* @return mixed
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getLinkParams($linkName = null, $entityName = null, $isOrmEntityDefs = false, $returns = null)
|
||||
{
|
||||
if (!isset($linkName)) {
|
||||
@@ -285,14 +221,7 @@ class Base
|
||||
* @param string $name
|
||||
* @param string $entityName
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getForeignField($name, $entityName)
|
||||
{
|
||||
$foreignField = $this->getMetadata()->get('entityDefs.'.$entityName.'.fields.'.$name);
|
||||
@@ -311,14 +240,7 @@ class Base
|
||||
*
|
||||
* @param string $value
|
||||
* @param array $array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function setArrayValue($inputValue, array $array)
|
||||
{
|
||||
foreach ($array as &$value) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Orm;
|
||||
|
||||
use Espo\Core\Utils\Util,
|
||||
Espo\ORM\Entity;
|
||||
|
||||
@@ -56,14 +55,7 @@ class Converter
|
||||
|
||||
/*
|
||||
* //pair Espo => ORM
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $fieldAccordances = array(
|
||||
'type' => 'type',
|
||||
'dbType' => 'dbType',
|
||||
@@ -78,14 +70,7 @@ class Converter
|
||||
'unique' => 'unique',
|
||||
'index' => 'index',
|
||||
/*'conditions' => 'conditions',
|
||||
'additionalColumns' => 'additionalColumns', *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
'additionalColumns' => 'additionalColumns', */
|
||||
'default' => array(
|
||||
'condition' => '^javascript:',
|
||||
'conditionEquals' => false,
|
||||
@@ -107,14 +92,7 @@ class Converter
|
||||
* Permitted Entity options which will be moved to ormMetadata
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $permittedEntityOptions = array(
|
||||
'indexes',
|
||||
'additionalTables',
|
||||
@@ -163,14 +141,7 @@ class Converter
|
||||
* Orm metadata convertation process
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function process()
|
||||
{
|
||||
$entityDefs = $this->getEntityDefs(true);
|
||||
@@ -258,14 +229,7 @@ class Converter
|
||||
* @param array $entityMeta
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function convertFields($entityName, &$entityMeta)
|
||||
{
|
||||
//List of unmerged fields with default field defenitions in $outputMeta
|
||||
@@ -290,14 +254,7 @@ class Converter
|
||||
|
||||
foreach($entityMeta['fields'] as $fieldName => $fieldParams) {
|
||||
|
||||
/** check if "fields" option exists in $fieldMeta *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** check if "fields" option exists in $fieldMeta */
|
||||
$fieldTypeMeta = $this->getMetadataHelper()->getFieldDefsByType($fieldParams);
|
||||
|
||||
$fieldDefs = $this->convertField($entityName, $fieldName, $fieldParams, $fieldTypeMeta);
|
||||
@@ -311,14 +268,7 @@ class Converter
|
||||
}
|
||||
}
|
||||
|
||||
/** check and set the linkDefs from 'fields' metadata *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** check and set the linkDefs from 'fields' metadata */
|
||||
if (isset($fieldTypeMeta['linkDefs'])) {
|
||||
$linkDefs = $this->getMetadataHelper()->getLinkDefsInFieldMeta($entityName, $fieldParams, $fieldTypeMeta['linkDefs']);
|
||||
if (isset($linkDefs)) {
|
||||
@@ -339,14 +289,7 @@ class Converter
|
||||
* @param array $ormMeta
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function correctFields($entityName, array $ormMeta)
|
||||
{
|
||||
$entityDefs = $this->getEntityDefs();
|
||||
@@ -401,14 +344,7 @@ class Converter
|
||||
|
||||
protected function convertField($entityName, $fieldName, array $fieldParams, $fieldTypeMeta = null)
|
||||
{
|
||||
/** merge fieldDefs option from field definition *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** merge fieldDefs option from field definition */
|
||||
if (!isset($fieldTypeMeta)) {
|
||||
$fieldTypeMeta = $this->getMetadataHelper()->getFieldDefsByType($fieldParams);
|
||||
}
|
||||
@@ -417,52 +353,24 @@ class Converter
|
||||
$fieldParams = Util::merge($fieldParams, $fieldTypeMeta['fieldDefs']);
|
||||
}
|
||||
|
||||
/** check if need to skipOrmDefs this field in ORM metadata *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** check if need to skipOrmDefs this field in ORM metadata */
|
||||
if (isset($fieldParams['skipOrmDefs']) && $fieldParams['skipOrmDefs'] === true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** if defined 'notNull => false' and 'required => true', then remove 'notNull' *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** 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 *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** 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 *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** check and set the field length */
|
||||
if (!isset($fieldDefs['len']) && in_array($fieldDefs['type'], array_keys($this->defaultLength))) {
|
||||
$fieldDefs['len'] = $this->defaultLength[$fieldDefs['type']];
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Orm\Fields;
|
||||
|
||||
class Base extends \Espo\Core\Utils\Database\Orm\Base
|
||||
{
|
||||
/**
|
||||
@@ -37,14 +36,7 @@ class Base extends \Espo\Core\Utils\Database\Orm\Base
|
||||
* @param string $itemName Field name
|
||||
* @param string $entityName
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function process($itemName, $entityName)
|
||||
{
|
||||
$inputs = array(
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Orm;
|
||||
|
||||
use Espo\Core\Utils\Util;
|
||||
|
||||
class RelationManager
|
||||
@@ -90,14 +89,7 @@ class RelationManager
|
||||
* @param array $currentEntityDefs
|
||||
*
|
||||
* @return array - in format array('name', 'params')
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private function getForeignLink($parentLinkName, $parentLinkParams, $currentEntityDefs)
|
||||
{
|
||||
if (isset($parentLinkParams['foreign']) && isset($currentEntityDefs['links'][$parentLinkParams['foreign']])) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Schema;
|
||||
|
||||
abstract class BaseRebuildActions
|
||||
{
|
||||
private $metadata;
|
||||
@@ -92,14 +91,7 @@ abstract class BaseRebuildActions
|
||||
public function afterRebuild()
|
||||
{
|
||||
}
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Schema;
|
||||
|
||||
use Espo\Core\Utils\Util,
|
||||
Espo\ORM\Entity,
|
||||
Espo\Core\Exceptions\Error;
|
||||
@@ -88,14 +87,7 @@ class Converter
|
||||
* @param boolean $reload
|
||||
*
|
||||
* @return \Doctrine\DBAL\Schema\Schema
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getSchema($reload = false)
|
||||
{
|
||||
if (!isset($this->dbalSchema) || $reload) {
|
||||
@@ -112,14 +104,7 @@ class Converter
|
||||
* @param array|null $entityList
|
||||
*
|
||||
* @return \Doctrine\DBAL\Schema\Schema
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function process(array $ormMeta, $entityList = null)
|
||||
{
|
||||
$GLOBALS['log']->debug('Schema\Converter - Start: building schema');
|
||||
@@ -175,14 +160,7 @@ class Converter
|
||||
}
|
||||
|
||||
$fieldType = isset($fieldParams['dbType']) ? $fieldParams['dbType'] : $fieldParams['type'];
|
||||
$fieldType = strtolower($fieldType); /** doctrine uses strtolower for all field types *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
$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;
|
||||
@@ -270,14 +248,7 @@ class Converter
|
||||
* @param array $tables
|
||||
*
|
||||
* @return \Doctrine\DBAL\Schema\Table
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function prepareManyMany($entityName, $relationParams, $tables)
|
||||
{
|
||||
$tableName = Util::toUnderScore($relationParams['relationName']);
|
||||
@@ -373,14 +344,7 @@ class Converter
|
||||
* @param string $columnName Column name (underscore field name)
|
||||
* @param bool | string $keyValue
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getKeyList($columnName, $keyValue, array $keyList)
|
||||
{
|
||||
if ($keyValue === true) {
|
||||
@@ -398,14 +362,7 @@ class Converter
|
||||
* @param array $ormMeta
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getCustomTables(array $ormMeta)
|
||||
{
|
||||
$customTables = array();
|
||||
@@ -463,14 +420,7 @@ class Converter
|
||||
* Generate index name
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function generateIndexName($name, $entityName)
|
||||
{
|
||||
$names = array(
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Schema;
|
||||
|
||||
use Doctrine\DBAL\Types\Type,
|
||||
Espo\Core\Utils\Util;
|
||||
|
||||
@@ -63,14 +62,7 @@ class Schema
|
||||
/**
|
||||
* Paths of rebuild action folders
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $rebuildActionsPath = array(
|
||||
'corePath' => 'application/Espo/Core/Utils/Database/Schema/rebuildActions',
|
||||
'customPath' => 'custom/Espo/Custom/Core/Utils/Database/Schema/rebuildActions',
|
||||
@@ -83,14 +75,7 @@ class Schema
|
||||
* 'afterRebuild' => array(...),
|
||||
* )
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $rebuildActionClasses = null;
|
||||
|
||||
|
||||
@@ -201,14 +186,7 @@ class Schema
|
||||
|
||||
/*
|
||||
* Rebuild database schema
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function rebuild($entityList = null)
|
||||
{
|
||||
if ($this->getConverter()->process() === false) {
|
||||
@@ -245,14 +223,7 @@ class Schema
|
||||
* Get current database schema
|
||||
*
|
||||
* @return \Doctrine\DBAL\Schema\Schema
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getCurrentSchema()
|
||||
{
|
||||
return $this->getConnection()->getSchemaManager()->createSchema();
|
||||
@@ -264,14 +235,7 @@ class Schema
|
||||
* @params \Doctrine\DBAL\Schema\Schema $schema
|
||||
*
|
||||
* @return array - array of SQL queries
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function toSql(\Doctrine\DBAL\Schema\SchemaDiff $schema) //Doctrine\DBAL\Schema\SchemaDiff | \Doctrine\DBAL\Schema\Schema
|
||||
{
|
||||
return $schema->toSaveSql($this->getPlatform());
|
||||
@@ -283,14 +247,7 @@ class Schema
|
||||
* Get SQL queries to get from one to another schema
|
||||
*
|
||||
* @return array - array of SQL queries
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getDiffSql(\Doctrine\DBAL\Schema\Schema $fromSchema, \Doctrine\DBAL\Schema\Schema $toSchema)
|
||||
{
|
||||
$schemaDiff = $this->getComparator()->compare($fromSchema, $toSchema);
|
||||
@@ -303,14 +260,7 @@ class Schema
|
||||
/**
|
||||
* Init Rebuild Actions, get all classes and create them
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function initRebuildActions($currentSchema = null, $metadataSchema = null)
|
||||
{
|
||||
$methods = array('beforeRebuild', 'afterRebuild');
|
||||
@@ -342,14 +292,7 @@ class Schema
|
||||
* Execute actions for RebuildAction classes
|
||||
* @param string $action action name, possible values 'beforeRebuild' | 'afterRebuild'
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function executeRebuildActions($action = 'beforeRebuild')
|
||||
{
|
||||
if (!isset($this->rebuildActionClasses)) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Schema\rebuildActions;
|
||||
|
||||
class Currency extends \Espo\Core\Utils\Database\Schema\BaseRebuildActions
|
||||
{
|
||||
|
||||
@@ -69,14 +68,7 @@ class Currency extends \Espo\Core\Utils\Database\Schema\BaseRebuildActions
|
||||
* @param string $defaultCurrency
|
||||
* @param array $currencyRates [description]
|
||||
* @return array - List of new currency rates
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function exchangeRates($baseCurrency, $defaultCurrency, array $currencyRates)
|
||||
{
|
||||
$precision = 5;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
use \Espo\Core\Exceptions\Error,
|
||||
\Espo\Core\Exceptions\Conflict;
|
||||
|
||||
@@ -179,14 +178,7 @@ class FieldManager
|
||||
* @param array $fieldDef
|
||||
* @param string $scope
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function prepareFieldDef($name, $fieldDef, $scope)
|
||||
{
|
||||
$unnecessaryFields = array(
|
||||
@@ -218,14 +210,7 @@ class FieldManager
|
||||
* @param array $fieldDef
|
||||
* @param string $scope
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function normalizeDefs($fieldName, array $fieldDef, $scope)
|
||||
{
|
||||
$fieldDef = $this->prepareFieldDef($fieldName, $fieldDef, $scope);
|
||||
@@ -246,14 +231,7 @@ class FieldManager
|
||||
),
|
||||
);
|
||||
|
||||
/** Save links for a field. *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Save links for a field. */
|
||||
$metaLinkDef = $this->getMetadataHelper()->getLinkDefsInFieldMeta($scope, $fieldDef);
|
||||
if (isset($linkDefs) || isset($metaLinkDef)) {
|
||||
$linkDefs = Util::merge((array) $metaLinkDef, (array) $linkDefs);
|
||||
@@ -269,14 +247,7 @@ class FieldManager
|
||||
* Check if changed metadata defenition for a field except 'label'
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function isDefsChanged($name, $fieldDef, $scope)
|
||||
{
|
||||
$fieldDef = $this->prepareFieldDef($name, $fieldDef, $scope);
|
||||
@@ -291,14 +262,7 @@ class FieldManager
|
||||
* Only for update method
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function isChanged()
|
||||
{
|
||||
return $this->isChanged;
|
||||
@@ -310,14 +274,7 @@ class FieldManager
|
||||
* @param string $name
|
||||
* @param string $scope
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function isCore($name, $scope)
|
||||
{
|
||||
$existingField = $this->getFieldDef($name, $scope);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\File;
|
||||
|
||||
use \Espo\Core\Utils\Util;
|
||||
|
||||
class ClassParser
|
||||
@@ -82,14 +81,7 @@ class ClassParser
|
||||
* 'customPath' => '',
|
||||
* );
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getData($paths, $cacheFile = false)
|
||||
{
|
||||
$data = null;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\File;
|
||||
|
||||
use Espo\Core\Utils\Util;
|
||||
use Espo\Core\Utils\Json;
|
||||
|
||||
@@ -60,14 +59,7 @@ class FileUnifier
|
||||
* @param bool $isReturnModuleNames - If need to return data with module names
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function unify(array $paths, $isReturnModuleNames = false)
|
||||
{
|
||||
$data = $this->loadData($paths['corePath']);
|
||||
@@ -104,14 +96,7 @@ class FileUnifier
|
||||
* @param string $filePath
|
||||
* @param array $returns
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function loadData($filePath, $returns = array())
|
||||
{
|
||||
if (file_exists($filePath)) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\File;
|
||||
|
||||
use Espo\Core\Utils,
|
||||
Espo\Core\Exceptions\Error;
|
||||
|
||||
@@ -66,14 +65,7 @@ class Manager
|
||||
* @param bool $isReturnSingleArray - if need to return a single array of file list
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getFileList($path, $recursively = false, $filter = '', $onlyFileType = null, $isReturnSingleArray = false)
|
||||
{
|
||||
$path = $this->concatPaths($path);
|
||||
@@ -132,14 +124,7 @@ class Manager
|
||||
* @param string $parentDirName
|
||||
*
|
||||
* @return aray
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getSingeFileList(array $fileList, $onlyFileType = null, $parentDirName = '')
|
||||
{
|
||||
$singleFileList = array();
|
||||
@@ -175,14 +160,7 @@ class Manager
|
||||
* @param integer $offset
|
||||
* @param integer $maxlen
|
||||
* @return mixed
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getContents($path, $useIncludePath = false, $context = null, $offset = -1, $maxlen = null)
|
||||
{
|
||||
$fullPath = $this->concatPaths($path);
|
||||
@@ -203,14 +181,7 @@ class Manager
|
||||
*
|
||||
* @param string | array $path
|
||||
* @return array | bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getPhpContents($path)
|
||||
{
|
||||
$fullPath = $this->concatPaths($path);
|
||||
@@ -234,14 +205,7 @@ class Manager
|
||||
* @param resource $context
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function putContents($path, $data, $flags = 0, $context = null)
|
||||
{
|
||||
$fullPath = $this->concatPaths($path); //todo remove after changing the params
|
||||
@@ -265,14 +229,7 @@ class Manager
|
||||
* @param string $data
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function putPhpContents($path, $data)
|
||||
{
|
||||
return $this->putContents($path, $this->getPHPFormat($data), LOCK_EX);
|
||||
@@ -287,14 +244,7 @@ class Manager
|
||||
* @param resource $context
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function putContentsJson($path, $data)
|
||||
{
|
||||
if (!Utils\Json::isJSON($data)) {
|
||||
@@ -314,14 +264,7 @@ class Manager
|
||||
* @param bool $isPhp - Is merge php files
|
||||
*
|
||||
* @return bool | array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function mergeContents($path, $content, $isReturnJson = false, $removeOptions = null, $isPhp = false)
|
||||
{
|
||||
if ($isPhp) {
|
||||
@@ -363,14 +306,7 @@ class Manager
|
||||
* @param string $content JSON string
|
||||
* @param string | array $removeOptions - List of unset keys from content
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function mergePhpContents($path, $content, $removeOptions = null)
|
||||
{
|
||||
return $this->mergeContents($path, $content, false, $removeOptions, true);
|
||||
@@ -383,14 +319,7 @@ class Manager
|
||||
* @param mixed $data
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function appendContents($path, $data)
|
||||
{
|
||||
return $this->putContents($path, $data, FILE_APPEND | LOCK_EX);
|
||||
@@ -402,14 +331,7 @@ class Manager
|
||||
* @param string | array $path
|
||||
* @param array | string $unsets
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function unsetContents($path, $unsets, $isJSON = true)
|
||||
{
|
||||
$currentData = $this->getContents($path);
|
||||
@@ -439,14 +361,7 @@ class Manager
|
||||
* Concat paths
|
||||
* @param string | array $paths Ex. array('pathPart1', 'pathPart2', 'pathPart3')
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function concatPaths($paths)
|
||||
{
|
||||
if (is_string($paths)) {
|
||||
@@ -469,14 +384,7 @@ class Manager
|
||||
* @param bool $recursive
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function mkdir($path, $permission = null, $recursive = false)
|
||||
{
|
||||
$fullPath = $this->concatPaths($path);
|
||||
@@ -519,14 +427,7 @@ class Manager
|
||||
* @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
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function copy($sourcePath, $destPath, $recursively = false, array $fileList = null, $copyOnlyFiles = false)
|
||||
{
|
||||
$sourcePath = $this->concatPaths($sourcePath);
|
||||
@@ -542,14 +443,7 @@ class Manager
|
||||
$fileList = is_file($sourcePath) ? (array) $sourcePath : $this->getFileList($sourcePath, $recursively, '', true, true);
|
||||
}
|
||||
|
||||
/** Check permission before copying *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Check permission before copying */
|
||||
$permissionDeniedList = array();
|
||||
foreach ($fileList as $file) {
|
||||
|
||||
@@ -567,14 +461,7 @@ class Manager
|
||||
$this->removeFile($destFile);
|
||||
}
|
||||
}
|
||||
/** END *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** END */
|
||||
|
||||
if (!empty($permissionDeniedList)) {
|
||||
$betterPermissionList = $this->getPermissionUtils()->arrangePermissionList($permissionDeniedList);
|
||||
@@ -604,14 +491,7 @@ class Manager
|
||||
*
|
||||
* @param string $filePath
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function checkCreateFile($filePath)
|
||||
{
|
||||
$defaultPermissions = $this->getPermissionUtils()->getDefaultPermissions();
|
||||
@@ -646,14 +526,7 @@ class Manager
|
||||
*
|
||||
* @param array $filePaths - File paths list
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function unlink($filePaths)
|
||||
{
|
||||
return $this->removeFile($filePaths);
|
||||
@@ -681,14 +554,7 @@ class Manager
|
||||
* @param array $filePaths - File paths list
|
||||
* @param string $dirPath - directory path
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function removeFile($filePaths, $dirPath = null)
|
||||
{
|
||||
if (!is_array($filePaths)) {
|
||||
@@ -716,14 +582,7 @@ class Manager
|
||||
* @param bool $removeWithDir - if remove with directory
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function removeInDir($dirPath, $removeWithDir = false)
|
||||
{
|
||||
$fileList = $this->getFileList($dirPath, false);
|
||||
@@ -753,14 +612,7 @@ class Manager
|
||||
* @param string | array $items
|
||||
* @param string $dirPath
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function remove($items, $dirPath = null, $removeEmptyDirs = false)
|
||||
{
|
||||
if (!is_array($items)) {
|
||||
@@ -809,14 +661,7 @@ class Manager
|
||||
* Remove empty parent directories if they are empty
|
||||
* @param string $path
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function removeEmptyDirs($path)
|
||||
{
|
||||
$parentDirName = $this->getParentDirName($path);
|
||||
@@ -835,14 +680,7 @@ class Manager
|
||||
*
|
||||
* @param string $dirname
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function isDir($dirname)
|
||||
{
|
||||
return is_dir($dirname);
|
||||
@@ -853,14 +691,7 @@ class Manager
|
||||
*
|
||||
* @param string $filename
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function isFile($filename)
|
||||
{
|
||||
if (file_exists($filename)) {
|
||||
@@ -879,14 +710,7 @@ class Manager
|
||||
* Check if directory is empty
|
||||
* @param string $path
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function isDirEmpty($path)
|
||||
{
|
||||
if (is_dir($path)) {
|
||||
@@ -907,14 +731,7 @@ class Manager
|
||||
* @param string $ext - extension, ex. '.json'
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getFileName($fileName, $ext='')
|
||||
{
|
||||
if (empty($ext)) {
|
||||
@@ -942,14 +759,7 @@ class Manager
|
||||
* @param bool $isFullPath
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getDirName($path, $isFullPath = true, $useIsDir = true)
|
||||
{
|
||||
$dirName = preg_replace('/\/$/i', '', $path);
|
||||
@@ -969,14 +779,7 @@ class Manager
|
||||
* @param string $path
|
||||
* @param boolean $isFullPath
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getParentDirName($path, $isFullPath = true)
|
||||
{
|
||||
return $this->getDirName($path, $isFullPath, false);
|
||||
@@ -989,14 +792,7 @@ class Manager
|
||||
* @param array $content
|
||||
*
|
||||
* @return string | false
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getPHPFormat($content)
|
||||
{
|
||||
if (!isset($content)) {
|
||||
@@ -1016,14 +812,7 @@ return '.var_export($content, true).';
|
||||
* @param array $paths
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function isWritableList(array $paths)
|
||||
{
|
||||
$permissionDeniedList = array();
|
||||
@@ -1048,14 +837,7 @@ return '.var_export($content, true).';
|
||||
* Get last permission denied list
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getLastPermissionDeniedList()
|
||||
{
|
||||
return $this->permissionDeniedList;
|
||||
@@ -1067,14 +849,7 @@ return '.var_export($content, true).';
|
||||
* @param string | array $path
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function isWritable($path)
|
||||
{
|
||||
$existFile = $this->getExistsPath($path);
|
||||
@@ -1088,14 +863,7 @@ return '.var_export($content, true).';
|
||||
* @param string | array $path
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getExistsPath($path)
|
||||
{
|
||||
$fullPath = $this->concatPaths($path);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\File;
|
||||
|
||||
use Espo\Core\Utils,
|
||||
Espo\Core\Exceptions\Error;
|
||||
|
||||
@@ -40,14 +39,7 @@ class Permission
|
||||
* Last permission error
|
||||
*
|
||||
* @var array | string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $permissionError = null;
|
||||
|
||||
protected $permissionErrorRules = null;
|
||||
@@ -61,27 +53,13 @@ class Permission
|
||||
),
|
||||
'permissionMap' => array(
|
||||
|
||||
/** array('0664', '0775') *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** array('0664', '0775') */
|
||||
'writable' => array(
|
||||
'data',
|
||||
'custom',
|
||||
),
|
||||
|
||||
/** array('0644', '0755') *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** array('0644', '0755') */
|
||||
'readable' => array(
|
||||
'api',
|
||||
'application',
|
||||
@@ -124,14 +102,7 @@ class Permission
|
||||
* Get default settings
|
||||
*
|
||||
* @return object
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getDefaultPermissions()
|
||||
{
|
||||
$params = $this->getParams();
|
||||
@@ -151,14 +122,7 @@ class Permission
|
||||
* @param bool $recurse
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function setDefaultPermissions($path, $recurse = false)
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
@@ -183,14 +147,7 @@ class Permission
|
||||
*
|
||||
* @param string $filename
|
||||
* @return string | bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getCurrentPermission($filePath)
|
||||
{
|
||||
if (!file_exists($filePath)) {
|
||||
@@ -210,14 +167,7 @@ class Permission
|
||||
* @param bool $recurse
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function chmod($path, $octal, $recurse = false)
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
@@ -278,14 +228,7 @@ class Permission
|
||||
* @param int $dirOctal - ex. 0755
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function chmodRecurse($path, $fileOctal = 0644, $dirOctal = 0755)
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
@@ -314,14 +257,7 @@ class Permission
|
||||
* @param bool $recurse
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function chown($path, $user = '', $recurse = false)
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
@@ -348,14 +284,7 @@ class Permission
|
||||
* @param string $user
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function chownRecurse($path, $user)
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
@@ -384,14 +313,7 @@ class Permission
|
||||
* @param bool $recurse
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function chgrp($path, $group = null, $recurse = false)
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
@@ -419,14 +341,7 @@ class Permission
|
||||
* @param int $dirOctal - ex. 0755
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function chgrpRecurse($path, $group) {
|
||||
|
||||
if (!file_exists($path)) {
|
||||
@@ -454,14 +369,7 @@ class Permission
|
||||
* @param int $mode - ex. 0644
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function chmodReal($filename, $mode)
|
||||
{
|
||||
try {
|
||||
@@ -510,14 +418,7 @@ class Permission
|
||||
* Get default owner user
|
||||
*
|
||||
* @return int - owner id
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getDefaultOwner($usePosix = false)
|
||||
{
|
||||
$defaultPermissions = $this->getDefaultPermissions();
|
||||
@@ -538,14 +439,7 @@ class Permission
|
||||
* Get default group user
|
||||
*
|
||||
* @return int - group id
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getDefaultGroup($usePosix = false)
|
||||
{
|
||||
$defaultPermissions = $this->getDefaultPermissions();
|
||||
@@ -566,14 +460,7 @@ class Permission
|
||||
* Set permission regarding defined in permissionMap
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function setMapPermission($mode = null)
|
||||
{
|
||||
$this->permissionError = array();
|
||||
@@ -604,14 +491,7 @@ class Permission
|
||||
|
||||
$res = is_readable($item);
|
||||
|
||||
/** check is wtitable *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** check is wtitable */
|
||||
if ($type == 'writable') {
|
||||
|
||||
$res &= is_writable($item);
|
||||
@@ -644,14 +524,7 @@ class Permission
|
||||
* Get last permission error
|
||||
*
|
||||
* @return array | string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getLastError()
|
||||
{
|
||||
return $this->permissionError;
|
||||
@@ -661,14 +534,7 @@ class Permission
|
||||
* Get last permission error rules
|
||||
*
|
||||
* @return array | string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getLastErrorRules()
|
||||
{
|
||||
return $this->permissionErrorRules;
|
||||
@@ -680,14 +546,7 @@ class Permission
|
||||
*
|
||||
* @param array $fileList
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function arrangePermissionList($fileList)
|
||||
{
|
||||
$betterList = array();
|
||||
@@ -715,14 +574,7 @@ class Permission
|
||||
* @param string $search
|
||||
* @param array $array
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getSearchCount($search, array $array)
|
||||
{
|
||||
$search = $this->getPregQuote($search);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\File;
|
||||
|
||||
use Espo\Core\Utils;
|
||||
|
||||
class Unifier
|
||||
@@ -65,14 +64,7 @@ class Unifier
|
||||
* @param boolean $recursively Note: only for first level of sub directory, other levels of sub directories will be ignored
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function unify($name, $paths, $recursively = false)
|
||||
{
|
||||
$content = $this->unifySingle($paths['corePath'], $name, $recursively);
|
||||
@@ -104,14 +96,7 @@ class Unifier
|
||||
* @param string $moduleName - name of module if exists
|
||||
*
|
||||
* @return string - content of the files
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function unifySingle($dirPath, $type, $recursively = false, $moduleName = '')
|
||||
{
|
||||
if (empty($dirPath) || !file_exists($dirPath)) {
|
||||
@@ -162,14 +147,7 @@ class Unifier
|
||||
* @param string | array() $defaults - It can be a string like ["metadata","layouts"] OR an array with default values
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function unifyGetContents($paths, $defaults)
|
||||
{
|
||||
$fileContent = $this->getFileManager()->getContents($paths);
|
||||
@@ -191,14 +169,7 @@ class Unifier
|
||||
* @param string $type - [metadata, layouts]
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function loadDefaultValues($name, $type = 'metadata')
|
||||
{
|
||||
$defaultPath = $this->params['defaultsPath'];
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\File;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class ZipArchive
|
||||
@@ -61,14 +60,7 @@ class ZipArchive
|
||||
* @param string $file Path to .zip file
|
||||
* @param [type] $destinationPath
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function unzip($file, $destinationPath)
|
||||
{
|
||||
if (!class_exists('\ZipArchive')) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
class Json
|
||||
{
|
||||
/**
|
||||
@@ -38,14 +37,7 @@ class Json
|
||||
* @param int $options Default 0
|
||||
* @param int $depth Default 512
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function encode($value, $options = 0, $depth = 512)
|
||||
{
|
||||
if (version_compare(phpversion(), '5.5.0', '>=')) {
|
||||
@@ -80,14 +72,7 @@ class Json
|
||||
* @param int $depth Default 512
|
||||
* @param int $options Default 0
|
||||
* @return object
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function decode($json, $assoc = false, $depth = 512, $options = 0)
|
||||
{
|
||||
if (is_null($json) || $json === false) {
|
||||
@@ -122,14 +107,7 @@ class Json
|
||||
*
|
||||
* @param string $json
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function isJSON($json)
|
||||
{
|
||||
if ($json === '[]' || $json === '{}') {
|
||||
@@ -147,14 +125,7 @@ class Json
|
||||
* @param mixed $data - can be JSON, array
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function getArrayData($data, $returns = array())
|
||||
{
|
||||
if (is_array($data)) {
|
||||
@@ -208,14 +179,7 @@ class Json
|
||||
case JSON_ERROR_UNSUPPORTED_TYPE:
|
||||
return 'A value of a type that cannot be encoded was given';
|
||||
break;
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
|
||||
default:
|
||||
return 'Unknown error';
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
use \Espo\Core\Utils\Util,
|
||||
\Espo\Core\Exceptions\NotFound,
|
||||
\Espo\Core\Exceptions\Error;
|
||||
@@ -45,14 +44,7 @@ class Language
|
||||
* Data of all languages
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $data = array();
|
||||
|
||||
private $deletedData = array();
|
||||
@@ -69,14 +61,7 @@ class Language
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $paths = array(
|
||||
'corePath' => 'application/Espo/Resources/i18n',
|
||||
'modulePath' => 'application/Espo/Modules/{*}/Resources/i18n',
|
||||
@@ -155,14 +140,7 @@ class Language
|
||||
* "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
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function translate($label, $category = 'labels', $scope = 'Global', $requiredOptions = null)
|
||||
{
|
||||
if (is_array($label)) {
|
||||
@@ -227,14 +205,7 @@ class Language
|
||||
* Save changes
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$path = $this->paths['customPath'];
|
||||
@@ -270,14 +241,7 @@ class Language
|
||||
* Clear unsaved changes
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function clearChanges()
|
||||
{
|
||||
$this->changedData = array();
|
||||
@@ -289,14 +253,7 @@ class Language
|
||||
* Get data of Unifier language files
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getData()
|
||||
{
|
||||
$currentLanguage = $this->getLanguage();
|
||||
@@ -316,14 +273,7 @@ class Language
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function set($scope, $category, $name, $value)
|
||||
{
|
||||
if (is_array($name)) {
|
||||
@@ -352,14 +302,7 @@ class Language
|
||||
* @param string $scope
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function delete($scope, $category, $name)
|
||||
{
|
||||
if (is_array($name)) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
class Layout
|
||||
{
|
||||
private $fileManager;
|
||||
@@ -39,14 +38,7 @@ class Layout
|
||||
|
||||
/**
|
||||
* @var string - uses for loading default values
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $name = 'layout';
|
||||
|
||||
protected $params = array(
|
||||
@@ -56,14 +48,7 @@ class Layout
|
||||
|
||||
/**
|
||||
* @var array - path to layout files
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $paths = array(
|
||||
'corePath' => 'application/Espo/Resources/layouts',
|
||||
'modulePath' => 'application/Espo/Modules/{*}/Resources/layouts',
|
||||
@@ -99,14 +84,7 @@ class Layout
|
||||
* @param $name
|
||||
*
|
||||
* @return json
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function get($scope, $name)
|
||||
{
|
||||
$scope = $this->sanitizeInput($scope);
|
||||
@@ -144,14 +122,7 @@ class Layout
|
||||
* @param string $name - detail
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function set($data, $scope, $name)
|
||||
{
|
||||
$scope = $this->sanitizeInput($scope);
|
||||
@@ -183,14 +154,7 @@ class Layout
|
||||
* Save changes
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$result = true;
|
||||
@@ -222,14 +186,7 @@ class Layout
|
||||
* Clear unsaved changes
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function clearChanges()
|
||||
{
|
||||
$this->changedData = array();
|
||||
@@ -244,14 +201,7 @@ class Layout
|
||||
* @param string $name - detail
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function merge($data, $scope, $name)
|
||||
{
|
||||
$scope = $this->sanitizeInput($scope);
|
||||
@@ -275,14 +225,7 @@ class Layout
|
||||
* @param bool $isCustom - if need to check custom folder
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getLayoutPath($entityName, $isCustom = false)
|
||||
{
|
||||
$path = $this->paths['customPath'];
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Log\Monolog\Handler;
|
||||
|
||||
use Monolog\Logger;
|
||||
|
||||
class RotatingFileHandler extends StreamHandler
|
||||
@@ -36,27 +35,13 @@ class RotatingFileHandler extends StreamHandler
|
||||
/**
|
||||
* Date format as a part of filename
|
||||
* @var string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $dateFormat = 'Y-m-d';
|
||||
|
||||
/**
|
||||
* Filename format
|
||||
* @var string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $filenameFormat = '{filename}-{date}';
|
||||
|
||||
protected $filename;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Log\Monolog\Handler;
|
||||
|
||||
use Monolog\Logger;
|
||||
|
||||
class StreamHandler extends \Monolog\Handler\StreamHandler
|
||||
@@ -83,14 +82,7 @@ class StreamHandler extends \Monolog\Handler\StreamHandler
|
||||
*
|
||||
* @param array $record
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function pruneMessage(array $record)
|
||||
{
|
||||
$message = (string) $record['message'];
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Log\Monolog;
|
||||
|
||||
class Logger extends \Monolog\Logger
|
||||
{
|
||||
protected $defaultLevelName = 'DEBUG';
|
||||
@@ -38,14 +37,7 @@ class Logger extends \Monolog\Logger
|
||||
* Get Level Code
|
||||
* @param string $level Ex. DEBUG, ...
|
||||
* @return int
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getLevelCode($levelName)
|
||||
{
|
||||
$levelName = strtoupper($levelName);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class Metadata
|
||||
@@ -44,28 +43,14 @@ class Metadata
|
||||
|
||||
/**
|
||||
* @var string - uses for loading default values
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $name = 'metadata';
|
||||
|
||||
/**
|
||||
* Path to modules
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $pathToModules = 'application/Espo/Modules';
|
||||
|
||||
private $cacheFile = 'data/cache/application/metadata.php';
|
||||
@@ -85,14 +70,7 @@ class Metadata
|
||||
/**
|
||||
* Default module order
|
||||
* @var integer
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $defaultModuleOrder = 10;
|
||||
|
||||
private $deletedData = array();
|
||||
@@ -169,14 +147,7 @@ class Metadata
|
||||
*
|
||||
* @param boolean $reload
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function init($reload = false)
|
||||
{
|
||||
if (!$this->getConfig()->get('useCache')) {
|
||||
@@ -204,14 +175,7 @@ class Metadata
|
||||
* Get metadata array
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getData()
|
||||
{
|
||||
if (empty($this->meta) || !is_array($this->meta)) {
|
||||
@@ -228,14 +192,7 @@ class Metadata
|
||||
* @param mixed $default
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function get($key = null, $default = null)
|
||||
{
|
||||
return Util::getValueByKey($this->getData(), $key, $default);
|
||||
@@ -248,14 +205,7 @@ class Metadata
|
||||
* @param bool $reload
|
||||
*
|
||||
* @return json | array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getAll($isJSON = false, $reload = false)
|
||||
{
|
||||
if ($reload) {
|
||||
@@ -274,14 +224,7 @@ class Metadata
|
||||
*
|
||||
* @param array $data Meta
|
||||
* @return array $data
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function setLanguageFromConfig($data)
|
||||
{
|
||||
$entityList = array(
|
||||
@@ -307,14 +250,7 @@ class Metadata
|
||||
* Add additional fields defined from metadata -> fields
|
||||
*
|
||||
* @param array $meta
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function addAdditionalFields(array $meta)
|
||||
{
|
||||
$metaCopy = $meta;
|
||||
@@ -349,14 +285,7 @@ class Metadata
|
||||
* @param JSON string $data
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function set($key1, $key2, $data)
|
||||
{
|
||||
$newData = array(
|
||||
@@ -379,14 +308,7 @@ class Metadata
|
||||
* @param array | string $unsets Ex. 'fields.name'
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function delete($key1, $key2, $unsets)
|
||||
{
|
||||
if (!is_array($unsets)) {
|
||||
@@ -421,14 +343,7 @@ class Metadata
|
||||
* @param string $key2
|
||||
* @param array $data
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function undelete($key1, $key2, $data)
|
||||
{
|
||||
if (isset($this->deletedData[$key1][$key2])) {
|
||||
@@ -445,14 +360,7 @@ class Metadata
|
||||
* Clear unsaved changes
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function clearChanges()
|
||||
{
|
||||
$this->changedData = array();
|
||||
@@ -464,14 +372,7 @@ class Metadata
|
||||
* Save changes
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$path = $this->paths['customPath'];
|
||||
@@ -550,14 +451,7 @@ class Metadata
|
||||
* @param bool $delim - delimiter
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getEntityPath($entityName, $delim = '\\')
|
||||
{
|
||||
$path = $this->getScopePath($entityName, $delim);
|
||||
@@ -576,14 +470,7 @@ class Metadata
|
||||
* Load modules
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function loadModuleList()
|
||||
{
|
||||
$modules = $this->getFileManager()->getFileList($this->pathToModules, false, '', false);
|
||||
@@ -606,14 +493,7 @@ class Metadata
|
||||
* Get Module List
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getModuleList()
|
||||
{
|
||||
if (!isset($this->moduleList)) {
|
||||
@@ -629,14 +509,7 @@ class Metadata
|
||||
* @param string $scopeName
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getScopeModuleName($scopeName)
|
||||
{
|
||||
return $this->get('scopes.' . $scopeName . '.module', false);
|
||||
@@ -649,14 +522,7 @@ class Metadata
|
||||
* @param string $delim - delimiter
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getScopePath($scopeName, $delim = '/')
|
||||
{
|
||||
$moduleName = $this->getScopeModuleName($scopeName);
|
||||
@@ -674,14 +540,7 @@ class Metadata
|
||||
* Clear metadata variables when reload meta
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function clearVars()
|
||||
{
|
||||
$this->meta = null;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Metadata;
|
||||
|
||||
use Espo\Core\Utils\Util;
|
||||
|
||||
class Helper
|
||||
@@ -39,14 +38,7 @@ class Helper
|
||||
|
||||
/**
|
||||
* List of copied params for metadata -> 'fields' from parent items
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $copiedDefParams = array(
|
||||
'readOnly',
|
||||
'notStorable',
|
||||
@@ -71,14 +63,7 @@ class Helper
|
||||
*
|
||||
* @param array | string $fieldDef - It can be a string or field defenition from entityDefs
|
||||
* @return array | null
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getFieldDefsByType($fieldDef)
|
||||
{
|
||||
if (is_string($fieldDef)) {
|
||||
@@ -111,14 +96,7 @@ class Helper
|
||||
* @param array $fieldDef
|
||||
* @param array $linkFieldDefsByType
|
||||
* @return array | null
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getLinkDefsInFieldMeta($entityName, $fieldDef, array $linkFieldDefsByType = null)
|
||||
{
|
||||
if (!isset($fieldDefsByType)) {
|
||||
@@ -154,14 +132,7 @@ class Helper
|
||||
* @param array|null $definitionList
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getAdditionalFieldList($fieldName, array $fieldParams, array $definitionList = null)
|
||||
{
|
||||
if (empty($fieldParams['type'])) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class PasswordHash
|
||||
@@ -39,14 +38,7 @@ class PasswordHash
|
||||
* Salt format of SHA-512
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $saltFormat = '$6${0}$';
|
||||
|
||||
public function __construct(Config $config)
|
||||
@@ -64,14 +56,7 @@ class PasswordHash
|
||||
*
|
||||
* @param string $password
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function hash($password, $useMd5 = true)
|
||||
{
|
||||
$salt = $this->getSalt();
|
||||
@@ -90,14 +75,7 @@ class PasswordHash
|
||||
* Get a salt from config and normalize it
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getSalt()
|
||||
{
|
||||
$salt = $this->getConfig()->get('passwordSalt');
|
||||
@@ -115,14 +93,7 @@ class PasswordHash
|
||||
*
|
||||
* @param string $salt
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function normalizeSalt($salt)
|
||||
{
|
||||
return str_replace("{0}", $salt, $this->saltFormat);
|
||||
@@ -132,14 +103,7 @@ class PasswordHash
|
||||
* Generate a new salt
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function generateSalt()
|
||||
{
|
||||
return substr(md5(uniqid()), 0, 16);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
class Route
|
||||
{
|
||||
protected $data = null;
|
||||
@@ -170,14 +169,7 @@ class Route
|
||||
* @param string $routePath - it can be "/App/user", "App/user"
|
||||
*
|
||||
* @return string - "/App/user"
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function adjustPath($routePath)
|
||||
{
|
||||
$routePath = trim($routePath);
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
use Espo\Core\Exceptions\NotFound;
|
||||
|
||||
class ScheduledJob
|
||||
@@ -47,14 +46,7 @@ class ScheduledJob
|
||||
|
||||
/**
|
||||
* @var array - path to cron job files
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
private $paths = array(
|
||||
'corePath' => 'application/Espo/Jobs',
|
||||
'modulePath' => 'application/Espo/Modules/{*}/Jobs',
|
||||
@@ -98,14 +90,7 @@ class ScheduledJob
|
||||
* Get list of all jobs
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
if (!isset($this->data)) {
|
||||
@@ -120,14 +105,7 @@ class ScheduledJob
|
||||
*
|
||||
* @param string $name
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
return $this->getClassName($name);
|
||||
@@ -137,14 +115,7 @@ class ScheduledJob
|
||||
* Get list of all job names
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getAllNamesOnly()
|
||||
{
|
||||
$data = $this->getAll();
|
||||
@@ -159,14 +130,7 @@ class ScheduledJob
|
||||
*
|
||||
* @param string $name
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function getClassName($name)
|
||||
{
|
||||
$name = Util::normilizeClassName($name);
|
||||
@@ -184,14 +148,7 @@ class ScheduledJob
|
||||
/**
|
||||
* Load scheduler classes. It loads from ...Jobs, ex. \Espo\Jobs
|
||||
* @return null
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function init()
|
||||
{
|
||||
$classParser = $this->getContainer()->get('classParser');
|
||||
|
||||
@@ -28,21 +28,13 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
class System
|
||||
{
|
||||
/**
|
||||
* Get web server name
|
||||
*
|
||||
* @return string Ex. "microsoft-iis", "nginx", "apache"
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getServerType()
|
||||
{
|
||||
$serverSoft = $_SERVER['SERVER_SOFTWARE'];
|
||||
@@ -60,14 +52,7 @@ class System
|
||||
* Get Operating System of web server. Details http://en.wikipedia.org/wiki/Uname
|
||||
*
|
||||
* @return string Ex. "windows", "mac", "linux"
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getOS()
|
||||
{
|
||||
$osList = array(
|
||||
@@ -104,14 +89,7 @@ class System
|
||||
* Get root directory of EspoCRM
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getRootDir()
|
||||
{
|
||||
$bPath = realpath('bootstrap.php');
|
||||
@@ -124,14 +102,7 @@ class System
|
||||
* Get path to PHP
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getPhpBin()
|
||||
{
|
||||
return (defined("PHP_BINDIR"))? PHP_BINDIR.DIRECTORY_SEPARATOR.'php' : 'php';
|
||||
@@ -141,14 +112,7 @@ class System
|
||||
* Get php version (only digits and dots)
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function getPhpVersion()
|
||||
{
|
||||
$version = phpversion();
|
||||
|
||||
@@ -29,19 +29,11 @@
|
||||
|
||||
namespace Espo\Core\Utils;
|
||||
|
||||
|
||||
class Util
|
||||
{
|
||||
/**
|
||||
* @var string - default directory separator
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected static $separator = DIRECTORY_SEPARATOR;
|
||||
|
||||
protected static $reservedWords = array('Case');
|
||||
@@ -51,14 +43,7 @@ class Util
|
||||
* Get a folder separator
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function getSeparator()
|
||||
{
|
||||
return static::$separator;
|
||||
@@ -73,14 +58,7 @@ class Util
|
||||
* @param string $delim - delimiter
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function toFormat($name, $delim = '/')
|
||||
{
|
||||
return preg_replace("/[\/\\\]/", $delim, $name);
|
||||
@@ -95,14 +73,7 @@ class Util
|
||||
* @param boolean $capitaliseFirstChar
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function toCamelCase($name, $symbol = '_', $capitaliseFirstChar = false)
|
||||
{
|
||||
if (is_array($name)) {
|
||||
@@ -131,14 +102,7 @@ class Util
|
||||
* @param string | array $name
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function fromCamelCase($name, $symbol = '_')
|
||||
{
|
||||
if (is_array($name)) {
|
||||
@@ -162,14 +126,7 @@ class Util
|
||||
* @param string | array $name
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function toUnderScore($name)
|
||||
{
|
||||
return static::fromCamelCase($name, '_');
|
||||
@@ -182,14 +139,7 @@ class Util
|
||||
* @param array $newArray - chief array (priority is same as for array_merge())
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function merge($currentArray, $newArray)
|
||||
{
|
||||
$mergeIdentifier = '__APPEND__';
|
||||
@@ -239,14 +189,7 @@ class Util
|
||||
* @param array $haystack
|
||||
* @param bool $reIndex
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function unsetInArrayByValue($needle, array $haystack, $reIndex = true)
|
||||
{
|
||||
$doReindex = false;
|
||||
@@ -278,14 +221,7 @@ class Util
|
||||
* @param string $filePath - File path, Ex. file.json
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function concatPath($folderPath, $filePath = null)
|
||||
{
|
||||
if (is_array($folderPath)) {
|
||||
@@ -314,14 +250,7 @@ class Util
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function fixPath($path)
|
||||
{
|
||||
return str_replace('/', static::getSeparator(), $path);
|
||||
@@ -332,14 +261,7 @@ class Util
|
||||
*
|
||||
* @param array $array
|
||||
* @return object
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function arrayToObject($array)
|
||||
{
|
||||
if (is_array($array)) {
|
||||
@@ -354,14 +276,7 @@ class Util
|
||||
*
|
||||
* @param object $object
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function objectToArray($object)
|
||||
{
|
||||
if (is_object($object)) {
|
||||
@@ -376,14 +291,7 @@ class Util
|
||||
*
|
||||
* @param string $name
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function normilizeClassName($name)
|
||||
{
|
||||
if (in_array($name, self::$reservedWords)) {
|
||||
@@ -397,14 +305,7 @@ class Util
|
||||
*
|
||||
* @param string $name
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function normilizeScopeName($name)
|
||||
{
|
||||
foreach (self::$reservedWords as $reservedWord) {
|
||||
@@ -424,14 +325,7 @@ class Util
|
||||
* @param string $type
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function getNaming($name, $prePostFix, $type = 'prefix', $symbol = '_')
|
||||
{
|
||||
if ($type == 'prefix') {
|
||||
@@ -452,14 +346,7 @@ class Util
|
||||
* @param string $isKeys
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function replaceInArray($search = '', $replace = '', $array = false, $isKeys = true)
|
||||
{
|
||||
if (!is_array($array)) {
|
||||
@@ -496,14 +383,7 @@ class Util
|
||||
* @param bool $unsetParentEmptyArray - If unset empty parent array after unsets
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function unsetInArray(array $content, $unsets, $unsetParentEmptyArray = false)
|
||||
{
|
||||
if (empty($unsets)) {
|
||||
@@ -555,14 +435,7 @@ class Util
|
||||
* @param string $filePath
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function getClassName($filePath)
|
||||
{
|
||||
$className = preg_replace('/\.php$/i', '', $filePath);
|
||||
@@ -579,14 +452,7 @@ class Util
|
||||
* @param string $key Ex. of key is "entityDefs", "entityDefs.User"
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function getValueByKey(array $array, $key = null, $default = null)
|
||||
{
|
||||
if (!isset($key) || empty($key)) {
|
||||
@@ -613,14 +479,7 @@ class Util
|
||||
* @param mixed $var1
|
||||
* @param mixed $var2
|
||||
* @return boolean
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function isEquals($var1, $var2)
|
||||
{
|
||||
if (is_array($var1)) {
|
||||
@@ -637,14 +496,7 @@ class Util
|
||||
* Sort array recursively
|
||||
* @param array $array
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public static function ksortRecursive(&$array)
|
||||
{
|
||||
if (!is_array($array)) {
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
return array (
|
||||
'database' =>
|
||||
return array ( 'database' =>
|
||||
array (
|
||||
'driver' => 'pdo_mysql',
|
||||
'host' => 'localhost',
|
||||
@@ -83,30 +82,9 @@ return array (
|
||||
'logger' =>
|
||||
array (
|
||||
'path' => 'data/logs/espo.log',
|
||||
'level' => 'WARNING', /** DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
'isRotate' => true, /** rotate log files every day *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
'maxRotateFiles' => 30, /** max number of rotate files *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
'level' => 'WARNING', /** 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' =>
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
return array (
|
||||
'defaultPermissions' =>
|
||||
return array ( 'defaultPermissions' =>
|
||||
array (
|
||||
'dir' => '0775',
|
||||
'file' => '0664',
|
||||
@@ -38,27 +37,13 @@ return array (
|
||||
|
||||
'permissionMap' => array(
|
||||
|
||||
/** array('0664', '0775') *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** array('0664', '0775') */
|
||||
'writable' => array(
|
||||
'data',
|
||||
'custom',
|
||||
),
|
||||
|
||||
/** array('0644', '0755') *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** array('0644', '0755') */
|
||||
'readable' => array(
|
||||
'api',
|
||||
'application',
|
||||
@@ -72,38 +57,10 @@ return array (
|
||||
),
|
||||
),
|
||||
'cron' => array(
|
||||
'maxJobNumber' => 15, /** Max number of jobs per one execution *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
'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 *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
'minExecutionTime' => 50, /** to avoid too frequency execution *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
'attempts' => 3, /** attempts to run jobs *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
'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 */
|
||||
'attempts' => 3, /** attempts to run jobs */
|
||||
),
|
||||
'crud' => array(
|
||||
'get' => 'read',
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\ORM\DB;
|
||||
|
||||
use Espo\ORM\IEntity;
|
||||
use Espo\ORM\Classes\EntityFactory;
|
||||
|
||||
@@ -40,14 +39,7 @@ interface IMapper
|
||||
* @param IEntity $entity
|
||||
* @param string $id Id of the needed bean
|
||||
* @return IEntity $entity
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function selectById(IEntity $entity, $id);
|
||||
|
||||
/**
|
||||
@@ -56,14 +48,7 @@ interface IMapper
|
||||
* @param IEntity $entity
|
||||
* @param array $params Parameters (whereClause, offset, limit, orderBy, order, customWhere, joins, distinct)
|
||||
* @return array Array of beans
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function select(IEntity $entity, $params);
|
||||
|
||||
/**
|
||||
@@ -75,14 +60,7 @@ interface IMapper
|
||||
* @param string $aggregationBy Field to aggregate
|
||||
* @param bool $deleted True to consider records marked as deleted either.
|
||||
* @return mixed Result of the aggregation
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function aggregate(IEntity $entity, $params, $aggregation, $aggregationBy, $deleted);
|
||||
|
||||
/**
|
||||
@@ -91,14 +69,7 @@ interface IMapper
|
||||
* @param IEntity $entity
|
||||
* @param array $params Parameters (ordering, and limitig are not used)
|
||||
* @return int Count of record
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function count(IEntity $entity, $params);
|
||||
|
||||
/**
|
||||
@@ -109,14 +80,7 @@ interface IMapper
|
||||
* @param string $field Needed field.
|
||||
* @param bool $deleted True to consider records marked as deleted either.
|
||||
* @return mixed Max value
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function max(IEntity $entity, $params, $field, $deleted);
|
||||
|
||||
/**
|
||||
@@ -127,14 +91,7 @@ interface IMapper
|
||||
* @param string $field Needed field.
|
||||
* @param bool $deleted True to consider records marked as deleted either.
|
||||
* @return mixed Min value
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function min(IEntity $entity, $params, $field, $deleted);
|
||||
|
||||
/**
|
||||
@@ -145,14 +102,7 @@ interface IMapper
|
||||
* @param string $field Needed field.
|
||||
* @param bool $deleted True to consider records marked as deleted either.
|
||||
* @return mixed Sum value
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function sum(IEntity $entity, $params);
|
||||
|
||||
/**
|
||||
@@ -163,14 +113,7 @@ interface IMapper
|
||||
* @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
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function selectRelated(IEntity $entity, $relName, $params, $totalCount);
|
||||
|
||||
/**
|
||||
@@ -180,14 +123,7 @@ interface IMapper
|
||||
* @param string $relName Relation name
|
||||
* @param array $params (whereClause, customWhere)
|
||||
* @return int Count of records
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function countRelated(IEntity $entity, $relName, $params);
|
||||
|
||||
/**
|
||||
@@ -197,14 +133,7 @@ interface IMapper
|
||||
* @param string $relName Relation name
|
||||
* @param string $id Id of the foreign record.
|
||||
* @return bool True if success
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function addRelation(IEntity $entity, $relName, $id);
|
||||
|
||||
/**
|
||||
@@ -214,14 +143,7 @@ interface IMapper
|
||||
* @param string $relName Relation name
|
||||
* @param string $id Id of the foreign record.
|
||||
* @return bool True if success
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function removeRelation(IEntity $entity, $relName, $id);
|
||||
|
||||
/**
|
||||
@@ -230,14 +152,7 @@ interface IMapper
|
||||
* @param IEntity $entity
|
||||
* @param string $relName Relation name
|
||||
* @return bool True if success
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function removeAllRelations(IEntity $entity, $relName);
|
||||
|
||||
/**
|
||||
@@ -245,14 +160,7 @@ interface IMapper
|
||||
*
|
||||
* @param IEntity $entity
|
||||
* @return bool True if success
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function insert(IEntity $entity);
|
||||
|
||||
/**
|
||||
@@ -260,14 +168,7 @@ interface IMapper
|
||||
*
|
||||
* @param IEntity $entity
|
||||
* @return bool True if success
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function update(IEntity $entity);
|
||||
|
||||
|
||||
@@ -277,28 +178,14 @@ interface IMapper
|
||||
*
|
||||
* @param IEntity $entity
|
||||
* @return bool True if success
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function setCollectionClass($collectionClass);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\ORM\DB;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\ORM\IEntity;
|
||||
use Espo\ORM\EntityFactory;
|
||||
@@ -38,14 +37,7 @@ use PDO;
|
||||
* Abstraction for DB.
|
||||
* Mapping of Entity to DB.
|
||||
* Should be used internally only.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
abstract class Mapper implements IMapper
|
||||
{
|
||||
public $pdo;
|
||||
@@ -145,14 +137,7 @@ abstract class Mapper implements IMapper
|
||||
return $this->selectByQuery($entity, $sql);
|
||||
}
|
||||
|
||||
/* TODO ability to pass offset and limit *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* TODO ability to pass offset and limit */
|
||||
public function selectByQuery(IEntity $entity, $sql)
|
||||
{
|
||||
$dataArr = array();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\ORM\DB;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\ORM\Classes\EntityCollection;
|
||||
use PDO;
|
||||
@@ -37,14 +36,7 @@ use PDO;
|
||||
* Abstraction for MySQL DB.
|
||||
* Mapping of Entity to DB.
|
||||
* Should be used internally only.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
class MysqlMapper extends Mapper
|
||||
{
|
||||
protected function toDb($field)
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\ORM;
|
||||
|
||||
abstract class Entity implements IEntity
|
||||
{
|
||||
public $id = null;
|
||||
@@ -40,76 +39,34 @@ abstract class Entity implements IEntity
|
||||
/**
|
||||
* Entity type.
|
||||
* @var string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $entityType;
|
||||
|
||||
/**
|
||||
* @var array Defenition of fields.
|
||||
* @todo make protected
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public $fields = array();
|
||||
|
||||
/**
|
||||
* @var array Defenition of relations.
|
||||
* @todo make protected
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public $relations = array();
|
||||
|
||||
/**
|
||||
* @var array Field-Value pairs.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $valuesContainer = array();
|
||||
|
||||
/**
|
||||
* @var array Field-Value pairs of initial values (fetched from DB).
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $fetchedValuesContainer = array();
|
||||
|
||||
/**
|
||||
* @var EntityManager Entity Manager.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $entityManager;
|
||||
|
||||
protected $isFetched = false;
|
||||
|
||||
@@ -28,17 +28,9 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\ORM;
|
||||
|
||||
/**
|
||||
* Model interface.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
interface IEntity
|
||||
{
|
||||
const ID = 'id';
|
||||
@@ -66,74 +58,32 @@ interface IEntity
|
||||
* Push values from the array.
|
||||
* E.g. insert values into the bean from a request data.
|
||||
* @param array $arr Array of field - value pairs
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function populateFromArray(array $arr);
|
||||
|
||||
/**
|
||||
* Resets all fields in the current model.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function reset();
|
||||
|
||||
/**
|
||||
* Set field.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function set($name, $value);
|
||||
|
||||
/**
|
||||
* Get field.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function get($name);
|
||||
|
||||
/**
|
||||
* Check field is set.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function has($name);
|
||||
|
||||
/**
|
||||
* Clear field.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
function clear($name);
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\ORM\Repositories;
|
||||
|
||||
use \Espo\ORM\EntityManager;
|
||||
use \Espo\ORM\EntityFactory;
|
||||
use \Espo\ORM\EntityCollection;
|
||||
@@ -40,38 +39,17 @@ class RDB extends \Espo\ORM\Repository
|
||||
{
|
||||
/**
|
||||
* @var Object Mapper.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $mapper;
|
||||
|
||||
/**
|
||||
* @var array Where clause array. To be used in further find operation.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $whereClause = array();
|
||||
|
||||
/**
|
||||
* @var array Parameters to be used in further find operations.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $listParams = array();
|
||||
|
||||
public function __construct($entityName, EntityManager $entityManager, EntityFactory $entityFactory)
|
||||
|
||||
@@ -28,68 +28,32 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\ORM;
|
||||
|
||||
abstract class Repository
|
||||
{
|
||||
/**
|
||||
* @var EntityFactory EntityFactory object.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $entityFactory;
|
||||
|
||||
/**
|
||||
* @var EntityManager EntityManager object.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $entityManager;
|
||||
|
||||
|
||||
/**
|
||||
* @var iModel Seed entity.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $seed;
|
||||
|
||||
/**
|
||||
* @var string Class Name of aggregate root.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $entityClassName;
|
||||
|
||||
/**
|
||||
* @var string Model Name of aggregate root.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected $entityName;
|
||||
|
||||
public function __construct($entityName, EntityManager $entityManager, EntityFactory $entityFactory)
|
||||
|
||||
@@ -27,21 +27,13 @@
|
||||
************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Example:
|
||||
/** * Example:
|
||||
* Lead: {
|
||||
* edit: 'own',
|
||||
* read: 'team',
|
||||
* delete: 'no',
|
||||
* }
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
|
||||
Espo.define('acl', [], function () {
|
||||
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* Controller. Views, Models and Collections are created here.
|
||||
*/
|
||||
* Controller. Views, Models and Collections are created here.*/
|
||||
|
||||
Espo.define('controller', [], function () {
|
||||
|
||||
@@ -108,14 +107,7 @@ Espo.define('controller', [], function () {
|
||||
* Get parameter of all controllers.
|
||||
* @param key
|
||||
* @return null if doesn't exist.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
get: function (key) {
|
||||
if (key in this.params) {
|
||||
return this.params[key];
|
||||
@@ -127,14 +119,7 @@ Espo.define('controller', [], function () {
|
||||
* Set paramer for all controllers.
|
||||
* @param key Name of view.
|
||||
* @param value.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
set: function (key, value) {
|
||||
this.params[key] = value;
|
||||
},
|
||||
@@ -217,14 +202,7 @@ Espo.define('controller', [], function () {
|
||||
/**
|
||||
* Create master view, render it if not rendered and return it.
|
||||
* @param {Function} callback Master view will be argument for this.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
master: function (callback) {
|
||||
var entire = this.get('entire');
|
||||
if (entire) {
|
||||
@@ -254,14 +232,7 @@ Espo.define('controller', [], function () {
|
||||
* @param {String} view Name of view.
|
||||
* @param {Object} options Options for view.
|
||||
* @return {view}
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
main: function (view, options, callback, useStored, storedKey) {
|
||||
var view = view || 'Base';
|
||||
var master = this.master(function (master) {
|
||||
@@ -332,14 +303,7 @@ Espo.define('controller', [], function () {
|
||||
* @param {String} view Name of view.
|
||||
* @param {Object} options Options for view.
|
||||
* @return {Espo.View}
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
entire: function (view, options, callback) {
|
||||
var master = this.get('master');
|
||||
if (master) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
Espo.define('controllers/record', 'controller', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
viewMap: null,
|
||||
|
||||
defaultAction: 'list',
|
||||
@@ -233,14 +232,7 @@ Espo.define('controllers/record', 'controller', function (Dep) {
|
||||
/**
|
||||
* Get collection for the current controller.
|
||||
* @param {collection}.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
getCollection: function (callback, context, usePreviouslyFetched) {
|
||||
context = context || this;
|
||||
|
||||
@@ -267,14 +259,7 @@ Espo.define('controllers/record', 'controller', function (Dep) {
|
||||
/**
|
||||
* Get model for the current controller.
|
||||
* @param {model}.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
getModel: function (callback, context) {
|
||||
context = context || this;
|
||||
|
||||
|
||||
@@ -27,19 +27,11 @@
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('MultiCollection', 'Collection', function (Collection) {
|
||||
|
||||
var MultiCollection = Collection.extend({
|
||||
|
||||
/**
|
||||
* @prop {Object} seeds Hash off model classes.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
seeds: null,
|
||||
|
||||
initialize: function (models, options) {
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('utils', [], function () {
|
||||
|
||||
var Utils = Espo.utils = Espo.Utils = {
|
||||
|
||||
checkActionAccess: function (acl, obj, item) {
|
||||
@@ -102,14 +101,7 @@ Espo.define('utils', [], function () {
|
||||
* @param {String} name
|
||||
* @param {String} location
|
||||
* @return {String}
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
composeClassName: function (module, name, location) {
|
||||
if (module) {
|
||||
module = this.camelCaseToHyphen(module);
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('views/fields/base', 'view', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
type: 'base',
|
||||
@@ -73,14 +72,7 @@ Espo.define('views/fields/base', 'view', function (Dep) {
|
||||
/**
|
||||
* Get cell element. Works only after rendered.
|
||||
* {jQuery}
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
getCellElement: function () {
|
||||
return this.$el.parent();
|
||||
},
|
||||
@@ -97,28 +89,14 @@ Espo.define('views/fields/base', 'view', function (Dep) {
|
||||
/**
|
||||
* Get label element. Works only after rendered.
|
||||
* {jQuery}
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
getLabelElement: function () {
|
||||
return this.$el.parent().children('label');
|
||||
},
|
||||
|
||||
/**
|
||||
* Hide field and label. Works only after rendered.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
hide: function () {
|
||||
this.$el.addClass('hidden');
|
||||
var $cell = this.getCellElement();
|
||||
@@ -128,14 +106,7 @@ Espo.define('views/fields/base', 'view', function (Dep) {
|
||||
|
||||
/**
|
||||
* Show field and label. Works only after rendered.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
show: function () {
|
||||
this.$el.removeClass('hidden');
|
||||
var $cell = this.getCellElement();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
Espo.define('views/record/detail', 'views/record/base', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
template: 'record/detail',
|
||||
|
||||
type: 'detail',
|
||||
@@ -805,14 +804,7 @@ Espo.define('views/record/detail', 'views/record/base', function (Dep) {
|
||||
* Called after save or cancel.
|
||||
* By default redirects page. Can be orverriden in options.
|
||||
* @param {String} after Name of action (save, cancel, etc.) after which #exit is invoked.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
exit: function (after) {
|
||||
var url;
|
||||
if (this.returnUrl) {
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('views/record/list', 'view', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
template: 'record/list',
|
||||
@@ -679,14 +678,7 @@ Espo.define('views/record/list', 'view', function (Dep) {
|
||||
/**
|
||||
* Returns checked models.
|
||||
* @return {Array} Array of models
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
getSelected: function () {
|
||||
var list = [];
|
||||
this.$el.find('input.record-checkbox:checked').each(function (i, el) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
use Espo\Core\Utils\Util;
|
||||
|
||||
class Installer
|
||||
{
|
||||
protected $app = null;
|
||||
@@ -168,14 +167,7 @@ class Installer
|
||||
* ),
|
||||
* @param string $language
|
||||
* @return bool
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function saveData($database, $language)
|
||||
{
|
||||
$initData = include('install/core/afterInstall/config.php');
|
||||
@@ -354,24 +346,10 @@ class Installer
|
||||
{
|
||||
$this->auth();
|
||||
|
||||
/** afterInstall scripts *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** afterInstall scripts */
|
||||
$result = $this->createRecords();
|
||||
$result &= $this->executeQueries();
|
||||
/** END: afterInstall scripts *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** END: afterInstall scripts */
|
||||
|
||||
$config = $this->app->getContainer()->get('config');
|
||||
$config->set('isInstalled', true);
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
class Language
|
||||
{
|
||||
class Language{
|
||||
private $defaultLanguage = 'en_US';
|
||||
|
||||
private $systemHelper;
|
||||
@@ -79,14 +78,7 @@ class Language
|
||||
*
|
||||
* @param array $data
|
||||
* @return array
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function mergeWithDefaults($data)
|
||||
{
|
||||
$defaultLangFile = 'install/core/i18n/'.$this->defaultLanguage.'/install.json';
|
||||
@@ -118,24 +110,10 @@ class Language
|
||||
*
|
||||
* @param array $i18n
|
||||
* @return array $i18n
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
protected function afterRetrieve(array &$i18n)
|
||||
{
|
||||
/** Get rewrite rules *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Get rewrite rules */
|
||||
$serverType = $this->getSystemHelper()->getServerType();
|
||||
$rewriteRules = $this->getSystemHelper()->getRewriteRules();
|
||||
$i18n['options']['modRewriteHelp'][$serverType] = str_replace('{0}', $rewriteRules, $i18n['options']['modRewriteHelp'][$serverType]);
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
|
||||
class SystemHelper extends \Espo\Core\Utils\System
|
||||
{
|
||||
|
||||
@@ -154,14 +153,7 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
$result['success'] = false;
|
||||
}
|
||||
|
||||
/** Check MySQL settings *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Check MySQL settings */
|
||||
if ($result['success']) {
|
||||
$currentMysqlVersion = $this->getMysqlSetting('version', $dbh);
|
||||
if (isset($currentMysqlVersion) && version_compare($currentMysqlVersion, $this->requirements['mysqlVersion']) == -1) {
|
||||
@@ -169,14 +161,7 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
$result['success'] = false;
|
||||
}
|
||||
|
||||
/** Check required MySQL settings *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** Check required MySQL settings */
|
||||
foreach ($this->requirements['mysqlRequires'] as $name => $requiredValue) {
|
||||
$currentValue = $this->getMysqlSetting($name, $dbh);
|
||||
$acceptable = ( isset($currentValue) && $this->convertToBytes($currentValue) >= $this->convertToBytes($requiredValue) ) ? true : false;
|
||||
@@ -191,14 +176,7 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
}
|
||||
}
|
||||
|
||||
/** try to create a database *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** try to create a database */
|
||||
if ($isCreateDatabase && !$result['success'] && $result['errors']['dbConnect']['errorCode'] == '1049')
|
||||
{
|
||||
$dsn = "mysql:host={$hostName};" . ((!empty($port)) ? "port={$port}" : '');
|
||||
@@ -215,14 +193,7 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
return $this->checkDbConnection($hostName, $port, $dbUserName, $dbUserPass, $dbName, false);
|
||||
}
|
||||
}
|
||||
/** END: try to create a database *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** END: try to create a database */
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -354,14 +325,7 @@ class SystemHelper extends \Espo\Core\Utils\System
|
||||
* @param boolean $isSudo
|
||||
* @param bool $isFile
|
||||
* @return string
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function getPermissionCommands($path, $permissions = array('644', '755'), $isSudo = false, $isFile = null, $changeOwner = true)
|
||||
{
|
||||
if (is_string($path)) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
session_start();
|
||||
|
||||
require_once('../bootstrap.php');
|
||||
|
||||
//action
|
||||
@@ -140,14 +139,7 @@ $tplName = $action.'.tpl';
|
||||
$smarty->assign('tplName', $tplName);
|
||||
$smarty->assign('action', ucfirst($action));
|
||||
|
||||
/** config *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/** config */
|
||||
$smarty->assign('config', $config);
|
||||
|
||||
if (Utils::isActionExists($action)) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace tests\Espo\Core\Upgrades\Actions;
|
||||
|
||||
use tests\ReflectionHelper;
|
||||
use Espo\Core\Utils\Util;
|
||||
|
||||
@@ -89,28 +88,14 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->reflection->setProperty('processId', 'ngkdf54n566n45');
|
||||
|
||||
/* create a package durectory with manifest.json file *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* create a package durectory with manifest.json file */
|
||||
$packagePath = $this->reflection->invokeMethod('getPath');
|
||||
$manifestName = $this->reflection->getProperty('manifestName');
|
||||
$filename = $packagePath . '/' .$manifestName;
|
||||
|
||||
$this->fileManager = new \Espo\Core\Utils\File\Manager();
|
||||
$this->fileManager->putContents($filename, '');
|
||||
/* END *
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
/* END */
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
@@ -204,14 +189,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider acceptableVersions
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function testCheckVersions($versions, $currentVersion = null)
|
||||
{
|
||||
if (!isset($currentVersion)) {
|
||||
@@ -234,14 +212,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider unacceptableVersions
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function testCheckVersionsException($versions, $currentVersion = null)
|
||||
{
|
||||
if (!isset($currentVersion)) {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace tests\Espo\Core\Utils\File;
|
||||
|
||||
use tests\ReflectionHelper;
|
||||
use Espo\Core\Utils\Util;
|
||||
|
||||
@@ -377,14 +376,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider fileListSets
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function testRemoveWithEmptyDirs($name, $result)
|
||||
{
|
||||
$path = 'tests/testData/FileManager/Remove/' . $name;
|
||||
@@ -416,14 +408,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider existsPathSet
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
*/
|
||||
public function testGetExistsPath($input, $result)
|
||||
{
|
||||
$this->assertEquals($result, $this->reflection->invokeMethod('getExistsPath', array($input)) );
|
||||
|
||||
Reference in New Issue
Block a user