Merged in dheeyi/processmaker/pm1 (pull request #2505)

Pm1
This commit is contained in:
Julio Cesar Laura Avendaño
2015-07-24 10:29:08 -04:00
16 changed files with 236 additions and 139 deletions

View File

@@ -28,6 +28,8 @@ G::LoadSystem("g");
CLI::taskName('flush-cache'); CLI::taskName('flush-cache');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Flush cache of all workspaces of a given workspace Flush cache of all workspaces of a given workspace
If no workspace is specified, then the cache will be flushed in all available workspaces.
EOT EOT
); );

View File

@@ -4,7 +4,7 @@ CLI::taskName("hotfix-install");
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Install hotfix to system Install hotfix to system
This command is executed when you want to update certain files, which have improvements or bugs solutions. This command installs a hotfix, which updates ProcessMaker in order to add improvements or fix bugs.
EOT EOT
); );

View File

@@ -29,13 +29,16 @@ G::LoadClass("wsTools");
CLI::taskName('mafe-translation'); CLI::taskName('mafe-translation');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Creates labels of mafe for the database Creates labels of mafe for the database
If no workspace is specified, then the translation labels will be created in all available workspaces.
EOT EOT
); );
CLI::taskArg('workspace', true, true); CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "languaje", "l:","lang="); CLI::taskOpt("lang", "Specify the language to create the translation labels. If not specified then the language will be 'en' (English) by default.
Ex: -lfr (French)
Ex: --lang=zh-CN (Mainland Chinese)", "lLANG","lang=LANG");
CLI::taskRun('run_create_translation'); CLI::taskRun('run_create_translation');
function run_create_translation($args, $opts) function run_create_translation($args, $opts)

View File

@@ -31,6 +31,9 @@ CLI::taskName('plugins-translation-update');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Update plugin translations Update plugin translations
LANG is the language, such as 'fr' (French) or 'zh-CN' (mainland Chinese).
If the language is not specified, then it is 'en' (English) by default.
EOT EOT
); );
CLI::taskArg('plugin', false); CLI::taskArg('plugin', false);
@@ -41,6 +44,9 @@ CLI::taskName('plugins-translation-create');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Create .po file for the plugin Create .po file for the plugin
LANG is the language, such as 'fr' (French) or 'zh-CN' (mainland Chinese).
If the language is not specified, then it is 'en' (English) by default.
EOT EOT
); );
CLI::taskArg('plugin', true); CLI::taskArg('plugin', true);

View File

