Merged in release/3.5.0 (pull request #7438)

Release/3.5.0

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2020-07-29 15:14:15 +00:00
committed by Julio Cesar Laura Avendaño
4 changed files with 79 additions and 28 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Console\Commands;
use Illuminate\Support\Facades\File;
use Illuminate\Queue\Console\WorkCommand as BaseWorkCommand;
use Illuminate\Queue\Events\JobProcessing;
use Illuminate\Queue\Worker;
@@ -44,38 +45,64 @@ class WorkCommand extends BaseWorkCommand
}
/**
* This call the 'classLoaderForCommands.json' file, is required by artisan for dynamically
* access to plugin classes.
* This is required by artisan for dynamically access to plugin classes.
*/
private function loadAdditionalClassesAtRuntime(): void
{
//load the main plugin classes because inside is the definition 'set_include_path()'
if (!defined('PATH_PLUGINS')) {
return;
}
$content = scandir(PATH_PLUGINS, SCANDIR_SORT_ASCENDING);
foreach ($content as $value) {
if (in_array($value, ['.', '..'])) {
$files = File::files(PATH_PLUGINS);
foreach ($files as $file) {
$isPhpFile = strtolower(File::extension($file)) === "php";
if (!$isPhpFile) {
continue;
}
$path = PATH_PLUGINS . $value;
if (!is_dir($path)) {
require_once $file;
}
//load the classes of the plugins when is required dynamically.
$closure = function($className) {
if (class_exists($className)) {
return;
}
if (!defined('PATH_PLUGINS')) {
return;
}
$searchFiles = function($path) use(&$searchFiles, $className) {
$directories = File::directories($path);
foreach ($directories as $directory) {
$omittedDirectories = [
'bin', 'cache', 'colosa', 'config',
'data', 'documentation', 'fields',
'files', 'js', 'log', 'node_modules',
'public_html', 'resources', 'routes',
'templates', 'tests', 'translations',
'vendor', 'view', 'views'
];
if (in_array(File::basename($directory), $omittedDirectories)) {
continue;
}
//this file is required by artisan for dynamically access to class
$classloader = $path . PATH_SEP . 'classLoaderForCommands.json';
if (!file_exists($classloader)) {
$searchFiles($directory);
$files = File::files($directory);
foreach ($files as $file) {
$isPhpFile = strtolower(File::extension($file)) === "php";
if (!$isPhpFile) {
continue;
}
$object = json_decode(file_get_contents($classloader), false);
if (empty($object)) {
continue;
}
if (!property_exists($object, 'classes') && !is_array($object->classes)) {
continue;
}
foreach ($object->classes as $classpath) {
require_once $path . PATH_SEP . $classpath;
$className = explode("\\", $className);
$className = array_pop($className);
$pattern = "/class[\n\s]+" . $className . "[\s\n]*\{/";
$status = preg_match($pattern, file_get_contents($file), $result);
if ($status === 1) {
require_once $file;
break;
}
}
}
};
$searchFiles(PATH_PLUGINS);
};
spl_autoload_register($closure);
}
}

View File

@@ -64,6 +64,7 @@ if (defined('PATH_DB') && !empty(config("system.workspace"))) {
$pro ['datasources']['rp']['connection'] = $dsnReport;
$pro ['datasources']['rp']['adapter'] = DB_ADAPTER;
// "workflow" connection
$dbHost = explode(':', DB_HOST);
config(['database.connections.workflow.host' => $dbHost[0]]);
config(['database.connections.workflow.database' => DB_NAME]);
@@ -72,6 +73,28 @@ if (defined('PATH_DB') && !empty(config("system.workspace"))) {
if (count($dbHost) > 1) {
config(['database.connections.workflow.port' => $dbHost[1]]);
}
// "rbac" connection
$dbRbacHost = explode(':', DB_RBAC_HOST);
config(['database.connections.rbac.driver' => DB_ADAPTER]);
config(['database.connections.rbac.host' => $dbRbacHost[0]]);
config(['database.connections.rbac.database' => DB_RBAC_NAME]);
config(['database.connections.rbac.username' => DB_RBAC_USER]);
config(['database.connections.rbac.password' => DB_RBAC_PASS]);
if (count($dbRbacHost) > 1) {
config(['database.connections.rbac.port' => $dbRbacHost[1]]);
}
// "rp" connection
$dbReportHost = explode(':', DB_REPORT_HOST);
config(['database.connections.rp.driver' => DB_ADAPTER]);
config(['database.connections.rp.host' => $dbReportHost[0]]);
config(['database.connections.rp.database' => DB_REPORT_NAME]);
config(['database.connections.rp.username' => DB_REPORT_USER]);
config(['database.connections.rp.password' => DB_REPORT_PASS]);
if (count($dbReportHost) > 1) {
config(['database.connections.rp.port' => $dbReportHost[1]]);
}
}
$pro ['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';

View File

@@ -113,7 +113,8 @@ class TaskSchedulerBM
"expression" => "*/5 * * * 0,1,2,3,4,5,6",
"description" => "ID_TASK_SCHEDULER_MESSAGE_EVENTS_DESC"
]
/*----------------------------------********---------------------------------*/, [
/*----------------------------------********---------------------------------*/
,[
"title" => "ID_TASK_SCHEDULER_ACTION_EMAIL",
"enable" => "1",
"service" => "",
@@ -205,7 +206,7 @@ class TaskSchedulerBM
"expression" => "0 */1 * * 0,1,2,3,4,5,6",
"description" => "ID_TASK_SCHEDULER_PM_PLUGINS_DESC"
]
/*----------------------------------********---------------------------------*/
/*----------------------------------********---------------------------------*/
];
/**
* Return the records in Schedule Table by category

View File

@@ -179,8 +179,8 @@ Ext.onReady(function(){
});
var expander = new Ext.ux.grid.RowExpander({
tpl : new Ext.Template(
'<p><b>' + _('ID_PRO_DESCRIPTION') + ':</b> {PRO_DESCRIPTION}</p><br>'
tpl: new Ext.Template(
'<div style="padding-left:40px"><b>' + _('ID_PRO_DESCRIPTION') + ':</b> {PRO_DESCRIPTION}</div><br>'
)
});