Changes 3 and 4 of the google sheet

This commit is contained in:
dante
2017-08-11 14:10:44 -04:00
parent 9a381f5841
commit 9ecfbe0c84
31 changed files with 158 additions and 248 deletions

View File

@@ -26,7 +26,7 @@ class CodeScanner
if (!is_null($option)) { if (!is_null($option)) {
switch (gettype($option)) { switch (gettype($option)) {
case 'string': case 'string':
$workspace = new workspaceTools($option); $workspace = new WorkspaceTools($option);
if ($workspace->workspaceExists()) { if ($workspace->workspaceExists()) {
$arraySystemConfiguration = PmSystem::getSystemConfiguration('', '', $workspace->name); $arraySystemConfiguration = PmSystem::getSystemConfiguration('', '', $workspace->name);

View File

@@ -57,7 +57,7 @@ function run_addon_core_install($args)
} }
/////// ///////
$ws = new workspaceTools($workspace); $ws = new WorkspaceTools($workspace);
$ws->initPropel(false); $ws->initPropel(false);
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php'; require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
@@ -73,7 +73,7 @@ function run_addon_core_install($args)
$addon->install(); $addon->install();
if ($addon->isCore()) { if ($addon->isCore()) {
$ws = new workspaceTools($workspace); $ws = new WorkspaceTools($workspace);
$ws->initPropel(false); $ws->initPropel(false);
$addon->setState("install-finish"); $addon->setState("install-finish");
} else { } else {

View File

@@ -44,7 +44,7 @@ if(sizeof($output) == 3 && isset($output[2]) && isset($output[2][0])) {
function get_workspaces_from_args($args, $includeAll = true) { function get_workspaces_from_args($args, $includeAll = true) {
$workspaces = array(); $workspaces = array();
foreach ($args as $arg) { foreach ($args as $arg) {
$workspaces[] = new workspaceTools($arg); $workspaces[] = new WorkspaceTools($arg);
} }
if (empty($workspaces) && $includeAll) { if (empty($workspaces) && $includeAll) {
$workspaces = PmSystem::listWorkspaces(); $workspaces = PmSystem::listWorkspaces();

View File

@@ -22,7 +22,7 @@ function runHotfixInstall($command, $args)
foreach ($arrayFile as $value) { foreach ($arrayFile as $value) {
$f = $value; $f = $value;
$result = workspaceTools::hotfixInstall($f); $result = WorkspaceTools::hotfixInstall($f);
CLI::logging($result["message"] . "\n"); CLI::logging($result["message"] . "\n");
} }

View File

@@ -20,7 +20,7 @@ function cliListIds($command, $args)
$workspace->dbInfo['DB_USER'], $workspace->dbInfo['DB_USER'],
$workspace->dbInfo['DB_PASS'] $workspace->dbInfo['DB_PASS']
); );
foreach (workspaceTools::$populateIdsQueries as $query) { foreach (WorkspaceTools::$populateIdsQueries as $query) {
echo "."; echo ".";
$dbh->query($query); $dbh->query($query);
} }

View File

@@ -219,10 +219,10 @@ function run_unify_database($args)
if (sizeof($args) > 2) { if (sizeof($args) > 2) {
$filename = array_pop($args); $filename = array_pop($args);
foreach ($args as $arg) { foreach ($args as $arg) {
$workspaces[] = new workspaceTools($arg); $workspaces[] = new WorkspaceTools($arg);
} }
} else if (sizeof($args) > 0) { } else if (sizeof($args) > 0) {
$workspace = new workspaceTools($args[0]); $workspace = new WorkspaceTools($args[0]);
$workspaces[] = $workspace; $workspaces[] = $workspace;
} }

View File

@@ -364,7 +364,7 @@ CLI::taskRun("regenerate_pmtable_classes");
*/ */
function run_info($args, $opts) { function run_info($args, $opts) {
$workspaces = get_workspaces_from_args($args); $workspaces = get_workspaces_from_args($args);
workspaceTools::printSysInfo(); WorkspaceTools::printSysInfo();
foreach ($workspaces as $workspace) { foreach ($workspaces as $workspace) {
echo "\n"; echo "\n";
$workspace->printMetadata(false); $workspace->printMetadata(false);
@@ -490,7 +490,7 @@ function run_plugins_database_upgrade($args, $opts) {
function run_database_export($args, $opts) { function run_database_export($args, $opts) {
if (count($args) < 2) if (count($args) < 2)
throw new Exception ("Please provide a workspace name and a directory for export"); throw new Exception ("Please provide a workspace name and a directory for export");
$workspace = new workspaceTools($args[0]); $workspace = new WorkspaceTools($args[0]);
$workspace->exportDatabase($args[1]); $workspace->exportDatabase($args[1]);
} }
@@ -670,10 +670,10 @@ function run_workspace_backup($args, $opts) {
if (sizeof($args) > 2) { if (sizeof($args) > 2) {
$filename = array_pop($args); $filename = array_pop($args);
foreach ($args as $arg) { foreach ($args as $arg) {
$workspaces[] = new workspaceTools($arg); $workspaces[] = new WorkspaceTools($arg);
} }
} else if (sizeof($args) > 0) { } else if (sizeof($args) > 0) {
$workspace = new workspaceTools($args[0]); $workspace = new WorkspaceTools($args[0]);
$workspaces[] = $workspace; $workspaces[] = $workspace;
if (sizeof($args) == 2) { if (sizeof($args) == 2) {
$filename = $args[1]; $filename = $args[1];
@@ -712,14 +712,14 @@ function run_workspace_backup($args, $opts) {
$multipleBackup->letsBackup(); $multipleBackup->letsBackup();
} else { } else {
//ansient method to backup into one large file //ansient method to backup into one large file
$backup = workspaceTools::createBackup($filename); $backup = WorkspaceTools::createBackup($filename);
foreach ($workspaces as $workspace) { foreach ($workspaces as $workspace) {
$workspace->backup($backup); $workspace->backup($backup);
} }
} }
CLI::logging("\n"); CLI::logging("\n");
workspaceTools::printSysInfo(); WorkspaceTools::printSysInfo();
foreach ($workspaces as $workspace) { foreach ($workspaces as $workspace) {
CLI::logging("\n"); CLI::logging("\n");
$workspace->printMetadata(false); $workspace->printMetadata(false);
@@ -747,7 +747,7 @@ function run_workspace_restore($args, $opts) {
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en'; $lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
$port = array_key_exists("port", $opts) ? $opts['port'] : ''; $port = array_key_exists("port", $opts) ? $opts['port'] : '';
if ($info) { if ($info) {
workspaceTools::getBackupInfo($filename); WorkspaceTools::getBackupInfo($filename);
} else { } else {
CLI::logging("Restoring from $filename\n"); CLI::logging("Restoring from $filename\n");
$workspace = array_key_exists("workspace", $opts) ? $opts['workspace'] : NULL; $workspace = array_key_exists("workspace", $opts) ? $opts['workspace'] : NULL;
@@ -773,7 +773,7 @@ function run_workspace_restore($args, $opts) {
CLI::error("Please, you should use -m parameter to restore them.\n"); CLI::error("Please, you should use -m parameter to restore them.\n");
return; return;
} }
workspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang, $port ); WorkspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang, $port );
} }
} }
} else { } else {
@@ -890,7 +890,7 @@ function run_migrate_itee_to_dummytask($args, $opts){
$arrayWorkspace = get_workspaces_from_args($args); $arrayWorkspace = get_workspaces_from_args($args);
foreach ($arrayWorkspace as $workspace) { foreach ($arrayWorkspace as $workspace) {
try { try {
$ws = new workspaceTools($workspace->name); $ws = new WorkspaceTools($workspace->name);
$res = $ws->migrateIteeToDummytask($workspace->name); $res = $ws->migrateIteeToDummytask($workspace->name);
} catch (Exception $e) { } catch (Exception $e) {
G::outRes( "> Error: ".CLI::error($e->getMessage()) . "\n" ); G::outRes( "> Error: ".CLI::error($e->getMessage()) . "\n" );
@@ -1114,7 +1114,7 @@ function run_migrate_indexing_acv($args, $opts) {
function run_migrate_plugin($args, $opts) { function run_migrate_plugin($args, $opts) {
$workspaces = get_workspaces_from_args($args); $workspaces = get_workspaces_from_args($args);
//Check if the command is executed by a specific workspace //Check if the command is executed by a specific workspace
/** @var workspaceTools $workspace */ /** @var WorkspaceTools $workspace */
if (count($workspaces) === 1) { if (count($workspaces) === 1) {
$workspace = array_shift($workspaces); $workspace = array_shift($workspaces);
CLI::logging('Regenerating Singleton in: ' . pakeColor::colorize($workspace->name, 'INFO') . "\n"); CLI::logging('Regenerating Singleton in: ' . pakeColor::colorize($workspace->name, 'INFO') . "\n");
@@ -1148,7 +1148,7 @@ function regenerate_pmtable_classes($args, $opts)
CLI::logging("> Updating generated class files for PM Tables...\n"); CLI::logging("> Updating generated class files for PM Tables...\n");
Bootstrap::setConstantsRelatedWs($args[0]); Bootstrap::setConstantsRelatedWs($args[0]);
$workspaceTools = new workspaceTools($args[0]); $workspaceTools = new WorkspaceTools($args[0]);
$workspaceTools->fixReferencePathFiles(PATH_DATA_SITE . "classes", PATH_DATA); $workspaceTools->fixReferencePathFiles(PATH_DATA_SITE . "classes", PATH_DATA);
$stop = microtime(true); $stop = microtime(true);

View File

@@ -291,7 +291,7 @@ class actionsByEmailCoreClass extends PMPlugin
} }
} }
$wsBaseInstance = new wsBase(); $wsBaseInstance = new WsBase();
$result = $wsBaseInstance->sendMessage( $result = $wsBaseInstance->sendMessage(
$data->APP_UID, $data->APP_UID,
$emailFrom, $emailFrom,

View File

@@ -651,7 +651,7 @@ class IndicatorsCalculator
private function pdoConnection() { private function pdoConnection() {
$currentWS = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined'; $currentWS = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
$workSpace = new workspaceTools($currentWS); $workSpace = new WorkspaceTools($currentWS);
$arrayHost = explode(':', $workSpace->dbHost); $arrayHost = explode(':', $workSpace->dbHost);
$host = "host=".$arrayHost[0]; $host = "host=".$arrayHost[0];
$port = count($arrayHost) > 1 ? ";port=".$arrayHost[1] : ""; $port = count($arrayHost) > 1 ? ";port=".$arrayHost[1] : "";

View File

@@ -135,7 +135,7 @@
if (empty( $metaFiles )) { if (empty( $metaFiles )) {
$metaFiles = glob( $tempDirectory . "/*.txt" ); $metaFiles = glob( $tempDirectory . "/*.txt" );
if (! empty( $metaFiles )) { if (! empty( $metaFiles )) {
return workspaceTools::restoreLegacy( $tempDirectory ); return WorkspaceTools::restoreLegacy( $tempDirectory );
} else { } else {
throw new Exception( "No metadata found in backup" ); throw new Exception( "No metadata found in backup" );
} }
@@ -170,7 +170,7 @@
} else { } else {
CLI::logging( "> Restoring " . CLI::info( $backupWorkspace ) . " to " . CLI::info( $workspaceName ) . "\n" ); CLI::logging( "> Restoring " . CLI::info( $backupWorkspace ) . " to " . CLI::info( $workspaceName ) . "\n" );
} }
$workspace = new workspaceTools( $workspaceName ); $workspace = new WorkspaceTools( $workspaceName );
if ($workspace->workspaceExists()) { if ($workspace->workspaceExists()) {
if ($overwrite) { if ($overwrite) {
CLI::logging( CLI::warning( "> Workspace $workspaceName already exist, overwriting!" ) . "\n" ); CLI::logging( CLI::warning( "> Workspace $workspaceName already exist, overwriting!" ) . "\n" );
@@ -194,7 +194,7 @@
CLI::logging( "> Changing file permissions\n" ); CLI::logging( "> Changing file permissions\n" );
$shared_stat = stat( PATH_DATA ); $shared_stat = stat( PATH_DATA );
if ($shared_stat !== false) { if ($shared_stat !== false) {
workspaceTools::dirPerms( $workspace->path, $shared_stat['uid'], $shared_stat['gid'], $shared_stat['mode'] ); WorkspaceTools::dirPerms( $workspace->path, $shared_stat['uid'], $shared_stat['gid'], $shared_stat['mode'] );
} else { } else {
CLI::logging( CLI::error( "Could not get the shared folder permissions, not changing workspace permissions" ) . "\n" ); CLI::logging( CLI::error( "Could not get the shared folder permissions, not changing workspace permissions" ) . "\n" );
} }

View File

@@ -93,7 +93,7 @@ class PmSystem
$aWorkspaces = array (); $aWorkspaces = array ();
foreach (glob( PATH_DB . "*" ) as $filename) { foreach (glob( PATH_DB . "*" ) as $filename) {
if (is_dir( $filename ) && file_exists( $filename . "/db.php" )) { if (is_dir( $filename ) && file_exists( $filename . "/db.php" )) {
$aWorkspaces[] = new workspaceTools( basename( $filename ) ); $aWorkspaces[] = new WorkspaceTools( basename( $filename ) );
} }
} }
return $aWorkspaces; return $aWorkspaces;

View File

@@ -1,24 +1,5 @@
<?php <?php
function ls_dir($dir, $basename = null)
{
$files = array();
//if (substr($dir, -1) != "/")
// $dir .= "/";
if ($basename == null) {
$basename = $dir;
}
foreach (glob("$dir/*") as $filename) {
//var_dump(substr($filename, strlen($basename) + 1));
if (is_dir($filename)) {
$files = array_merge($files, ls_dir($filename, $basename));
} else {
$files[] = substr($filename, strlen($basename) + 1);
}
}
return $files;
}
class Upgrade class Upgrade
{ {
@@ -80,7 +61,7 @@ class Upgrade
$checksum = array(); $checksum = array();
$changedFiles = array(); $changedFiles = array();
$time = microtime(1); $time = microtime(1);
$files = ls_dir($extractDir); $files = $this->ls_dir($extractDir);
//printf("Time to list files: %f\n", microtime(1) - $time); //printf("Time to list files: %f\n", microtime(1) - $time);
echo "Updating ProcessMaker files...\n"; echo "Updating ProcessMaker files...\n";
$time = microtime(1); $time = microtime(1);
@@ -142,4 +123,24 @@ class Upgrade
} }
//printf("Time to install: %f\n", microtime(1) - $start); //printf("Time to install: %f\n", microtime(1) - $start);
} }
private function ls_dir($dir, $basename = null)
{
$files = array();
//if (substr($dir, -1) != "/")
// $dir .= "/";
if ($basename == null) {
$basename = $dir;
}
foreach (glob("$dir/*") as $filename) {
//var_dump(substr($filename, strlen($basename) + 1));
if (is_dir($filename)) {
$files = array_merge($files, $this->ls_dir($filename, $basename));
} else {
$files[] = substr($filename, strlen($basename) + 1);
}
}
return $files;
}
} }

View File

@@ -3,15 +3,14 @@
use ProcessMaker\Util\FixReferencePath; use ProcessMaker\Util\FixReferencePath;
use ProcessMaker\Plugins\Adapters\PluginAdapter; use ProcessMaker\Plugins\Adapters\PluginAdapter;
/**
*
/** /**
* class workspaceTools. * class workspaceTools.
* *
* Utility functions to manage a workspace. * Utility functions to manage a workspace.
* *
* @package workflow.engine.classes * @package workflow.engine.classes
*/class workspaceTools */
class WorkspaceTools
{ {
public $name = null; public $name = null;
public $path = null; public $path = null;
@@ -1236,11 +1235,11 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
public function printMetadata($printSysInfo = true) public function printMetadata($printSysInfo = true)
{ {
if ($printSysInfo) { if ($printSysInfo) {
workspaceTools::printSysInfo(); WorkspaceTools::printSysInfo();
CLI::logging("\n"); CLI::logging("\n");
} }
workspaceTools::printInfo($this->getMetadata()); WorkspaceTools::printInfo($this->getMetadata());
} }
/** /**
@@ -1576,7 +1575,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
$data = file_get_contents($metafile); $data = file_get_contents($metafile);
$workspaceData = G::json_decode($data); $workspaceData = G::json_decode($data);
CLI::logging("\n"); CLI::logging("\n");
workspaceTools::printInfo((array)$workspaceData); WorkspaceTools::printInfo((array)$workspaceData);
} }
G::rm_dir($tempDirectory); G::rm_dir($tempDirectory);
@@ -1600,7 +1599,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
if (basename($item) == "." || basename($item) == "..") { if (basename($item) == "." || basename($item) == "..") {
continue; continue;
} }
workspaceTools::dirPerms($item, $owner, $group, $perms); WorkspaceTools::dirPerms($item, $owner, $group, $perms);
} }
} }
} }
@@ -1639,7 +1638,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
if (empty($metaFiles)) { if (empty($metaFiles)) {
$metaFiles = glob($tempDirectory . "/*.txt"); $metaFiles = glob($tempDirectory . "/*.txt");
if (!empty($metaFiles)) { if (!empty($metaFiles)) {
return workspaceTools::restoreLegacy($tempDirectory); return WorkspaceTools::restoreLegacy($tempDirectory);
} else { } else {
throw new Exception("No metadata found in backup"); throw new Exception("No metadata found in backup");
} }
@@ -1694,7 +1693,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
} else { } else {
CLI::logging("> Restoring " . CLI::info($backupWorkspace) . " to " . CLI::info($workspaceName) . "\n"); CLI::logging("> Restoring " . CLI::info($backupWorkspace) . " to " . CLI::info($workspaceName) . "\n");
} }
$workspace = new workspaceTools($workspaceName); $workspace = new WorkspaceTools($workspaceName);
if (PmInstaller::isset_site($workspaceName)) { if (PmInstaller::isset_site($workspaceName)) {
if ($overwrite) { if ($overwrite) {
@@ -1727,7 +1726,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
$shared_stat = stat(PATH_DATA); $shared_stat = stat(PATH_DATA);
if ($shared_stat !== false) { if ($shared_stat !== false) {
workspaceTools::dirPerms($workspace->path, $shared_stat['uid'], $shared_stat['gid'], $shared_stat['mode']); WorkspaceTools::dirPerms($workspace->path, $shared_stat['uid'], $shared_stat['gid'], $shared_stat['mode']);
} else { } else {
CLI::logging(CLI::error("Could not get the shared folder permissions, not changing workspace permissions") . "\n"); CLI::logging(CLI::error("Could not get the shared folder permissions, not changing workspace permissions") . "\n");
} }
@@ -2019,7 +2018,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
CLI::logging(" Copying Enterprise Directory to $pathNewFile...\n"); CLI::logging(" Copying Enterprise Directory to $pathNewFile...\n");
if ($shared_stat !== false) { if ($shared_stat !== false) {
workspaceTools::dirPerms($pathDirectoryEnterprise, $shared_stat['uid'], $shared_stat['gid'], $shared_stat['mode']); WorkspaceTools::dirPerms($pathDirectoryEnterprise, $shared_stat['uid'], $shared_stat['gid'], $shared_stat['mode']);
} else { } else {
CLI::logging(CLI::error("Could not get shared folder permissions, workspace permissions couldn't be changed") . "\n"); CLI::logging(CLI::error("Could not get shared folder permissions, workspace permissions couldn't be changed") . "\n");
} }
@@ -2036,7 +2035,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
if (file_exists($pathFileEnterprise)) { if (file_exists($pathFileEnterprise)) {
CLI::logging(" Copying Enterprise.php file to $pathNewFile...\n"); CLI::logging(" Copying Enterprise.php file to $pathNewFile...\n");
if ($shared_stat !== false) { if ($shared_stat !== false) {
workspaceTools::dirPerms($pathFileEnterprise, $shared_stat['uid'], $shared_stat['gid'], $shared_stat['mode']); WorkspaceTools::dirPerms($pathFileEnterprise, $shared_stat['uid'], $shared_stat['gid'], $shared_stat['mode']);
} else { } else {
CLI::logging(CLI::error("Could not get shared folder permissions, workspace permissions couldn't be changed") . "\n"); CLI::logging(CLI::error("Could not get shared folder permissions, workspace permissions couldn't be changed") . "\n");
} }
@@ -3771,7 +3770,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
CLI::logging("-> Populating PRO_ID, USR_ID at LIST_* \n"); CLI::logging("-> Populating PRO_ID, USR_ID at LIST_* \n");
$con->begin(); $con->begin();
$stmt = $con->createStatement(); $stmt = $con->createStatement();
foreach (workspaceTools::$populateIdsQueries as $query) { foreach (WorkspaceTools::$populateIdsQueries as $query) {
$stmt->executeQuery($query); $stmt->executeQuery($query);
} }
$con->commit(); $con->commit();

View File

@@ -1,38 +1,7 @@
<?php <?php
/**
* class.wsBase.php
*
* @package workflow.engine.classes
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
//It works with the table CONFIGURATION in a WF dataBase //It works with the table CONFIGURATION in a WF dataBase
/**
* Copyright (C) 2009 COLOSA
* License: LGPL, see LICENSE
* Last Modify: 26.06.2008 10:05:00
* Last modify by: Erik Amaru Ortiz <erik@colosa.com>
* Last Modify comment(26.06.2008): the session expired verification was removed from here to soap
/** /**
* Copyright (C) 2009 COLOSA * Copyright (C) 2009 COLOSA
* License: LGPL, see LICENSE * License: LGPL, see LICENSE
@@ -41,7 +10,8 @@
* Last Modify comment(26.06.2008): the session expired verification was removed from here to soap class * Last Modify comment(26.06.2008): the session expired verification was removed from here to soap class
* *
* @package workflow.engine.classes * @package workflow.engine.classes
*/class wsBase */
class WsBase
{ {
public $stored_system_variables; //boolean public $stored_system_variables; //boolean
public $wsSessionId; //web service session id, if the wsbase function is used from a WS request public $wsSessionId; //web service session id, if the wsbase function is used from a WS request
@@ -1488,7 +1458,7 @@
{ {
try { try {
if (trim( $groupName ) == '') { if (trim( $groupName ) == '') {
$result = new wsCreateGroupResponse( 25, G::loadTranslation( 'ID_GROUP_NAME_REQUIRED' ), '' ); $result = new WsCreateGroupResponse( 25, G::loadTranslation( 'ID_GROUP_NAME_REQUIRED' ), '' );
return $result; return $result;
} }
@@ -1498,7 +1468,7 @@
$data['GROUP_NAME'] = $groupName; $data['GROUP_NAME'] = $groupName;
$result = new wsCreateGroupResponse( 0, G::loadTranslation( 'ID_GROUP_CREATED_SUCCESSFULLY', SYS_LANG, $data ), $groupId ); $result = new WsCreateGroupResponse( 0, G::loadTranslation( 'ID_GROUP_CREATED_SUCCESSFULLY', SYS_LANG, $data ), $groupId );
return $result; return $result;
} catch (Exception $e) { } catch (Exception $e) {
@@ -1519,7 +1489,7 @@
{ {
try { try {
if (trim( $departmentName ) == '') { if (trim( $departmentName ) == '') {
$result = new wsCreateDepartmentResponse( 25, G::loadTranslation( 'ID_DEPARTMENT_NAME_REQUIRED' ), '' ); $result = new WsCreateDepartmentResponse( 25, G::loadTranslation( 'ID_DEPARTMENT_NAME_REQUIRED' ), '' );
return $result; return $result;
} }
@@ -1527,13 +1497,13 @@
$department = new Department(); $department = new Department();
if (($parentUID != '') && ! ($department->existsDepartment( $parentUID ))) { if (($parentUID != '') && ! ($department->existsDepartment( $parentUID ))) {
$result = new wsCreateDepartmentResponse( 26, G::loadTranslation( 'ID_PARENT_DEPARTMENT_NOT_EXIST' ), $parentUID ); $result = new WsCreateDepartmentResponse( 26, G::loadTranslation( 'ID_PARENT_DEPARTMENT_NOT_EXIST' ), $parentUID );
return $result; return $result;
} }
if ($department->checkDepartmentName( $departmentName, $parentUID )) { if ($department->checkDepartmentName( $departmentName, $parentUID )) {
$result = new wsCreateDepartmentResponse( 27, G::loadTranslation( 'ID_DEPARTMENT_EXISTS' ), '' ); $result = new WsCreateDepartmentResponse( 27, G::loadTranslation( 'ID_DEPARTMENT_EXISTS' ), '' );
return $result; return $result;
} }
@@ -1547,7 +1517,7 @@
$data['PARENT_UID'] = $parentUID; $data['PARENT_UID'] = $parentUID;
$data['DEPARTMENT_NAME'] = $departmentName; $data['DEPARTMENT_NAME'] = $departmentName;
$result = new wsCreateDepartmentResponse( 0, G::loadTranslation( 'ID_DEPARTMENT_CREATED_SUCCESSFULLY', SYS_LANG, $data ), $departmentId ); $result = new WsCreateDepartmentResponse( 0, G::loadTranslation( 'ID_DEPARTMENT_CREATED_SUCCESSFULLY', SYS_LANG, $data ), $departmentId );
return $result; return $result;
} catch (Exception $e) { } catch (Exception $e) {

View File

@@ -1,41 +1,12 @@
<?php <?php
/**
* class.wsResponse.php
*
* @package workflow.engine.classes
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/**
*
* @package workflow.engine.classes
*/
/** /**
* Class wsCreateDepartmentResponse * Class wsCreateDepartmentResponse
* *
* @package workflow.engine.classes * @package workflow.engine.classes
*/class wsCreateDepartmentResponse */
class WsCreateDepartmentResponse
{ {
public $status_code = 0; public $status_code = 0;
public $message = ''; public $message = '';

View File

@@ -1,41 +1,11 @@
<?php <?php
/**
* class.wsResponse.php
*
* @package workflow.engine.classes
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/**
*
* @package workflow.engine.classes
*/
/** /**
* Class wsCreateGroupResponse * Class wsCreateGroupResponse
* *
* @package workflow.engine.classes * @package workflow.engine.classes
*/class wsCreateGroupResponse */
class WsCreateGroupResponse
{ {
public $status_code = 0; public $status_code = 0;
public $message = ''; public $message = '';

View File

@@ -960,7 +960,7 @@ function PMFSendMessage(
} }
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->sendMessage( $result = $ws->sendMessage(
$caseId, $caseId,
$sFrom, $sFrom,
@@ -1558,7 +1558,7 @@ function WSAddCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMa
*/ */
function PMFTaskCase ($caseId) //its test was successfull function PMFTaskCase ($caseId) //its test was successfull
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->taskCase( $caseId ); $result = $ws->taskCase( $caseId );
$rows = Array (); $rows = Array ();
$i = 1; $i = 1;
@@ -1586,7 +1586,7 @@ function PMFTaskCase ($caseId) //its test was successfull
*/ */
function PMFTaskList ($userId) //its test was successfull function PMFTaskList ($userId) //its test was successfull
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->taskList( $userId ); $result = $ws->taskList( $userId );
$rows = Array (); $rows = Array ();
$i = 1; $i = 1;
@@ -1613,7 +1613,7 @@ function PMFTaskList ($userId) //its test was successfull
*/ */
function PMFUserList () //its test was successfull function PMFUserList () //its test was successfull
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->userList(); $result = $ws->userList();
$rows = Array (); $rows = Array ();
$i = 1; $i = 1;
@@ -1920,7 +1920,7 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
*/ */
function PMFGroupList ($regex = null, $start = null, $limit = null) //its test was successfull function PMFGroupList ($regex = null, $start = null, $limit = null) //its test was successfull
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->groupList($regex, $start, $limit); $result = $ws->groupList($regex, $start, $limit);
$rows = array(); $rows = array();
if ($result) { if ($result) {
@@ -1944,7 +1944,7 @@ function PMFGroupList ($regex = null, $start = null, $limit = null) //its test w
*/ */
function PMFRoleList () //its test was successfull function PMFRoleList () //its test was successfull
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->roleList(); $result = $ws->roleList();
$rows = Array (); $rows = Array ();
$i = 1; $i = 1;
@@ -1972,7 +1972,7 @@ function PMFRoleList () //its test was successfull
*/ */
function PMFCaseList ($userId) //its test was successfull function PMFCaseList ($userId) //its test was successfull
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->caseList( $userId ); $result = $ws->caseList( $userId );
$rows = Array (); $rows = Array ();
$i = 1; $i = 1;
@@ -1999,7 +1999,7 @@ function PMFCaseList ($userId) //its test was successfull
*/ */
function PMFProcessList () //its test was successfull function PMFProcessList () //its test was successfull
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->processList(); $result = $ws->processList();
$rows = Array (); $rows = Array ();
$i = 1; $i = 1;
@@ -2028,7 +2028,7 @@ function PMFProcessList () //its test was successfull
*/ */
function PMFSendVariables ($caseId, $variables) function PMFSendVariables ($caseId, $variables)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->sendVariables( $caseId, $variables ); $result = $ws->sendVariables( $caseId, $variables );
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2071,7 +2071,7 @@ function PMFDerivateCase ($caseId, $delIndex, $bExecuteTriggersBeforeAssignment
$sUserLogged = $_SESSION['USER_LOGGED']; $sUserLogged = $_SESSION['USER_LOGGED'];
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->derivateCase( $sUserLogged, $caseId, $delIndex, $bExecuteTriggersBeforeAssignment ); $result = $ws->derivateCase( $sUserLogged, $caseId, $delIndex, $bExecuteTriggersBeforeAssignment );
if (is_array($result)) { if (is_array($result)) {
$result = (object)$result; $result = (object)$result;
@@ -2103,7 +2103,7 @@ function PMFDerivateCase ($caseId, $delIndex, $bExecuteTriggersBeforeAssignment
*/ */
function PMFNewCaseImpersonate ($processId, $userId, $variables, $taskId = '') function PMFNewCaseImpersonate ($processId, $userId, $variables, $taskId = '')
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->newCaseImpersonate( $processId, $userId, $variables, $taskId); $result = $ws->newCaseImpersonate( $processId, $userId, $variables, $taskId);
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2133,7 +2133,7 @@ function PMFNewCaseImpersonate ($processId, $userId, $variables, $taskId = '')
*/ */
function PMFNewCase ($processId, $userId, $taskId, $variables, $status = null) function PMFNewCase ($processId, $userId, $taskId, $variables, $status = null)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->newCase($processId, $userId, $taskId, $variables, 0, $status); $result = $ws->newCase($processId, $userId, $taskId, $variables, 0, $status);
@@ -2163,7 +2163,7 @@ function PMFNewCase ($processId, $userId, $taskId, $variables, $status = null)
*/ */
function PMFAssignUserToGroup ($userId, $groupId) function PMFAssignUserToGroup ($userId, $groupId)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->assignUserToGroup( $userId, $groupId ); $result = $ws->assignUserToGroup( $userId, $groupId );
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2196,7 +2196,7 @@ function PMFAssignUserToGroup ($userId, $groupId)
*/ */
function PMFCreateUser ($userId, $password, $firstname, $lastname, $email, $role, $dueDate = null, $status = null) function PMFCreateUser ($userId, $password, $firstname, $lastname, $email, $role, $dueDate = null, $status = null)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->createUser( $userId, $firstname, $lastname, $email, $role, $password, $dueDate, $status ); $result = $ws->createUser( $userId, $firstname, $lastname, $email, $role, $password, $dueDate, $status );
//When the user is created the $result parameter is an array, in other case is a object exception //When the user is created the $result parameter is an array, in other case is a object exception
@@ -2235,7 +2235,7 @@ function PMFCreateUser ($userId, $password, $firstname, $lastname, $email, $role
*/ */
function PMFUpdateUser ($userUid, $userName, $firstName = null, $lastName = null, $email = null, $dueDate = null, $status = null, $role = null, $password = null) function PMFUpdateUser ($userUid, $userName, $firstName = null, $lastName = null, $email = null, $dueDate = null, $status = null, $role = null, $password = null)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->updateUser( $userUid, $userName, $firstName, $lastName, $email, $dueDate, $status, $role, $password ); $result = $ws->updateUser( $userUid, $userName, $firstName, $lastName, $email, $dueDate, $status, $role, $password );
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2261,7 +2261,7 @@ function PMFUpdateUser ($userUid, $userName, $firstName = null, $lastName = null
*/ */
function PMFInformationUser($userUid) function PMFInformationUser($userUid)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->informationUser($userUid); $result = $ws->informationUser($userUid);
$info = array(); $info = array();
@@ -2735,7 +2735,7 @@ function PMFGetCaseNotes ($applicationID, $type = 'array', $userUid = '')
*/ */
function PMFDeleteCase ($caseUid) function PMFDeleteCase ($caseUid)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->deleteCase( $caseUid ); $result = $ws->deleteCase( $caseUid );
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2763,7 +2763,7 @@ function PMFDeleteCase ($caseUid)
*/ */
function PMFCancelCase ($caseUid, $delIndex, $userUid) function PMFCancelCase ($caseUid, $delIndex, $userUid)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->cancelCase( $caseUid, $delIndex, $userUid ); $result = $ws->cancelCase( $caseUid, $delIndex, $userUid );
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2802,7 +2802,7 @@ function PMFCancelCase ($caseUid, $delIndex, $userUid)
*/ */
function PMFPauseCase ($caseUid, $delIndex, $userUid, $unpauseDate = null) function PMFPauseCase ($caseUid, $delIndex, $userUid, $unpauseDate = null)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->pauseCase($caseUid, $delIndex, $userUid, $unpauseDate); $result = $ws->pauseCase($caseUid, $delIndex, $userUid, $unpauseDate);
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2840,7 +2840,7 @@ function PMFPauseCase ($caseUid, $delIndex, $userUid, $unpauseDate = null)
*/ */
function PMFUnpauseCase ($caseUid, $delIndex, $userUid) function PMFUnpauseCase ($caseUid, $delIndex, $userUid)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->unpauseCase( $caseUid, $delIndex, $userUid ); $result = $ws->unpauseCase( $caseUid, $delIndex, $userUid );
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2871,7 +2871,7 @@ function PMFUnpauseCase ($caseUid, $delIndex, $userUid)
*/ */
function PMFAddCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMail = 1) function PMFAddCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMail = 1)
{ {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->addCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMail); $result = $ws->addCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMail);
if ($result->status_code == 0) { if ($result->status_code == 0) {
@@ -2970,7 +2970,7 @@ function PMFSaveCurrentData ()
$response = 0; $response = 0;
if (isset($_SESSION['APPLICATION']) && isset($oPMScript->aFields)) { if (isset($_SESSION['APPLICATION']) && isset($oPMScript->aFields)) {
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->sendVariables($_SESSION['APPLICATION'], $oPMScript->aFields); $result = $ws->sendVariables($_SESSION['APPLICATION'], $oPMScript->aFields);
$response = $result->status_code == 0 ? 1 : 0; $response = $result->status_code == 0 ? 1 : 0;
} }

View File

@@ -387,7 +387,6 @@ class AddonsManager extends BaseAddonsManager
$this->setState(); $this->setState();
} else { } else {
if ($this->getAddonType() == "core") { if ($this->getAddonType() == "core") {
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.Upgrade.php';
$upgrade = new Upgrade($this); $upgrade = new Upgrade($this);
$upgrade->install(); $upgrade->install();

View File

@@ -361,7 +361,7 @@ class Content extends BaseContent
FROM CONTENT FROM CONTENT
ORDER BY CON_ID, CON_CATEGORY, CON_PARENT, CON_LANG"; ORDER BY CON_ID, CON_CATEGORY, CON_PARENT, CON_LANG";
$workSpace = new workspaceTools( $workSpace ); $workSpace = new WorkspaceTools( $workSpace );
$workSpace->getDBInfo(); $workSpace->getDBInfo();
$link = @mysql_pconnect( $workSpace->dbHost, $workSpace->dbUser, $workSpace->dbPass) or die( "Could not connect" ); $link = @mysql_pconnect( $workSpace->dbHost, $workSpace->dbUser, $workSpace->dbPass) or die( "Could not connect" );

View File

@@ -114,7 +114,7 @@ class pmTablesProxy extends HttpProxyController
$dbConn = new DbConnections(); $dbConn = new DbConnections();
$dbConnections = $dbConn->getConnectionsProUid( $proUid, array('mysql') ); $dbConnections = $dbConn->getConnectionsProUid( $proUid, array('mysql') );
$workSpace = new workspaceTools(SYS_SYS); $workSpace = new WorkspaceTools(SYS_SYS);
$workspaceDB = $workSpace->getDBInfo(); $workspaceDB = $workSpace->getDBInfo();
if ($workspaceDB['DB_NAME'] == $workspaceDB['DB_RBAC_NAME']) { if ($workspaceDB['DB_NAME'] == $workspaceDB['DB_RBAC_NAME']) {

View File

@@ -64,7 +64,7 @@ if (isset($_GET['BROWSER_TIME_ZONE_OFFSET'])) {
$case->updateCase($_REQUEST['APP_UID'], $caseFieldsABE); $case->updateCase($_REQUEST['APP_UID'], $caseFieldsABE);
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->derivateCase( $result = $ws->derivateCase(
$caseFieldsABE['CURRENT_USER_UID'], $_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX'], true $caseFieldsABE['CURRENT_USER_UID'], $_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX'], true

View File

@@ -101,7 +101,7 @@ if (PMLicensedFeatures
//Update case info //Update case info
$case->updateCase($appUid, $casesFields); $case->updateCase($appUid, $casesFields);
$wsBaseInstance = new wsBase(); $wsBaseInstance = new WsBase();
$result = $wsBaseInstance->derivateCase($casesFields['CURRENT_USER_UID'], $appUid, $delIndex, true); $result = $wsBaseInstance->derivateCase($casesFields['CURRENT_USER_UID'], $appUid, $delIndex, true);
$code = (is_array($result) ? $result['status_code'] : $result->status_code); $code = (is_array($result) ? $result['status_code'] : $result->status_code);

View File

@@ -10,7 +10,7 @@ $wsdl = PATH_METHODS . "services" . PATH_SEP . "pmos2.wsdl";
function login ($params) function login ($params)
{ {
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->login( $params->userid, $params->password ); $res = $ws->login( $params->userid, $params->password );
return array ('status_code' => $res->status_code,'message' => $res->message,'version' => WEB_SERVICE_VERSION,'timestamp' => $res->timestamp return array ('status_code' => $res->status_code,'message' => $res->message,'version' => WEB_SERVICE_VERSION,'timestamp' => $res->timestamp
@@ -30,7 +30,7 @@ function ProcessList ($params)
} }
if (ifPermission( $params->sessionId, 'PM_CASES' ) != 0) { if (ifPermission( $params->sessionId, 'PM_CASES' ) != 0) {
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->processList(); $res = $ws->processList();
return array ("processes" => $res return array ("processes" => $res
@@ -54,14 +54,14 @@ function ProcessList ($params)
$session = $oSessions->getSessionUser( $params->sessionId ); $session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID']; $userId = $session['USR_UID'];
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->processListVerified( $userId ); $res = $ws->processListVerified( $userId );
return array ("processes" => $res return array ("processes" => $res
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->processList(); $res = $ws->processList();
return array ("processes" => $res return array ("processes" => $res
@@ -88,7 +88,7 @@ function RoleList ($params)
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->roleList(); $res = $ws->roleList();
return array ("roles" => $res return array ("roles" => $res
@@ -115,7 +115,7 @@ function GroupList ($params)
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->groupList(); $res = $ws->groupList();
return array ("groups" => $res return array ("groups" => $res
@@ -142,7 +142,7 @@ function DepartmentList ($params)
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->departmentList(); $res = $ws->departmentList();
return array ("departments" => $res return array ("departments" => $res
@@ -179,7 +179,7 @@ function CaseList ($params)
$session = $oSessions->getSessionUser( $params->sessionId ); $session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID']; $userId = $session['USR_UID'];
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->caseList( $userId ); $res = $ws->caseList( $userId );
return array ("cases" => $res return array ("cases" => $res
@@ -211,7 +211,7 @@ function UnassignedCaseList ($params)
$session = $oSessions->getSessionUser( $params->sessionId ); $session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID']; $userId = $session['USR_UID'];
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->unassignedCaseList( $userId ); $res = $ws->unassignedCaseList( $userId );
return array ("cases" => $res return array ("cases" => $res
@@ -238,7 +238,7 @@ function UserList ($params)
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->userList(); $res = $ws->userList();
return array ("users" => $res return array ("users" => $res
@@ -267,7 +267,7 @@ function triggerList ($params)
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->triggerList(); $res = $ws->triggerList();
return array ("triggers" => $res return array ("triggers" => $res
@@ -312,7 +312,7 @@ function outputDocumentList ($params)
$session = $oSessions->getSessionUser( $params->sessionId ); $session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID']; $userId = $session['USR_UID'];
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->outputDocumentList( $params->caseId, $userId ); $res = $ws->outputDocumentList( $params->caseId, $userId );
return array ("documents" => $res return array ("documents" => $res
@@ -357,7 +357,7 @@ function inputDocumentList ($params)
$session = $oSessions->getSessionUser( $params->sessionId ); $session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID']; $userId = $session['USR_UID'];
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->inputDocumentList( $params->caseId, $userId ); $res = $ws->inputDocumentList( $params->caseId, $userId );
return array ("documents" => $res return array ("documents" => $res
@@ -386,7 +386,7 @@ function inputDocumentProcessList ($params)
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->inputDocumentProcessList( $params->processId ); $res = $ws->inputDocumentProcessList( $params->processId );
return array ("documents" => $res return array ("documents" => $res
@@ -407,7 +407,7 @@ function removeDocument ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->removeDocument( $params->appDocUid ); $res = $ws->removeDocument( $params->appDocUid );
return $res; return $res;
@@ -427,7 +427,7 @@ function SendMessage ($params)
return $result->getPayloadArray(); return $result->getPayloadArray();
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->sendMessage( $params->caseId, $params->from, $params->to, $params->cc, $params->bcc, $params->subject, $params->template ); $res = $ws->sendMessage( $params->caseId, $params->from, $params->to, $params->cc, $params->bcc, $params->subject, $params->template );
return $res->getPayloadArray(); return $res->getPayloadArray();
@@ -447,7 +447,7 @@ function getCaseInfo ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->getCaseInfo( $params->caseId, $params->delIndex ); $res = $ws->getCaseInfo( $params->caseId, $params->delIndex );
return $res; return $res;
@@ -467,7 +467,7 @@ function SendVariables ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$variables = $params->variables; $variables = $params->variables;
$Fields = array (); $Fields = array ();
@@ -506,7 +506,7 @@ function GetVariables ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->getVariables( $params->caseId, $params->variables ); $res = $ws->getVariables( $params->caseId, $params->variables );
@@ -528,7 +528,7 @@ function GetVariablesNames ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->getVariablesNames( $params->caseId ); $res = $ws->getVariablesNames( $params->caseId );
@@ -556,7 +556,7 @@ function DerivateCase ($params)
$oStd->stored_system_variables = true; $oStd->stored_system_variables = true;
$oStd->wsSessionId = $params->sessionId; $oStd->wsSessionId = $params->sessionId;
$ws = new wsBase( $oStd ); $ws = new WsBase( $oStd );
$res = $ws->derivateCase($user["USR_UID"], $params->caseId, $params->delIndex, true); $res = $ws->derivateCase($user["USR_UID"], $params->caseId, $params->delIndex, true);
return $res; return $res;
@@ -584,7 +584,7 @@ function RouteCase ($params)
$oStd->stored_system_variables = true; $oStd->stored_system_variables = true;
$oStd->wsSessionId = $params->sessionId; $oStd->wsSessionId = $params->sessionId;
$ws = new wsBase( $oStd ); $ws = new WsBase( $oStd );
$res = $ws->derivateCase($user["USR_UID"], $params->caseId, $params->delIndex, true); $res = $ws->derivateCase($user["USR_UID"], $params->caseId, $params->delIndex, true);
return $res; return $res;
@@ -608,7 +608,7 @@ function executeTrigger ($params)
$oSession = new Sessions(); $oSession = new Sessions();
$user = $oSession->getSessionUser( $params->sessionId ); $user = $oSession->getSessionUser( $params->sessionId );
$ws = new wsBase(); $ws = new WsBase();
$delIndex = (isset( $params->delIndex )) ? $params->delIndex : 1; $delIndex = (isset( $params->delIndex )) ? $params->delIndex : 1;
$res = $ws->executeTrigger( $user['USR_UID'], $params->caseId, $params->triggerIndex, $delIndex ); $res = $ws->executeTrigger( $user['USR_UID'], $params->caseId, $params->triggerIndex, $delIndex );
@@ -649,7 +649,7 @@ function NewCaseImpersonate ($params)
$params->variables = $field; $params->variables = $field;
/////// ///////
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->newCaseImpersonate($params->processId, $params->userId, $params->variables, $params->taskId); $res = $ws->newCaseImpersonate($params->processId, $params->userId, $params->variables, $params->taskId);
return $res; return $res;
@@ -712,7 +712,7 @@ function NewCase($params)
$params->variables = $field; $params->variables = $field;
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->newCase($params->processId, $userId, $params->taskId, $params->variables, (isset($params->executeTriggers)) ? (int) ($params->executeTriggers) : 0); $res = $ws->newCase($params->processId, $userId, $params->taskId, $params->variables, (isset($params->executeTriggers)) ? (int) ($params->executeTriggers) : 0);
@@ -743,7 +743,7 @@ function AssignUserToGroup ($params)
return new wsResponse( 3, 'User not registered in the system' ); return new wsResponse( 3, 'User not registered in the system' );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->assignUserToGroup( $params->userId, $params->groupId ); $res = $ws->assignUserToGroup( $params->userId, $params->groupId );
return $res->getPayloadArray(); return $res->getPayloadArray();
@@ -770,7 +770,7 @@ function AssignUserToDepartment ($params)
return new wsResponse( 3, G::LoadTranslation('ID_USER_NOT_REGISTERED_SYSTEM') ); return new wsResponse( 3, G::LoadTranslation('ID_USER_NOT_REGISTERED_SYSTEM') );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->AssignUserToDepartment( $params->userId, $params->departmentId, $params->manager ); $res = $ws->AssignUserToDepartment( $params->userId, $params->departmentId, $params->manager );
return $res->getPayloadArray(); return $res->getPayloadArray();
@@ -790,7 +790,7 @@ function CreateUser ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
try { try {
$res = $ws->createUser( $params->userId, $params->firstname, $params->lastname, $params->email, $params->role, $params->password, ((isset( $params->dueDate )) ? $params->dueDate : null), ((isset( $params->status )) ? $params->status : null) ); $res = $ws->createUser( $params->userId, $params->firstname, $params->lastname, $params->email, $params->role, $params->password, ((isset( $params->dueDate )) ? $params->dueDate : null), ((isset( $params->status )) ? $params->status : null) );
@@ -815,7 +815,7 @@ function updateUser ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->updateUser( $params->userUid, $params->userName, ((isset( $params->firstName )) ? $params->firstName : null), ((isset( $params->lastName )) ? $params->lastName : null), ((isset( $params->email )) ? $params->email : null), ((isset( $params->dueDate )) ? $params->dueDate : null), ((isset( $params->status )) ? $params->status : null), ((isset( $params->role )) ? $params->role : null), ((isset( $params->password )) ? $params->password : null) ); $result = $ws->updateUser( $params->userUid, $params->userName, ((isset( $params->firstName )) ? $params->firstName : null), ((isset( $params->lastName )) ? $params->lastName : null), ((isset( $params->email )) ? $params->email : null), ((isset( $params->dueDate )) ? $params->dueDate : null), ((isset( $params->status )) ? $params->status : null), ((isset( $params->role )) ? $params->role : null), ((isset( $params->password )) ? $params->password : null) );
@@ -836,7 +836,7 @@ function informationUser($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->informationUser($params->userUid); $result = $ws->informationUser($params->userUid);
return $result; return $result;
@@ -847,18 +847,18 @@ function CreateGroup ($params)
$vsResult = isValidSession( $params->sessionId ); $vsResult = isValidSession( $params->sessionId );
if ($vsResult->status_code !== 0) { if ($vsResult->status_code !== 0) {
$result = new wsCreateGroupResponse( $vsResult->status_code, $vsResult->message, '' ); $result = new WsCreateGroupResponse( $vsResult->status_code, $vsResult->message, '' );
return $result; return $result;
} }
if (ifPermission( $params->sessionId, 'PM_USERS' ) == 0) { if (ifPermission( $params->sessionId, 'PM_USERS' ) == 0) {
$result = new wsCreateGroupResponse( 2, G::LoadTranslation('ID_NOT_PRIVILEGES'), '' ); $result = new WsCreateGroupResponse( 2, G::LoadTranslation('ID_NOT_PRIVILEGES'), '' );
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->createGroup( $params->name ); $res = $ws->createGroup( $params->name );
return $res; return $res;
@@ -878,7 +878,7 @@ function CreateDepartment ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->CreateDepartment( $params->name, $params->parentUID ); $res = $ws->CreateDepartment( $params->name, $params->parentUID );
return $res; return $res;
@@ -904,7 +904,7 @@ function TaskList ($params)
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$oSessions = new Sessions(); $oSessions = new Sessions();
$session = $oSessions->getSessionUser( $params->sessionId ); $session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID']; $userId = $session['USR_UID'];
@@ -934,7 +934,7 @@ function TaskCase ($params)
); );
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->taskCase( $params->caseId ); $res = $ws->taskCase( $params->caseId );
return array ("taskCases" => $res return array ("taskCases" => $res
@@ -948,7 +948,7 @@ function ReassignCase ($params)
return $vsResult; return $vsResult;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->reassignCase( $params->sessionId, $params->caseId, $params->delIndex, $params->userIdSource, $params->userIdTarget ); $res = $ws->reassignCase( $params->sessionId, $params->caseId, $params->delIndex, $params->userIdSource, $params->userIdTarget );
return $res; return $res;
@@ -962,7 +962,7 @@ function systemInformation ($params)
return $vsResult; return $vsResult;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->systemInformation(); $res = $ws->systemInformation();
return $res; return $res;
@@ -976,7 +976,7 @@ function getCaseNotes ($params)
return $vsResult; return $vsResult;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->getCaseNotes( $params->applicationID, $params->userUid ); $res = $ws->getCaseNotes( $params->applicationID, $params->userUid );
return $res; return $res;
@@ -1008,7 +1008,7 @@ function removeUserFromGroup ($params)
return $vsResult; return $vsResult;
} }
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->removeUserFromGroup( $params->userId, $params->groupId ); $res = $ws->removeUserFromGroup( $params->userId, $params->groupId );
return $res; return $res;
@@ -1052,7 +1052,7 @@ function deleteCase ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->deleteCase( $params->caseUid ); $result = $ws->deleteCase( $params->caseUid );
return $result; return $result;
@@ -1072,7 +1072,7 @@ function cancelCase ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->cancelCase( $params->caseUid, $params->delIndex, $params->userUid ); $result = $ws->cancelCase( $params->caseUid, $params->delIndex, $params->userUid );
return $result; return $result;
@@ -1092,7 +1092,7 @@ function pauseCase ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->pauseCase( $params->caseUid, $params->delIndex, $params->userUid, ((isset( $params->unpauseDate )) ? $params->unpauseDate : null) ); $result = $ws->pauseCase( $params->caseUid, $params->delIndex, $params->userUid, ((isset( $params->unpauseDate )) ? $params->unpauseDate : null) );
@@ -1113,7 +1113,7 @@ function unpauseCase ($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->unpauseCase( $params->caseUid, $params->delIndex, $params->userUid ); $result = $ws->unpauseCase( $params->caseUid, $params->delIndex, $params->userUid );
return $result; return $result;
@@ -1133,7 +1133,7 @@ function addCaseNote($params)
return $result; return $result;
} }
$ws = new wsBase(); $ws = new WsBase();
$result = $ws->addCaseNote( $result = $ws->addCaseNote(
$params->caseUid, $params->caseUid,
$params->processUid, $params->processUid,
@@ -1162,7 +1162,7 @@ function claimCase($params)
$oSessions = new Sessions(); $oSessions = new Sessions();
$session = $oSessions->getSessionUser($params->sessionId); $session = $oSessions->getSessionUser($params->sessionId);
$ws = new wsBase(); $ws = new WsBase();
$res = $ws->claimCase($session['USR_UID'], $params->guid, $params->delIndex); $res = $ws->claimCase($session['USR_UID'], $params->guid, $params->delIndex);
return $res; return $res;

View File

@@ -78,7 +78,7 @@ try {
$configuration = new Configurations(); $configuration = new Configurations();
$importResults = $language->import( $languageFile ); $importResults = $language->import( $languageFile );
$renegerateContent = new workspaceTools( SYS_SYS ); $renegerateContent = new WorkspaceTools( SYS_SYS );
$messs = $renegerateContent->upgradeContent(); $messs = $renegerateContent->upgradeContent();
$result->msg = G::LoadTranslation( 'IMPORT_LANGUAGE_SUCCESS' ) . "\n"; $result->msg = G::LoadTranslation( 'IMPORT_LANGUAGE_SUCCESS' ) . "\n";

View File

@@ -7,7 +7,7 @@ use CasesPeer;
use AppDelegation; use AppDelegation;
use ProcessMaker\Plugins\PluginRegistry; use ProcessMaker\Plugins\PluginRegistry;
use Exception; use Exception;
use wsBase; use WsBase;
use RBAC; use RBAC;
/** /**
@@ -466,7 +466,7 @@ class Cases
if (!isset($row)) { if (!isset($row)) {
continue; continue;
} }
$ws = new wsBase(); $ws = new WsBase();
$fields = $ws->getCaseInfo($applicationUid, $row["DEL_INDEX"]); $fields = $ws->getCaseInfo($applicationUid, $row["DEL_INDEX"]);
$array = json_decode(json_encode($fields), true); $array = json_decode(json_encode($fields), true);
if ($array ["status_code"] != 0) { if ($array ["status_code"] != 0) {
@@ -533,7 +533,7 @@ class Cases
throw (new Exception($arrayData)); throw (new Exception($arrayData));
} }
} else { } else {
$ws = new wsBase(); $ws = new WsBase();
$fields = $ws->getCaseInfo($applicationUid, 0); $fields = $ws->getCaseInfo($applicationUid, 0);
$array = json_decode(json_encode($fields), true); $array = json_decode(json_encode($fields), true);
@@ -679,7 +679,7 @@ class Cases
{ {
try { try {
$ws = new wsBase(); $ws = new WsBase();
if ($variables) { if ($variables) {
$variables = array_shift($variables); $variables = array_shift($variables);
} }
@@ -723,7 +723,7 @@ class Cases
{ {
try { try {
$ws = new wsBase(); $ws = new WsBase();
if ($variables) { if ($variables) {
$variables = array_shift($variables); $variables = array_shift($variables);
} elseif ($variables == null) { } elseif ($variables == null) {
@@ -778,7 +778,7 @@ class Cases
$delIndex = AppDelegation::getCurrentIndex($applicationUid); $delIndex = AppDelegation::getCurrentIndex($applicationUid);
} }
$ws = new wsBase(); $ws = new WsBase();
$fields = $ws->reassignCase($userUid, $applicationUid, $delIndex, $userUidSource, $userUidTarget); $fields = $ws->reassignCase($userUid, $applicationUid, $delIndex, $userUidSource, $userUidTarget);
$array = json_decode(json_encode($fields), true); $array = json_decode(json_encode($fields), true);
if (array_key_exists("status_code", $array)) { if (array_key_exists("status_code", $array)) {
@@ -1009,7 +1009,7 @@ class Cases
$RBAC->sSystem = 'PROCESSMAKER'; $RBAC->sSystem = 'PROCESSMAKER';
} }
$case = new wsBase(); $case = new WsBase();
$result = $case->executeTrigger($userUid, $appUid, $triUid, $delIndex); $result = $case->executeTrigger($userUid, $appUid, $triUid, $delIndex);
if ($result->status_code != 0) { if ($result->status_code != 0) {
@@ -1076,7 +1076,7 @@ class Cases
} }
} }
$ws = new wsBase(); $ws = new WsBase();
$fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $bExecuteTriggersBeforeAssignment = false); $fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $bExecuteTriggersBeforeAssignment = false);
$array = json_decode(json_encode($fields), true); $array = json_decode(json_encode($fields), true);
if ($array ["status_code"] != 0) { if ($array ["status_code"] != 0) {

View File

@@ -701,7 +701,7 @@ class InputDocument
throw new \Exception(\G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", array($inputDocumentUid))); throw new \Exception(\G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", array($inputDocumentUid)));
} }
$ws = new \wsBase(); $ws = new \WsBase();
$ws->removeDocument($inputDocumentUid); $ws->removeDocument($inputDocumentUid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw $e; throw $e;

View File

@@ -69,7 +69,7 @@ class Consolidated
*/ */
public function postDerivate($app_uid, $app_number, $del_index, $usr_uid, $fieldName = '', $fieldValue = '') public function postDerivate($app_uid, $app_number, $del_index, $usr_uid, $fieldName = '', $fieldValue = '')
{ {
$ws = new \wsBase(); $ws = new \WsBase();
$oCase = new \Cases(); $oCase = new \Cases();
if (!isset($Fields["DEL_INIT_DATE"])) { if (!isset($Fields["DEL_INIT_DATE"])) {

View File

@@ -524,7 +524,7 @@ class Light
$delIndex = \AppDelegation::getCurrentIndex($applicationUid); $delIndex = \AppDelegation::getCurrentIndex($applicationUid);
} }
$ws = new \wsBase(); $ws = new \WsBase();
$fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $bExecuteTriggersBeforeAssignment = false, $tasks); $fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $bExecuteTriggersBeforeAssignment = false, $tasks);
$array = json_decode(json_encode($fields), true); $array = json_decode(json_encode($fields), true);
$array['message'] = trim(strip_tags($array['message'])); $array['message'] = trim(strip_tags($array['message']));

View File

@@ -368,7 +368,7 @@ class MessageApplication
try { try {
//Set variables //Set variables
$ws = new \wsBase(); $ws = new \WsBase();
$case = new \Cases(); $case = new \Cases();
$common = new \ProcessMaker\Util\Common(); $common = new \ProcessMaker\Util\Common();
$sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined"; $sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";

View File

@@ -357,7 +357,7 @@ class Pmgmail {
return false; return false;
} }
$ws = new \wsBase(); $ws = new \WsBase();
$resultMail = $ws->sendMessage( $resultMail = $ws->sendMessage(
$application['APP_UID'], $application['APP_UID'],
$defaultEmail, //From, $defaultEmail, //From,

View File

@@ -1211,7 +1211,7 @@ class TimerEvent
try { try {
//Set variables //Set variables
$ws = new \wsBase(); $ws = new \WsBase();
$case = new \Cases(); $case = new \Cases();
$common = new \ProcessMaker\Util\Common(); $common = new \ProcessMaker\Util\Common();
$sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined"; $sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";