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

@@ -57,7 +57,7 @@ function run_addon_core_install($args)
}
///////
$ws = new workspaceTools($workspace);
$ws = new WorkspaceTools($workspace);
$ws->initPropel(false);
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
@@ -73,7 +73,7 @@ function run_addon_core_install($args)
$addon->install();
if ($addon->isCore()) {
$ws = new workspaceTools($workspace);
$ws = new WorkspaceTools($workspace);
$ws->initPropel(false);
$addon->setState("install-finish");
} 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) {
$workspaces = array();
foreach ($args as $arg) {
$workspaces[] = new workspaceTools($arg);
$workspaces[] = new WorkspaceTools($arg);
}
if (empty($workspaces) && $includeAll) {
$workspaces = PmSystem::listWorkspaces();

View File

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

View File

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

View File

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

View File

@@ -364,7 +364,7 @@ CLI::taskRun("regenerate_pmtable_classes");
*/
function run_info($args, $opts) {
$workspaces = get_workspaces_from_args($args);
workspaceTools::printSysInfo();
WorkspaceTools::printSysInfo();
foreach ($workspaces as $workspace) {
echo "\n";
$workspace->printMetadata(false);
@@ -490,7 +490,7 @@ function run_plugins_database_upgrade($args, $opts) {
function run_database_export($args, $opts) {
if (count($args) < 2)
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]);
}
@@ -670,10 +670,10 @@ function run_workspace_backup($args, $opts) {
if (sizeof($args) > 2) {
$filename = array_pop($args);
foreach ($args as $arg) {
$workspaces[] = new workspaceTools($arg);
$workspaces[] = new WorkspaceTools($arg);
}
} else if (sizeof($args) > 0) {
$workspace = new workspaceTools($args[0]);
$workspace = new WorkspaceTools($args[0]);
$workspaces[] = $workspace;
if (sizeof($args) == 2) {
$filename = $args[1];
@@ -712,14 +712,14 @@ function run_workspace_backup($args, $opts) {
$multipleBackup->letsBackup();
} else {
//ansient method to backup into one large file
$backup = workspaceTools::createBackup($filename);
$backup = WorkspaceTools::createBackup($filename);
foreach ($workspaces as $workspace) {
$workspace->backup($backup);
}
}
CLI::logging("\n");
workspaceTools::printSysInfo();
WorkspaceTools::printSysInfo();
foreach ($workspaces as $workspace) {
CLI::logging("\n");
$workspace->printMetadata(false);
@@ -747,7 +747,7 @@ function run_workspace_restore($args, $opts) {
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
$port = array_key_exists("port", $opts) ? $opts['port'] : '';
if ($info) {
workspaceTools::getBackupInfo($filename);
WorkspaceTools::getBackupInfo($filename);
} else {
CLI::logging("Restoring from $filename\n");
$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");
return;
}
workspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang, $port );
WorkspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang, $port );
}
}
} else {
@@ -890,7 +890,7 @@ function run_migrate_itee_to_dummytask($args, $opts){
$arrayWorkspace = get_workspaces_from_args($args);
foreach ($arrayWorkspace as $workspace) {
try {
$ws = new workspaceTools($workspace->name);
$ws = new WorkspaceTools($workspace->name);
$res = $ws->migrateIteeToDummytask($workspace->name);
} catch (Exception $e) {
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) {
$workspaces = get_workspaces_from_args($args);
//Check if the command is executed by a specific workspace
/** @var workspaceTools $workspace */
/** @var WorkspaceTools $workspace */
if (count($workspaces) === 1) {
$workspace = array_shift($workspaces);
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");
Bootstrap::setConstantsRelatedWs($args[0]);
$workspaceTools = new workspaceTools($args[0]);
$workspaceTools = new WorkspaceTools($args[0]);
$workspaceTools->fixReferencePathFiles(PATH_DATA_SITE . "classes", PATH_DATA);
$stop = microtime(true);

View File

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

View File

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

View File

@@ -6,7 +6,7 @@
*
* Exports the database and copies the files to an tar archive o several if the max filesize is reached.
*/
/**
* Class MultipleFilesBackup
* create a backup of this workspace
@@ -135,7 +135,7 @@
if (empty( $metaFiles )) {
$metaFiles = glob( $tempDirectory . "/*.txt" );
if (! empty( $metaFiles )) {
return workspaceTools::restoreLegacy( $tempDirectory );
return WorkspaceTools::restoreLegacy( $tempDirectory );
} else {
throw new Exception( "No metadata found in backup" );
}
@@ -170,7 +170,7 @@
} else {
CLI::logging( "> Restoring " . CLI::info( $backupWorkspace ) . " to " . CLI::info( $workspaceName ) . "\n" );
}
$workspace = new workspaceTools( $workspaceName );
$workspace = new WorkspaceTools( $workspaceName );
if ($workspace->workspaceExists()) {
if ($overwrite) {
CLI::logging( CLI::warning( "> Workspace $workspaceName already exist, overwriting!" ) . "\n" );
@@ -194,7 +194,7 @@
CLI::logging( "> Changing file permissions\n" );
$shared_stat = stat( PATH_DATA );
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 {
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 ();
foreach (glob( PATH_DB . "*" ) as $filename) {
if (is_dir( $filename ) && file_exists( $filename . "/db.php" )) {
$aWorkspaces[] = new workspaceTools( basename( $filename ) );
$aWorkspaces[] = new WorkspaceTools( basename( $filename ) );
}
}
return $aWorkspaces;

View File

@@ -1,24 +1,5 @@
<?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
{
@@ -80,7 +61,7 @@ class Upgrade
$checksum = array();
$changedFiles = array();
$time = microtime(1);
$files = ls_dir($extractDir);
$files = $this->ls_dir($extractDir);
//printf("Time to list files: %f\n", microtime(1) - $time);
echo "Updating ProcessMaker files...\n";
$time = microtime(1);
@@ -142,4 +123,24 @@ class Upgrade
}
//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\Plugins\Adapters\PluginAdapter;
/**
*
/**
* class workspaceTools.
*
* Utility functions to manage a workspace.
*
* @package workflow.engine.classes
*/class workspaceTools
*/
class WorkspaceTools
{
public $name = null;
public $path = null;
@@ -1236,11 +1235,11 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
public function printMetadata($printSysInfo = true)
{
if ($printSysInfo) {
workspaceTools::printSysInfo();
WorkspaceTools::printSysInfo();
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);
$workspaceData = G::json_decode($data);
CLI::logging("\n");
workspaceTools::printInfo((array)$workspaceData);
WorkspaceTools::printInfo((array)$workspaceData);
}
G::rm_dir($tempDirectory);
@@ -1600,7 +1599,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
if (basename($item) == "." || basename($item) == "..") {
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)) {
$metaFiles = glob($tempDirectory . "/*.txt");
if (!empty($metaFiles)) {
return workspaceTools::restoreLegacy($tempDirectory);
return WorkspaceTools::restoreLegacy($tempDirectory);
} else {
throw new Exception("No metadata found in backup");
}
@@ -1694,7 +1693,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
} else {
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 ($overwrite) {
@@ -1727,7 +1726,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
$shared_stat = stat(PATH_DATA);
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 {
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");
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 {
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)) {
CLI::logging(" Copying Enterprise.php file to $pathNewFile...\n");
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 {
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");
$con->begin();
$stmt = $con->createStatement();
foreach (workspaceTools::$populateIdsQueries as $query) {
foreach (WorkspaceTools::$populateIdsQueries as $query) {
$stmt->executeQuery($query);
}
$con->commit();

View File

@@ -1,38 +1,7 @@
<?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
/**
* 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
* 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
*
* @package workflow.engine.classes
*/class wsBase
*/
class WsBase
{
public $stored_system_variables; //boolean
public $wsSessionId; //web service session id, if the wsbase function is used from a WS request
@@ -1488,7 +1458,7 @@
{
try {
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;
}
@@ -1498,7 +1468,7 @@
$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;
} catch (Exception $e) {
@@ -1519,7 +1489,7 @@
{
try {
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;
}
@@ -1527,13 +1497,13 @@
$department = new Department();
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;
}
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;
}
@@ -1547,7 +1517,7 @@
$data['PARENT_UID'] = $parentUID;
$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;
} catch (Exception $e) {

View File

@@ -1,41 +1,12 @@
<?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
*
* @package workflow.engine.classes
*/class wsCreateDepartmentResponse
*/
class WsCreateDepartmentResponse
{
public $status_code = 0;
public $message = '';

View File

@@ -1,41 +1,11 @@
<?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
*
* @package workflow.engine.classes
*/class wsCreateGroupResponse
*/
class WsCreateGroupResponse
{
public $status_code = 0;
public $message = '';

View File

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

View File

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

View File

@@ -361,7 +361,7 @@ class Content extends BaseContent
FROM CONTENT
ORDER BY CON_ID, CON_CATEGORY, CON_PARENT, CON_LANG";
$workSpace = new workspaceTools( $workSpace );
$workSpace = new WorkspaceTools( $workSpace );
$workSpace->getDBInfo();
$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();
$dbConnections = $dbConn->getConnectionsProUid( $proUid, array('mysql') );
$workSpace = new workspaceTools(SYS_SYS);
$workSpace = new WorkspaceTools(SYS_SYS);
$workspaceDB = $workSpace->getDBInfo();
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);
$ws = new wsBase();
$ws = new WsBase();
$result = $ws->derivateCase(
$caseFieldsABE['CURRENT_USER_UID'], $_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX'], true

View File

@@ -101,7 +101,7 @@ if (PMLicensedFeatures
//Update case info
$case->updateCase($appUid, $casesFields);
$wsBaseInstance = new wsBase();
$wsBaseInstance = new WsBase();
$result = $wsBaseInstance->derivateCase($casesFields['CURRENT_USER_UID'], $appUid, $delIndex, true);
$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)
{
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->login( $params->userid, $params->password );
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) {
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->processList();
return array ("processes" => $res
@@ -54,14 +54,14 @@ function ProcessList ($params)
$session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID'];
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->processListVerified( $userId );
return array ("processes" => $res
);
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->processList();
return array ("processes" => $res
@@ -88,7 +88,7 @@ function RoleList ($params)
);
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->roleList();
return array ("roles" => $res
@@ -115,7 +115,7 @@ function GroupList ($params)
);
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->groupList();
return array ("groups" => $res
@@ -142,7 +142,7 @@ function DepartmentList ($params)
);
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->departmentList();
return array ("departments" => $res
@@ -179,7 +179,7 @@ function CaseList ($params)
$session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID'];
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->caseList( $userId );
return array ("cases" => $res
@@ -211,7 +211,7 @@ function UnassignedCaseList ($params)
$session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID'];
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->unassignedCaseList( $userId );
return array ("cases" => $res
@@ -238,7 +238,7 @@ function UserList ($params)
);
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->userList();
return array ("users" => $res
@@ -267,7 +267,7 @@ function triggerList ($params)
);
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->triggerList();
return array ("triggers" => $res
@@ -312,7 +312,7 @@ function outputDocumentList ($params)
$session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID'];
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->outputDocumentList( $params->caseId, $userId );
return array ("documents" => $res
@@ -357,7 +357,7 @@ function inputDocumentList ($params)
$session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID'];
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->inputDocumentList( $params->caseId, $userId );
return array ("documents" => $res
@@ -386,7 +386,7 @@ function inputDocumentProcessList ($params)
);
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->inputDocumentProcessList( $params->processId );
return array ("documents" => $res
@@ -407,7 +407,7 @@ function removeDocument ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->removeDocument( $params->appDocUid );
return $res;
@@ -427,7 +427,7 @@ function SendMessage ($params)
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 );
return $res->getPayloadArray();
@@ -447,7 +447,7 @@ function getCaseInfo ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->getCaseInfo( $params->caseId, $params->delIndex );
return $res;
@@ -467,7 +467,7 @@ function SendVariables ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$variables = $params->variables;
$Fields = array ();
@@ -506,7 +506,7 @@ function GetVariables ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->getVariables( $params->caseId, $params->variables );
@@ -528,7 +528,7 @@ function GetVariablesNames ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->getVariablesNames( $params->caseId );
@@ -556,7 +556,7 @@ function DerivateCase ($params)
$oStd->stored_system_variables = true;
$oStd->wsSessionId = $params->sessionId;
$ws = new wsBase( $oStd );
$ws = new WsBase( $oStd );
$res = $ws->derivateCase($user["USR_UID"], $params->caseId, $params->delIndex, true);
return $res;
@@ -584,7 +584,7 @@ function RouteCase ($params)
$oStd->stored_system_variables = true;
$oStd->wsSessionId = $params->sessionId;
$ws = new wsBase( $oStd );
$ws = new WsBase( $oStd );
$res = $ws->derivateCase($user["USR_UID"], $params->caseId, $params->delIndex, true);
return $res;
@@ -608,7 +608,7 @@ function executeTrigger ($params)
$oSession = new Sessions();
$user = $oSession->getSessionUser( $params->sessionId );
$ws = new wsBase();
$ws = new WsBase();
$delIndex = (isset( $params->delIndex )) ? $params->delIndex : 1;
$res = $ws->executeTrigger( $user['USR_UID'], $params->caseId, $params->triggerIndex, $delIndex );
@@ -649,7 +649,7 @@ function NewCaseImpersonate ($params)
$params->variables = $field;
///////
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->newCaseImpersonate($params->processId, $params->userId, $params->variables, $params->taskId);
return $res;
@@ -712,7 +712,7 @@ function NewCase($params)
$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);
@@ -743,7 +743,7 @@ function AssignUserToGroup ($params)
return new wsResponse( 3, 'User not registered in the system' );
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->assignUserToGroup( $params->userId, $params->groupId );
return $res->getPayloadArray();
@@ -770,7 +770,7 @@ function AssignUserToDepartment ($params)
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 );
return $res->getPayloadArray();
@@ -790,7 +790,7 @@ function CreateUser ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
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) );
@@ -815,7 +815,7 @@ function updateUser ($params)
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) );
@@ -836,7 +836,7 @@ function informationUser($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$result = $ws->informationUser($params->userUid);
return $result;
@@ -847,18 +847,18 @@ function CreateGroup ($params)
$vsResult = isValidSession( $params->sessionId );
if ($vsResult->status_code !== 0) {
$result = new wsCreateGroupResponse( $vsResult->status_code, $vsResult->message, '' );
$result = new WsCreateGroupResponse( $vsResult->status_code, $vsResult->message, '' );
return $result;
}
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;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->createGroup( $params->name );
return $res;
@@ -878,7 +878,7 @@ function CreateDepartment ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->CreateDepartment( $params->name, $params->parentUID );
return $res;
@@ -904,7 +904,7 @@ function TaskList ($params)
);
}
$ws = new wsBase();
$ws = new WsBase();
$oSessions = new Sessions();
$session = $oSessions->getSessionUser( $params->sessionId );
$userId = $session['USR_UID'];
@@ -934,7 +934,7 @@ function TaskCase ($params)
);
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->taskCase( $params->caseId );
return array ("taskCases" => $res
@@ -948,7 +948,7 @@ function ReassignCase ($params)
return $vsResult;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->reassignCase( $params->sessionId, $params->caseId, $params->delIndex, $params->userIdSource, $params->userIdTarget );
return $res;
@@ -962,7 +962,7 @@ function systemInformation ($params)
return $vsResult;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->systemInformation();
return $res;
@@ -976,7 +976,7 @@ function getCaseNotes ($params)
return $vsResult;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->getCaseNotes( $params->applicationID, $params->userUid );
return $res;
@@ -1008,7 +1008,7 @@ function removeUserFromGroup ($params)
return $vsResult;
}
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->removeUserFromGroup( $params->userId, $params->groupId );
return $res;
@@ -1052,7 +1052,7 @@ function deleteCase ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$result = $ws->deleteCase( $params->caseUid );
return $result;
@@ -1072,7 +1072,7 @@ function cancelCase ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$result = $ws->cancelCase( $params->caseUid, $params->delIndex, $params->userUid );
return $result;
@@ -1092,7 +1092,7 @@ function pauseCase ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$result = $ws->pauseCase( $params->caseUid, $params->delIndex, $params->userUid, ((isset( $params->unpauseDate )) ? $params->unpauseDate : null) );
@@ -1113,7 +1113,7 @@ function unpauseCase ($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$result = $ws->unpauseCase( $params->caseUid, $params->delIndex, $params->userUid );
return $result;
@@ -1133,7 +1133,7 @@ function addCaseNote($params)
return $result;
}
$ws = new wsBase();
$ws = new WsBase();
$result = $ws->addCaseNote(
$params->caseUid,
$params->processUid,
@@ -1162,7 +1162,7 @@ function claimCase($params)
$oSessions = new Sessions();
$session = $oSessions->getSessionUser($params->sessionId);
$ws = new wsBase();
$ws = new WsBase();
$res = $ws->claimCase($session['USR_UID'], $params->guid, $params->delIndex);
return $res;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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