Merge branch 'feature/HOR-3610' of https://bitbucket.org/colosa/processmaker into feature/HOR-3610

This commit is contained in:
davidcallizaya
2017-08-03 18:22:51 -04:00
6 changed files with 60 additions and 27 deletions

View File

@@ -191,7 +191,7 @@ function run_generate_unit_test_class($task, $args) {
}
include ('test' . PATH_SEP . 'bootstrap' . PATH_SEP . 'unit.php');
require_once ('propel/Propel.php');
require_once ($classFilename);
@@ -2037,7 +2037,7 @@ function get_DirDB($workspace) {
}
require_once ($dbFile);
require_once ("propel/Propel.php");
Propel::init(PATH_CORE . "config/databases.php");
$configuration = Propel::getConfiguration();

View File

@@ -24,7 +24,7 @@
*/
require_once ( 'classes/class.xmlfield_InputPM.php' );
$id=get_ajax_value('ptID');
$ntable = unserialize(base64_decode($_SESSION['pagedTable[' . $id . ']']));
$page=get_ajax_value('page');

View File

@@ -24,9 +24,6 @@
*/
/* Includes */
G::LoadAllModelClasses();
G::LoadAllPluginModelClasses();
require_once ( 'classes/class.xmlfield_InputPM.php' );
$id = get_ajax_value('ptID');
$ntable = unserialize(base64_decode($_SESSION['pagedTable[' . $id . ']']));
$page = get_ajax_value('page');

View File

@@ -488,7 +488,7 @@ class Propel {
* @date: 27-05-08 11:48 *
* @Description: this was added for the additional database connections *
***********************************************************************/
G::LoadClass ('dbConnections');
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
$oDbConnections->loadAdditionalConnections();
$dsn = isset(self::$configuration['datasources'][$name]['connection']) ? self::$configuration['datasources'][$name]['connection'] : null;

View File

@@ -162,6 +162,8 @@ CLI::taskDescription(<<<EOT
EOT
);
CLI::taskArg('workspace-name', true, true);
CLI::taskOpt('noxml', 'If this option is enabled, the XML files will not be modified.', 'NoXml', 'no-xml');
CLI::taskOpt('nomafe', 'If this option is enabled, the Front End (BPMN Designer and Bootstrap Forms) translation file will not be modified.', 'NoMafe', 'no-mafe');
CLI::taskRun("run_translation_upgrade");
CLI::taskName('migrate-cases-folders');
@@ -370,22 +372,62 @@ function run_workspace_upgrade($args, $opts) {
}
}
/**
* We will repair the translation in the languages defined in the workspace
* Verify if we need to execute an external program for each workspace
* If we apply the command for all workspaces, we will need to execute one by one by redefining the constants
* @param string $args, workspaceName that we need to apply the database-upgrade
* @param string $opts
*
* @return void
*/
function run_translation_upgrade($args, $opts) {
$filter = new InputFilter();
$opts = $filter->xssFilterHard($opts);
$args = $filter->xssFilterHard($args);
$workspaces = get_workspaces_from_args($args);
$first = true;
foreach ($workspaces as $workspace) {
try {
G::outRes( "Upgrading translation for " . pakeColor::colorize($workspace->name, "INFO") . "\n" );
$workspace->upgradeTranslation($first, $first);
$first = false;
} catch (Exception $e) {
G::outRes( "Errors upgrading translation of workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n" );
$noXml = array_key_exists('noxml', $opts) ? '--no-xml' : '';
$noMafe = array_key_exists('nomafe', $opts) ? '--no-mafe' : '';
if (!empty($noXml)) {
$noMafe = ' ' . $noMafe;
}
//Check if the command is executed by a specific workspace
if (count($args) === 1) {
translation_upgrade($args, $opts);
} else {
$workspaces = get_workspaces_from_args($args);
foreach ($workspaces as $workspace) {
passthru('./processmaker translation-repair ' . $noXml . $noMafe . ' ' . $workspace->name);
}
}
}
/**
* This function will regenerate the translation for a workspace
* This function is executed only for one workspace
* @param array $args, workspaceName that we will to apply the command
* @param array $opts, noxml and nomafe flags
*
* @return void
*/
function translation_upgrade($args, $opts)
{
try {
//Load the attributes for the workspace
$arrayWorkspace = get_workspaces_from_args($args);
//Loop, read all the attributes related to the one workspace
$wsName = $arrayWorkspace[key($arrayWorkspace)]->name;
Bootstrap::setConstantsRelatedWs($wsName);
$workspaces = get_workspaces_from_args($args);
$flagUpdateXml = (!array_key_exists('noxml', $opts));
$flagUpdateMafe = (!array_key_exists('nomafe', $opts));
foreach ($workspaces as $workspace) {
try {
G::outRes("Upgrading translation for " . pakeColor::colorize($workspace->name, "INFO") . "\n");
$workspace->upgradeTranslation($flagUpdateXml, $flagUpdateMafe);
} catch (Exception $e) {
G::outRes("Errors upgrading translation of workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n");
}
}
} catch (Exception $e) {
G::outRes(CLI::error($e->getMessage()) . "\n");
}
}
}
function run_cacheview_upgrade($args, $opts) {

View File

@@ -281,12 +281,6 @@ define( 'PML_WSDL_URL', PML_SERVER . '/syspmLibrary/en/green/services/wsdl' );
define( 'PML_UPLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/uploadProcess' );
define( 'PML_DOWNLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/download' );
//Call Gulliver Classes
//Loading the autoloader libraries feature
Bootstrap::registerSystemClasses();
$config = Bootstrap::getSystemConfiguration();
// starting session