@@ -29,10 +29,11 @@ CLI::taskName('build-js');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Generate Javascript Files Generate Javascript Files
This command should be run after any modification of javascript files in This command should be run after any modification of JavaScript files in
folder gulliver/js/*. the gulliver/js/* directory.
EOT EOT
); );
CLI::taskOpt("lang", "", "lLANG","lang=LANG");
//CLI::taskOpt("minify", "If the option is enabled, performs the build only with minified files", "min", "buildmin"); //CLI::taskOpt("minify", "If the option is enabled, performs the build only with minified files", "min", "buildmin");
CLI::taskRun("minify_javascript"); CLI::taskRun("minify_javascript");

View File

@@ -31,23 +31,24 @@ G::LoadSystem("dbMaintenance");
G::LoadClass("cli"); G::LoadClass("cli");
CLI::taskName('upgrade'); CLI::taskName('upgrade');
CLI::taskDescription("Upgrade workspaces.\n\n This command should be run after ProcessMaker files are upgraded so that all workspaces are upgraded to the current version."); CLI::taskDescription("Upgrade workspaces.\n\n This command should be run after upgrading ProcessMaker to a new version so that all workspaces are also upgraded to the\n new version.");
CLI::taskOpt("buildACV", "If the option is enabled, performs the Build Cache View.", "ACV", "buildACV"); CLI::taskOpt("buildACV", "If this option is enabled, the Cache View is built.", "ACV", "buildACV");
CLI::taskRun("run_upgrade"); CLI::taskRun("run_upgrade");
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
CLI::taskName('unify-database'); CLI::taskName('unify-database');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Unify Rbac, Reports and Workflow databases schemas to match the latest version Unify RBAC, Reports and Workflow database schemas to match the latest version
Specify the workspaces whose databases schemas should be unifyied. Specify the workspaces whose databases schemas should be unified.
If no workspace is specified, then the database schema will be upgraded or If no workspace is specified, then the database schema will be upgraded or
repaired on all available workspaces. repaired on all available workspaces.
This command will read the system schema and attempt to modify the workspaces This command will read the system schema and attempt to modify the workspaces'
tables to match this new schema. Use this command to unify databases tables to match this new schema. In version 2.8 and later, it will merge the 3
schemas or before ProcessMaker has been upgraded, so the database schemas will databases used in previous versions of ProcessMaker into one database. This
changed to match the new ProcessMaker code. command may be used after upgrading from ProcessMaker 2.5 to a later version
of ProcessMaker.
EOT EOT
); );
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/

View File

@@ -37,13 +37,12 @@ CLI::taskRun("run_info");
CLI::taskName('workspace-backup'); CLI::taskName('workspace-backup');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Backup the specified workspace to an archive. Backup the specified workspace to a file.
BACKUP-FILE is the backup filename. If it contains slashes, it will be BACKUP-FILE is the backup filename which will be created. If it contains
treated as a path and filename, either absolute or relative. Otherwise, it slashes, it will be treated as a path and filename, either absolute or relative.
will be treated as a filename inside the 'shared/backups' directory. Otherwise, it will be treated as a filename inside the "shared/backups" directory.
If no BACKUP-FILE is specified, it will use the workspace name as the If no BACKUP-FILE is specified, it will use the workspace name as the filename.
filename.
A backup archive will contain all information about the specified workspace A backup archive will contain all information about the specified workspace
so that it can be restored later. The archive includes a database dump and so that it can be restored later. The archive includes a database dump and
@@ -52,12 +51,12 @@ EOT
); );
CLI::taskArg('workspace', false); CLI::taskArg('workspace', false);
CLI::taskArg('backup-file', true); CLI::taskArg('backup-file', true);
CLI::taskOpt("filesize", "Set the max size of the compressed splitted files, by default the max is 1000 Mb.", "s:","filesize="); CLI::taskOpt("filesize", "Split the backup file in multiple files which are compressed. The maximum size of these files is set to MAX-SIZE in megabytes. If MAX-SIZE is not set, then it is 1000 megabytes by default. It may be necessary to use this option if using a 32 bit Linux/UNIX system which limits its maximum file size to 2GB. This option does not work on Windows systems.", "sMAX-SIZE","filesize=MAX-SIZE");
CLI::taskRun("run_workspace_backup"); CLI::taskRun("run_workspace_backup");
CLI::taskName('workspace-restore'); CLI::taskName('workspace-restore');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Restore a workspace from a backup. Restore a workspace from a backup file
BACKUP-FILE is the backup filename. If it contains slashes, it will be BACKUP-FILE is the backup filename. If it contains slashes, it will be
treated as a path and filename, either absolute or relative. Otherwise, it treated as a path and filename, either absolute or relative. Otherwise, it
@@ -70,12 +69,13 @@ EOT
CLI::taskArg('backup-file', false); CLI::taskArg('backup-file', false);
CLI::taskArg('workspace', true); CLI::taskArg('workspace', true);
CLI::taskOpt("overwrite", "If a workspace already exists, overwrite it.", "o", "overwrite"); CLI::taskOpt("overwrite", "If a workspace already exists, overwrite it.", "o", "overwrite");
CLI::taskOpt("info", "Only shows information about a backup archive.", "i"); CLI::taskOpt("info", "Show information about backup file, but do not restore any workspaces.", "i");
CLI::taskOpt("multiple", "Restore from multiple compresed enumerated files.", "m"); CLI::taskOpt("multiple", "Restore from multiple compressed backup files which are numbered.", "m");
CLI::taskOpt("workspace", "Select which workspace to restore if multiple workspaces are present in the archive.", CLI::taskOpt("workspace", "Specify which workspace to restore if multiple workspaces are present in the backup file.
"w:", "workspace="); Ex: -wworkflow.",
CLI::taskOpt("lang", "You must specify language on which rebuild of the case cache list builder will be done; if you don't specify this, it will use 'en' by default", "l:","lang="); "wWORKSPACE", "workspace=WORKSPACE");
CLI::taskOpt("port", "You must specify mysql port.", "p:"); CLI::taskOpt("lang", "Specify the language which will be used to rebuild the case cache list. If this option isn't included, then 'en' (English) will be used by default.", "lLANG","lang=LANG");
CLI::taskOpt("port", "Specify the port number used by MySQL. If not specified, then the port 3306 will be used by default.", "pPORT");
CLI::taskRun("run_workspace_restore"); CLI::taskRun("run_workspace_restore");
CLI::taskName('cacheview-repair'); CLI::taskName('cacheview-repair');
@@ -93,21 +93,21 @@ CLI::taskDescription(<<<EOT
EOT EOT
); );
CLI::taskArg('workspace', true, true); CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "You must specify language on which rebuild of the case cache list builder will be done; if you don't specify this, it will use 'en' by default", "l:","lang="); CLI::taskOpt("lang", "Specify the language to rebuild the case cache list. If not specified, then 'en' (English) will be used by default.\n Ex: -lfr (French) Ex: --lang=zh-CN (Mainland Chinese)", "lLANG", "lang=LANG");
CLI::taskRun("run_cacheview_upgrade"); CLI::taskRun("run_cacheview_upgrade");
CLI::taskName('database-upgrade'); CLI::taskName('database-upgrade');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Upgrade or repair the database schema to match the latest version Upgrade or repair the database schema to match the latest version
  Specify the workspaces whose database schema should be upgraded or repaired. Specify the workspaces whose database schema should be upgraded or repaired.
If no workspace is specified, then the database schema will be upgraded or If no workspace is specified, then the database schema will be upgraded or
repaired on all available workspaces. repaired on all available workspaces.
  This command will read the system schema and attempt to modify the workspaces This command will read the system schema and attempt to modify the workspaces
  tables to match this new schema. Use this command to fix corrupted database tables to match this new schema. Use this command to fix corrupted database
schemas or after ProcessMaker has been upgraded, so the database schemas will schemas or after ProcessMaker has been upgraded, so the database schemas will
changed to match the new ProcessMaker code. be changed to match the new ProcessMaker code.
EOT EOT
); );
CLI::taskArg('workspace', true, true); CLI::taskArg('workspace', true, true);
@@ -117,12 +117,13 @@ CLI::taskName('plugins-database-upgrade');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Upgrade or repair the database schema for plugins to match the latest version Upgrade or repair the database schema for plugins to match the latest version
  Specify the workspaces whose database schema should be upgraded or repaired Specify the workspaces whose database schema should be upgraded or repaired
for plugins. If no workspace is specified, then the database schema will be for plugins. If no workspace is specified, then the database schema will be
upgraded or repaired on all available workspaces. upgraded or repaired on all available workspaces.
  The same as database-upgrade but works with schemas provided by plugins. This is the same as database-upgrade but it works with schemas provided
  This is useful if there are installed plugins that include database schemas. by plugins. This is useful if plugins are installed that include
database schemas.
EOT EOT
); );
CLI::taskArg('workspace', true, true); CLI::taskArg('workspace', true, true);
@@ -130,17 +131,17 @@ CLI::taskRun("run_plugins_database_upgrade");
CLI::taskName('workspace-upgrade'); CLI::taskName('workspace-upgrade');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Upgrade the workspace(s) specified. Upgrade the specified workspace(s).
If no workspace is specified, the command will be run in all workspaces. More If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified. than one workspace can be specified.
This command is a shortcut to execute all upgrade commands for workspaces. This command is a shortcut to execute all the upgrade commands for workspaces.
Upgrading a workspace will make it correspond to the current version of Upgrading a workspace will make it correspond to the current version of
ProcessMaker. ProcessMaker.
Use this command to upgrade workspaces individually, otherwise use the Use this command to upgrade workspaces individually, otherwise use the
upgrade command to upgrade the entire system. 'processmaker upgrade' command to upgrade the entire system.
EOT EOT
); );
CLI::taskArg('workspace-name', true, true); CLI::taskArg('workspace-name', true, true);
@@ -154,7 +155,7 @@ CLI::taskDescription(<<<EOT
than one workspace can be specified. than one workspace can be specified.
This command will go through each language installed in ProcessMaker and This command will go through each language installed in ProcessMaker and
update this workspace translations to match the current version of update the translations for the workspace(s) to match the current version of
ProcessMaker. ProcessMaker.
EOT EOT
); );
@@ -169,16 +170,17 @@ CLI::taskDescription(<<<EOT
EOT EOT
); );
//CLI::taskArg('workspace', true); //CLI::taskArg('workspace', true);
CLI::taskOpt("workspace", "Select which workspace to migrate the cases folders, if multiple workspaces are present in the server.", CLI::taskOpt("workspace", "Select the workspace whose case folders will be migrated, if multiple workspaces are present in the server.\n Ex: -wworkflow. Ex: --workspace=workflow",
"w:", "workspace="); "wWORKSPACE", "workspace=WORKSPACE");
CLI::taskRun("runStructureDirectories"); CLI::taskRun("runStructureDirectories");
CLI::taskName("database-generate-self-service-by-value"); CLI::taskName("database-generate-self-service-by-value");
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Generate or upgrade the table "self-service by value". Generate or upgrade the table "self-service by value".
This command populate the table "self-service by value", this for the cases when This command populates the table "self-service by value" for cases whose
a task it's defined with "Self Service Value Based Assignment" in "Assignment Rules". task is defined with "Self Service Value Based Assignment" in "Assignment
Rules".
If no workspace is specified, the command will be run in all workspaces. More If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified. than one workspace can be specified.
@@ -192,10 +194,10 @@ CLI::taskName("check-workspace-disabled-code");
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Check disabled code for the specified workspace(s). Check disabled code for the specified workspace(s).
This command is for check disabled code for the specified workspace(s). This command checks the disabled code in the specified workspace(s).
If no workspace is specified, the command will be run in all workspaces. More If no workspace is specified, the command will be run in all workspaces.
than one workspace can be specified. More than one workspace can be specified.
EOT EOT
); );
CLI::taskArg("workspace-name", true, true); CLI::taskArg("workspace-name", true, true);

View File

@@ -131,16 +131,17 @@ class CLI
{ {
global $argv; global $argv;
$scriptName = $argv[0]; $scriptName = $argv[0];
if (is_array( $args )) { if (is_array($args) && count($args) > 0 ) {
$taskName = $args[0]; $taskName = $args[0];
} else { } else {
$taskName = $args; $taskName = $args;
} }
if (! $taskName) { if (! $taskName) {
echo "usage: $scriptName <task> [options] [args]\n"; echo "usage: processmaker <task> [options] [args]\n";
echo "Type '$scriptName help <task-name>' for help on a specific task\n"; echo " If using Linux/UNIX, prepend './' to specify the directory: " . $scriptName . " <task> [options] [args]\n";
echo "\nAvailable tasks:\n"; echo "Type 'processmaker help <task>' for help on a specific task.";
echo "\n\nAvailable tasks:\n";
$tasks = array (); $tasks = array ();
ksort( self::$tasks ); ksort( self::$tasks );
foreach (self::$tasks as $name => $data) { foreach (self::$tasks as $name => $data) {
@@ -180,13 +181,16 @@ class CLI
} }
$valid_args[] = $arg; $valid_args[] = $arg;
} }
$nameHotfixFile = ($taskName == "hotfix-install")? "HOTFIX-FILE" : "";
$valid_args = join( " ", $valid_args ); $valid_args = join( " ", $valid_args );
$description = explode( "\n", self::$tasks[$taskName]['description'] ); $description = explode( "\n", self::$tasks[$taskName]['description'] );
$taskDescription = trim( array_shift( $description ) ); $taskDescription = trim( array_shift( $description ) );
$description = trim( implode( "\n", $description ) ); $description = trim( implode( "\n", $description ) );
$message = <<< EOT $message = <<< EOT
$taskName: {$taskDescription} $taskName: {$taskDescription}
Usage: $scriptName $taskName $valid_args Usage: processmaker $taskName $nameHotfixFile $valid_args
$description $description

View File

@@ -29,7 +29,7 @@ class PMLicensedFeatures
private $features = array (); private $features = array ();
private $newFeatures = array( private $newFeatures = array(
0 => array( 0 => array(
"description" => "Enables de Actions By Email feature.", "description" => "Actions By Email allows users to enter information and route cases via email.",
"enabled" => false, "enabled" => false,
"id" => "actionsByEmail", "id" => "actionsByEmail",
"latest_version" => "", "latest_version" => "",
@@ -46,7 +46,7 @@ class PMLicensedFeatures
"version" => "" "version" => ""
), ),
1 => array( 1 => array(
"description" => "Enables de Batch Routing feature.", "description" => "Batch Routing allows a user to route multiple cases at a time onto the next task in the process. ",
"enabled" => false, "enabled" => false,
"id" => "pmConsolidatedCL", "id" => "pmConsolidatedCL",
"latest_version" => "", "latest_version" => "",
@@ -97,7 +97,7 @@ class PMLicensedFeatures
"version" => "" "version" => ""
), ),
4 => array( 4 => array(
"description" => "Registers every admin action in a log. The actions in administration settings options are registered in the log.", "description" => "Registers every administrator action in a log. Any change in the settings under the Admin menu is registered in the log.",
"enabled" => false, "enabled" => false,
"id" => "auditLog", "id" => "auditLog",
"latest_version" => "", "latest_version" => "",
@@ -131,7 +131,7 @@ class PMLicensedFeatures
"version" => "" "version" => ""
), ),
6 => array( 6 => array(
"description" => "This functionality enables the flexibility to send mails from different email servers or configurations.", "description" => "This features allows ProcessMaker to send out notifications using different email accounts and email servers.",
"enabled" => false, "enabled" => false,
"id" => "sendEmailFromDifferentEmailServers", "id" => "sendEmailFromDifferentEmailServers",
"latest_version" => "", "latest_version" => "",
@@ -423,4 +423,3 @@ class PMLicensedFeatures
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
} }

View File

@@ -177,7 +177,7 @@ class pmDynaform
array_push($json->optionsSql, $option); array_push($json->optionsSql, $option);
} }
} catch (Exception $e) { } catch (Exception $e) {
} }
} }
if (isset($json->options[0])) { if (isset($json->options[0])) {

View File

@@ -60026,10 +60026,10 @@ INSERT INTO CATALOG (CAT_UID, CAT_LABEL_ID, CAT_TYPE, CAT_FLAG, CAT_OBSERVATION,
('1050','ID_OVER_DUE','INDICATOR','%','Unit for displaying','2015-03-04','2015-03-04'); ('1050','ID_OVER_DUE','INDICATOR','%','Unit for displaying','2015-03-04','2015-03-04');
INSERT INTO ADDONS_MANAGER (ADDON_DESCRIPTION,ADDON_ID,ADDON_NAME,ADDON_NICK,ADDON_PUBLISHER,ADDON_RELEASE_TYPE,ADDON_STATUS,STORE_ID,ADDON_TYPE,ADDON_DOWNLOAD_URL,ADDON_VERSION,ADDON_DOWNLOAD_PROGRESS) VALUES INSERT INTO ADDONS_MANAGER (ADDON_DESCRIPTION,ADDON_ID,ADDON_NAME,ADDON_NICK,ADDON_PUBLISHER,ADDON_RELEASE_TYPE,ADDON_STATUS,STORE_ID,ADDON_TYPE,ADDON_DOWNLOAD_URL,ADDON_VERSION,ADDON_DOWNLOAD_PROGRESS) VALUES
('Enables de Actions By Email feature.','actionsByEmail','actionsByEmail','actionsByEmail','Colosa','localRegistry','ready','00000000000000000000000000010004','features','','','0'), ('Actions By Email allows users to enter information and route cases via email.','actionsByEmail','actionsByEmail','actionsByEmail','Colosa','localRegistry','ready','00000000000000000000000000010004','features','','','0'),
('Enables de Batch Routing feature.','pmConsolidatedCL','pmConsolidatedCL','pmConsolidatedCL','Colosa','localRegistry','ready','00000000000000000000000000010005','features','','','0'), ('Batch Routing allows a user to route multiple cases at a time onto the next task in the process.','pmConsolidatedCL','pmConsolidatedCL','pmConsolidatedCL','Colosa','localRegistry','ready','00000000000000000000000000010005','features','','','0'),
('Dashboard with improved charting graphics and optimized to show strategic information like Process Efficiency and User Efficiency indicators.','strategicDashboards','strategicDashboards','Strategic Dashboards','Colosa','localRegistry','ready','00000000000000000000000000010006','features','','','0'), ('Dashboard with improved charting graphics and optimized to show strategic information like Process Efficiency and User Efficiency indicators.','strategicDashboards','strategicDashboards','Strategic Dashboards','Colosa','localRegistry','ready','00000000000000000000000000010006','features','','','0'),
('Enables the configuration of a second database connection in order to divide the database requests in read and write operations. This features is used with database clusters to improve the application performance.','secondDatabaseConnection','secondDatabaseConnection','secondDatabaseConnection','Colosa','localRegistry','ready','00000000000000000000000000010000','features','','','0'), ('Enables the configuration of a second database connection in order to divide the database requests in read and write operations. This features is used with database clusters to improve the application performance.','secondDatabaseConnection','secondDatabaseConnection','secondDatabaseConnection','Colosa','localRegistry','ready','00000000000000000000000000010000','features','','','0'),
('A more secure option to store user passwords in ProcessMaker. The modern algorithm SHA-2 is used to store the passwords.','secureUserPasswordHash','secureUserPasswordHash','secureUserPasswordHash','Colosa','localRegistry','ready','00000000000000000000000000010002','features','','','0'), ('A more secure option to store user passwords in ProcessMaker. The modern algorithm SHA-2 is used to store the passwords.','secureUserPasswordHash','secureUserPasswordHash','secureUserPasswordHash','Colosa','localRegistry','ready','00000000000000000000000000010002','features','','','0'),
('This functionality enables the flexibility to send mails from different email servers or configurations.','sendEmailFromDifferentEmailServers','sendEmailFromDifferentEmailServers','sendEmailFromDifferentEmailServers','Colosa','localRegistry','ready','00000000000000000000000000010003','features','','','0'), ('This features allows ProcessMaker to send out notifications using different email accounts and email servers.','sendEmailFromDifferentEmailServers','sendEmailFromDifferentEmailServers','sendEmailFromDifferentEmailServers','Colosa','localRegistry','ready','00000000000000000000000000010003','features','','','0'),
('Registers every admin action in a log. The actions in administration settings options are registered in the log.','auditLog','auditLog','auditLog','Colosa','localRegistry','ready','00000000000000000000000000010001','features','','','0'); ('Registers every administrator action in a log. Any change in the settings under the Admin menu is registered in the log.','auditLog','auditLog','auditLog','Colosa','localRegistry','ready','00000000000000000000000000010001','features','','','0');

View File

@@ -86,14 +86,17 @@ $html .= '</td>';
$html .= '<td width="25%">'; $html .= '<td width="25%">';
$html .= '<select name="prefix" id="prefix">'; $html .= '<select name="prefix" id="prefix">';
if ($isBpmn) {
$html .= '<option value="ID_TO_STRING">@@</option>'; $html .= '<option value="ID_TO_STRING">@@</option>';
$html .= '<option value="ID_TO_FLOAT">@#</option>'; $html .= '<option value="ID_TO_FLOAT">@#</option>';
$html .= '<option value="ID_TO_INTEGER">@%</option>'; $html .= '<option value="ID_TO_INTEGER">@%</option>';
$html .= '<option value="ID_TO_URL">@?</option>'; $html .= '<option value="ID_TO_URL">@?</option>';
$html .= '<option value="ID_SQL_ESCAPE">@$</option>'; $html .= '<option value="ID_SQL_ESCAPE">@$</option>';
$html .= '<option value="ID_REPLACE_WITHOUT_CHANGES">@=</option>'; $html .= '<option value="ID_REPLACE_WITHOUT_CHANGES">@=</option>';
} else {
$html .= '<option value="ID_TO_STRING">@@</option>';
$html .= '<option value="ID_TO_FLOAT">@#</option>';
}
$html .= '</select> &nbsp;&nbsp;&nbsp;&nbsp;'; $html .= '</select> &nbsp;&nbsp;&nbsp;&nbsp;';
$html .= '</td>'; $html .= '</td>';

View File

@@ -31,6 +31,12 @@ class DataBaseConnection
while ($row = $rs->getRow()) { while ($row = $rs->getRow()) {
$row = array_change_key_case($row, CASE_LOWER); $row = array_change_key_case($row, CASE_LOWER);
$dataDb = $this->getDataBaseConnection($pro_uid, $row['dbs_uid'], false); $dataDb = $this->getDataBaseConnection($pro_uid, $row['dbs_uid'], false);
if($dataDb["dbs_type"] == "oracle" && $dataDb["dbs_connection_type"] == "TNS") {
$dataDb["dbs_server"] = "[" . $dataDb["dbs_tns"] . "]";
$dataDb["dbs_database_name"] = "[" . $dataDb["dbs_tns"] . "]";
}
$dbConnecions[] = array_change_key_case($dataDb, CASE_LOWER); $dbConnecions[] = array_change_key_case($dataDb, CASE_LOWER);
$rs->next(); $rs->next();
} }
@@ -96,6 +102,8 @@ class DataBaseConnection
$oContent = new \Content(); $oContent = new \Content();
$dataDBConnection = array_change_key_case($dataDBConnection, CASE_UPPER); $dataDBConnection = array_change_key_case($dataDBConnection, CASE_UPPER);
$flagTns = ($dataDBConnection["DBS_TYPE"] == "oracle" && $dataDBConnection["DBS_CONNECTION_TYPE"] == "TNS")? 1 : 0;
$dataDBConnection['PRO_UID'] = $pro_uid; $dataDBConnection['PRO_UID'] = $pro_uid;
if (isset($dataDBConnection['DBS_TYPE'])) { if (isset($dataDBConnection['DBS_TYPE'])) {
@@ -109,17 +117,23 @@ class DataBaseConnection
} }
} }
if (isset($dataDBConnection['DBS_SERVER']) && $dataDBConnection['DBS_SERVER'] == '') { if (isset($dataDBConnection["DBS_SERVER"]) && $dataDBConnection["DBS_SERVER"] == "" && $flagTns == 0) {
throw (new \Exception(\G::LoadTranslation("ID_DBC_SERVER_INVALID", array($dataDBConnection['DBS_SERVER'])))); throw (new \Exception(\G::LoadTranslation("ID_DBC_SERVER_INVALID", array($dataDBConnection['DBS_SERVER']))));
} }
if (isset($dataDBConnection['DBS_DATABASE_NAME']) && $dataDBConnection['DBS_DATABASE_NAME'] == '') { if (isset($dataDBConnection["DBS_DATABASE_NAME"]) && $dataDBConnection["DBS_DATABASE_NAME"] == "" && $flagTns == 0) {
throw (new \Exception(\G::LoadTranslation("ID_DBC_DBNAME_INVALID", array($dataDBConnection['DBS_DATABASE_NAME'])))); throw (new \Exception(\G::LoadTranslation("ID_DBC_DBNAME_INVALID", array($dataDBConnection['DBS_DATABASE_NAME']))));
} }
if (isset($dataDBConnection['DBS_PORT']) && if (isset($dataDBConnection['DBS_PORT']) &&
($dataDBConnection['DBS_PORT'] == ''|| $dataDBConnection['DBS_PORT'] == 0)) { ($dataDBConnection['DBS_PORT'] == ''|| $dataDBConnection['DBS_PORT'] == 0)) {
throw (new \Exception(\G::LoadTranslation("ID_DBC_PORT_INVALID", array($dataDBConnection['DBS_PORT'])))); if ($flagTns == 0) {
throw (new \Exception(\G::LoadTranslation("ID_DBC_PORT_INVALID", array($dataDBConnection["DBS_PORT"]))));
}
}
if (isset($dataDBConnection["DBS_TNS"]) && $dataDBConnection["DBS_TNS"] == "" && $flagTns == 1) {
throw (new \Exception(\G::LoadTranslation("ID_DBC_TNS_NOT_EXIST", array($dataDBConnection["DBS_TNS"]))));
} }
if (isset($dataDBConnection['DBS_ENCODE'])) { if (isset($dataDBConnection['DBS_ENCODE'])) {
@@ -140,11 +154,25 @@ class DataBaseConnection
if ($dataDBConnection['DBS_PASSWORD'] == 'none') { if ($dataDBConnection['DBS_PASSWORD'] == 'none') {
$dataDBConnection['DBS_PASSWORD'] = ''; $dataDBConnection['DBS_PASSWORD'] = '';
} else { } else {
$pass = G::encrypt( $dataDBConnection['DBS_PASSWORD'], $dataDBConnection['DBS_DATABASE_NAME']) . "_2NnV3ujj3w"; if ($flagTns == 0) {
$pass = \G::encrypt( $dataDBConnection["DBS_PASSWORD"], $dataDBConnection["DBS_DATABASE_NAME"]) . "_2NnV3ujj3w";
} else {
$pass = \G::encrypt($dataDBConnection["DBS_PASSWORD"], $dataDBConnection["DBS_TNS"]) . "_2NnV3ujj3w";
}
$dataDBConnection['DBS_PASSWORD'] = $pass; $dataDBConnection['DBS_PASSWORD'] = $pass;
} }
} }
if ($flagTns == 0) {
$dataDBConnection["DBS_CONNECTION_TYPE"] = "NORMAL";
$dataDBConnection["DBS_TNS"] = "";
} else {
$dataDBConnection["DBS_SERVER"] = "";
$dataDBConnection["DBS_DATABASE_NAME"] = "";
$dataDBConnection["DBS_PORT"] = 0;
}
if ($create) { if ($create) {
unset($dataDBConnection['DBS_UID']); unset($dataDBConnection['DBS_UID']);
// TEST CONNECTION // TEST CONNECTION
@@ -216,42 +244,54 @@ class DataBaseConnection
$dataCon = array_change_key_case($dataCon, CASE_UPPER); $dataCon = array_change_key_case($dataCon, CASE_UPPER);
$flagTns = ($dataCon["DBS_TYPE"] == "oracle" && $dataCon["DBS_CONNECTION_TYPE"] == "TNS")? 1 : 0;
G::LoadClass( 'net' ); G::LoadClass( 'net' );
$Server = new \NET($dataCon['DBS_SERVER']);
// STEP 1 : Resolving Host Name if ($flagTns == 0) {
$respTest['0'] = array(); $Server = new \NET($dataCon['DBS_SERVER']);
$respTest['0']['test'] = 'Resolving Host Name ' . $dataCon['DBS_SERVER'];
if ($Server->getErrno() != 0) { // STEP 1 : Resolving Host Name
if ($returnArray) { $respTest['0'] = array();
$respTest['0']['error'] = "Error Testing Connection: Resolving Host Name FAILED : " . $Server->error; $respTest['0']['test'] = 'Resolving Host Name ' . $dataCon['DBS_SERVER'];
} else { if ($Server->getErrno() != 0) {
$resp['message'] = "Error Testing Connection: Resolving Host Name FAILED : " . $Server->error; if ($returnArray) {
return $resp; $respTest['0']['error'] = "Error Testing Connection: Resolving Host Name FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Resolving Host Name FAILED : " . $Server->error;
return $resp;
}
} }
}
// STEP 2 : Checking port // STEP 2 : Checking port
$respTest['1'] = array(); $respTest['1'] = array();
$respTest['1']['test'] = 'Checking port ' . $dataCon['DBS_PORT']; $respTest['1']['test'] = 'Checking port ' . $dataCon['DBS_PORT'];
$Server->scannPort($dataCon['DBS_PORT']); $Server->scannPort($dataCon['DBS_PORT']);
if ($Server->getErrno() != 0) { if ($Server->getErrno() != 0) {
if ($returnArray) { if ($returnArray) {
$respTest['1']['error'] = "Error Testing Connection: Checking port FAILED : " . $Server->error; $respTest['1']['error'] = "Error Testing Connection: Checking port FAILED : " . $Server->error;
} else { } else {
$resp['message'] = "Error Testing Connection: Checking port FAILED : " . $Server->error; $resp['message'] = "Error Testing Connection: Checking port FAILED : " . $Server->error;
return $resp; return $resp;
}
} }
}
// STEP 3 : Trying to connect to host // STEP 3 : Trying to connect to host
$respTest['2'] = array(); $respTest['2'] = array();
$respTest['2']['test'] = 'Connecting to host ' . $dataCon['DBS_SERVER'] . (($dataCon['DBS_PORT'] != '') ? ':'.$dataCon['DBS_PORT'] : ''); $respTest['2']['test'] = 'Connecting to host ' . $dataCon['DBS_SERVER'] . (($dataCon['DBS_PORT'] != '') ? ':'.$dataCon['DBS_PORT'] : '');
$Server->loginDbServer($dataCon['DBS_USERNAME'], $dataCon['DBS_PASSWORD']); $Server->loginDbServer($dataCon['DBS_USERNAME'], $dataCon['DBS_PASSWORD']);
$Server->setDataBase($dataCon['DBS_DATABASE_NAME'], $dataCon['DBS_PORT']); $Server->setDataBase($dataCon['DBS_DATABASE_NAME'], $dataCon['DBS_PORT']);
if ($Server->errno == 0) { if ($Server->errno == 0) {
$response = $Server->tryConnectServer($dataCon['DBS_TYPE']); $response = $Server->tryConnectServer($dataCon['DBS_TYPE']);
if ($response->status != 'SUCCESS') { if ($response->status != 'SUCCESS') {
if ($returnArray) {
$respTest['2']['error'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
return $resp;
}
}
} else {
if ($returnArray) { if ($returnArray) {
$respTest['2']['error'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error; $respTest['2']['error'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
} else { } else {
@@ -259,25 +299,25 @@ class DataBaseConnection
return $resp; return $resp;
} }
} }
} else {
if ($returnArray) {
$respTest['2']['error'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
return $resp;
}
}
// STEP 4 : Trying to open database // STEP 4 : Trying to open database
$respTest['3'] = array(); $respTest['3'] = array();
$respTest['3']['test'] = 'Opening database [' . $dataCon['DBS_DATABASE_NAME'] . ']'; $respTest['3']['test'] = 'Opening database [' . $dataCon['DBS_DATABASE_NAME'] . ']';
$Server->loginDbServer($dataCon['DBS_USERNAME'], $dataCon['DBS_PASSWORD']); $Server->loginDbServer($dataCon['DBS_USERNAME'], $dataCon['DBS_PASSWORD']);
$Server->setDataBase($dataCon['DBS_DATABASE_NAME'], $dataCon['DBS_PORT']); $Server->setDataBase($dataCon['DBS_DATABASE_NAME'], $dataCon['DBS_PORT']);
if ($Server->errno == 0) { if ($Server->errno == 0) {
$response = $Server->tryConnectServer($dataCon['DBS_TYPE']); $response = $Server->tryConnectServer($dataCon['DBS_TYPE']);
if ($response->status == 'SUCCESS') { if ($response->status == 'SUCCESS') {
$response = $Server->tryOpenDataBase($dataCon['DBS_TYPE']); $response = $Server->tryOpenDataBase($dataCon['DBS_TYPE']);
if ($response->status != 'SUCCESS') { if ($response->status != 'SUCCESS') {
if ($returnArray) {
$respTest['3']['error'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
return $resp;
}
}
} else {
if ($returnArray) { if ($returnArray) {
$respTest['3']['error'] = "Error Testing Connection: Opening database FAILED : " . $Server->error; $respTest['3']['error'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
} else { } else {
@@ -294,11 +334,51 @@ class DataBaseConnection
} }
} }
} else { } else {
if ($returnArray) { $net = new \NET();
$respTest['3']['error'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
//STEP 0: Trying to open database type TNS
$respTest["0"] = array();
$respTest["0"]["test"] = "Test TNS: " . $dataCon["DBS_TNS"];
$net->loginDbServer($dataCon["DBS_USERNAME"], $dataCon["DBS_PASSWORD"]);
if ($net->errno == 0) {
$arrayServerData = array("connectionType" => $dataCon["DBS_CONNECTION_TYPE"], "tns" => $dataCon["DBS_TNS"]);
$response = $net->tryConnectServer($dataCon["DBS_TYPE"], $arrayServerData);
if ($response->status == "SUCCESS") {
$response = $net->tryOpenDataBase($dataCon["DBS_TYPE"], $arrayServerData);
if ($response->status != "SUCCESS") {
if ($returnArray) {
$respTest["0"]["error"] = "Error Testing Connection: Opening database type TNS FAILED, " . $net->error;
} else {
$resp["message"] = "Error Testing Connection: Opening database type TNS FAILED, " . $net->error;
//Return
return $resp;
}
}
} else {
if ($returnArray) {
$respTest["0"]["error"] = "Error Testing Connection: Opening database type TNS FAILED, " . $net->error;
} else {
$resp["message"] = "Error Testing Connection: Opening database type TNS FAILED, " . $net->error;
//Return
return $resp;
}
}
} else { } else {
$resp['message'] = "Error Testing Connection: Opening database FAILED : " . $Server->error; if ($returnArray) {
return $resp; $respTest["0"]["error"] = "Error Testing Connection: Opening database type TNS FAILED, " . $net->error;
} else {
$resp["message"] = "Error Testing Connection: Opening database type TNS FAILED, " . $net->error;
//Return
return $resp;
}
} }
} }

View File

@@ -358,6 +358,7 @@ class Light
case 'REPORT_TO': case 'REPORT_TO':
case 'BALANCED': case 'BALANCED':
case 'SELF_SERVICE': case 'SELF_SERVICE':
$taskAss = array();
$taskAss['taskId'] = $aValues['NEXT_TASK']['TAS_UID']; $taskAss['taskId'] = $aValues['NEXT_TASK']['TAS_UID'];
$taskAss['taskName'] = $aValues['NEXT_TASK']['TAS_TITLE']; $taskAss['taskName'] = $aValues['NEXT_TASK']['TAS_TITLE'];
$taskAss['taskAssignType'] = $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE']; $taskAss['taskAssignType'] = $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'];
@@ -371,6 +372,7 @@ class Light
$response[] = $taskAss; $response[] = $taskAss;
break; break;
case 'MANUAL': case 'MANUAL':
$manual = array();
$manual['taskId'] = $aValues['NEXT_TASK']['TAS_UID']; $manual['taskId'] = $aValues['NEXT_TASK']['TAS_UID'];
$manual['taskName'] = $aValues['NEXT_TASK']['TAS_TITLE']; $manual['taskName'] = $aValues['NEXT_TASK']['TAS_TITLE'];
$manual['taskAssignType'] = $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE']; $manual['taskAssignType'] = $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'];

View File

@@ -870,7 +870,7 @@ class Task
} }
} }
} else { } else {
$limit = 1000; $limit = count($aUsers) + 1;
} }
$aUsers = $this->arrayPagination($aUsers, $start, $limit); $aUsers = $this->arrayPagination($aUsers, $start, $limit);
return $aUsers; return $aUsers;
@@ -1003,7 +1003,7 @@ class Task
} }
} }
} else { } else {
$limit = 1000; $limit = count($aUsers) + 1;
} }
$aUsers = $this->arrayPagination($aUsers, $start, $limit); $aUsers = $this->arrayPagination($aUsers, $start, $limit);
return $aUsers; return $aUsers;
@@ -1371,7 +1371,7 @@ class Task
} }
} }
} else { } else {
$limit = 1000; $limit = count($aUsers) + 1;
} }
$aUsers = $this->arrayPagination($aUsers, $start, $limit); $aUsers = $this->arrayPagination($aUsers, $start, $limit);
return $aUsers; return $aUsers;
@@ -1504,7 +1504,7 @@ class Task
} }
} }
} else { } else {
$limit = 1000; $limit = count($aUsers) + 1;
} }
$aUsers = $this->arrayPagination($aUsers, $start, $limit); $aUsers = $this->arrayPagination($aUsers, $start, $limit);
return $aUsers; return $aUsers;
@@ -1924,7 +1924,7 @@ class Task
} }
} }
} else { } else {
$limit = 1000; $limit = count($aUsersGroups) + 1;
} }
$aUsersGroups = $this->arrayPagination($aUsersGroups, $start, $limit); $aUsersGroups = $this->arrayPagination($aUsersGroups, $start, $limit);
return $aUsersGroups; return $aUsersGroups;
@@ -2042,7 +2042,7 @@ class Task
} }
} }
} else { } else {
$limit = 1000; $limit = count($aUsersGroups) + 1;
} }
$aUsersGroups = $this->arrayPagination($aUsersGroups, $start, $limit); $aUsersGroups = $this->arrayPagination($aUsersGroups, $start, $limit);
return $aUsersGroups; return $aUsersGroups;

View File

@@ -62,7 +62,6 @@ class DataBaseConnection extends Api
* @param string $dbs_server {@from body} {@required true} * @param string $dbs_server {@from body} {@required true}
* @param string $dbs_database_name {@from body} {@required true} * @param string $dbs_database_name {@from body} {@required true}
* @param string $dbs_username {@from body} * @param string $dbs_username {@from body}
* @param string $dbs_port {@from body} {@type float}
* @param string $dbs_encode {@from body} {@required true} * @param string $dbs_encode {@from body} {@required true}
* @param string $dbs_password {@from body} * @param string $dbs_password {@from body}
* @param string $dbs_description {@from body} * @param string $dbs_description {@from body}
@@ -80,7 +79,6 @@ class DataBaseConnection extends Api
$dbs_server, $dbs_server,
$dbs_database_name, $dbs_database_name,
$dbs_username, $dbs_username,
$dbs_port,
$dbs_encode, $dbs_encode,
$dbs_password = '', $dbs_password = '',
$dbs_description = '' $dbs_description = ''
@@ -103,7 +101,6 @@ class DataBaseConnection extends Api
* @param string $dbs_server {@from body} {@required true} * @param string $dbs_server {@from body} {@required true}
* @param string $dbs_database_name {@from body} {@required true} * @param string $dbs_database_name {@from body} {@required true}
* @param string $dbs_username {@from body} * @param string $dbs_username {@from body}
* @param string $dbs_port {@from body} {@type float}
* @param string $dbs_encode {@from body} {@required true} * @param string $dbs_encode {@from body} {@required true}
* @param string $dbs_password {@from body} * @param string $dbs_password {@from body}
* @param string $dbs_description {@from body} * @param string $dbs_description {@from body}
@@ -122,7 +119,6 @@ class DataBaseConnection extends Api
$dbs_server, $dbs_server,
$dbs_database_name, $dbs_database_name,
$dbs_username, $dbs_username,
$dbs_port,
$dbs_encode, $dbs_encode,
$dbs_password = '', $dbs_password = '',
$dbs_description = '' $dbs_description = ''
@@ -145,7 +141,6 @@ class DataBaseConnection extends Api
* @param string $dbs_server {@from body} {@required true} * @param string $dbs_server {@from body} {@required true}
* @param string $dbs_database_name {@from body} {@required true} * @param string $dbs_database_name {@from body} {@required true}
* @param string $dbs_username {@from body} * @param string $dbs_username {@from body}
* @param string $dbs_port {@from body} {@type float}
* @param string $dbs_encode {@from body} {@required true} * @param string $dbs_encode {@from body} {@required true}
* @param string $dbs_password {@from body} * @param string $dbs_password {@from body}
* @param string $dbs_description {@from body} * @param string $dbs_description {@from body}
@@ -164,7 +159,6 @@ class DataBaseConnection extends Api
$dbs_server, $dbs_server,
$dbs_database_name, $dbs_database_name,
$dbs_username, $dbs_username,
$dbs_port,
$dbs_encode, $dbs_encode,
$dbs_password = '', $dbs_password = '',
$dbs_description = '' $dbs_description = ''