Merge remote-tracking branch 'origin/bugfix/HOR-3670' into bugfix/HOR-3670-HQ

This commit is contained in:
hjonathan
2017-08-11 15:25:44 -04:00
51 changed files with 196 additions and 355 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

@@ -980,7 +980,7 @@ function synchronizeGmailLabels()
} }
$licensedFeatures = &PMLicensedFeatures::getSingleton(); $licensedFeatures = &PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) { if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
if ($pmGoogle->getServiceGmailStatus()) { if ($pmGoogle->getServiceGmailStatus()) {
setExecutionMessage("Synchronize labels in Gmail"); setExecutionMessage("Synchronize labels in Gmail");
$labGmail = new labelsGmail(); $labGmail = new labelsGmail();

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

@@ -10,7 +10,7 @@
*/class AppDocumentDrive */class AppDocumentDrive
{ {
/** /**
* @var PMDrive $drive * @var PmDrive $drive
*/ */
private $drive; private $drive;
/** /**
@@ -31,7 +31,7 @@
*/ */
public function __construct() public function __construct()
{ {
$this->drive = new PMDrive(); $this->drive = new PmDrive();
$status = $this->drive->getServiceDriveStatus(); $status = $this->drive->getServiceDriveStatus();
$status = !empty($status) ? ($status == 1 ? true : false): false; $status = !empty($status) ? ($status == 1 ? true : false): false;
$this->usersEmail = ''; $this->usersEmail = '';

View File

@@ -5,13 +5,7 @@ class Dashboards
{ {
public function getListDashboards ($start=0, $limit=20, $sort='', $dir='DESC', $search='') public function getListDashboards ($start=0, $limit=20, $sort='', $dir='DESC', $search='')
{ {
require_once 'classes/model/Dashboard.php';
require_once 'classes/model/DashboardIndicator.php';
require_once 'classes/model/Users.php';
require_once 'classes/model/Groupwf.php';
require_once 'classes/model/DashboardDasInd.php';
$limit_size = isset($limit) ? $limit: 20; $limit_size = isset($limit) ? $limit: 20;
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0; $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size; $limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;

View File

@@ -1,9 +1,7 @@
<?php <?php
require_once 'classes/interfaces/DashletInterface.php';
class DashletOpenVsCompleted implements DashletInterface
class dashletOpenVSCompleted implements DashletInterface
{ {
const version = '1.0'; const version = '1.0';

View File

@@ -1,9 +1,8 @@
<?php <?php
require_once 'classes/interfaces/DashletInterface.php';
class dashletProcessMakerCommunity implements DashletInterface class DashletProcessMakerCommunity implements DashletInterface
{ {
const version = '1.0'; const version = '1.0';

View File

@@ -1,9 +1,8 @@
<?php <?php
require_once 'classes/interfaces/DashletInterface.php';
class dashletProcessMakerEnterprise implements DashletInterface class DashletProcessMakerEnterprise implements DashletInterface
{ {
const version = '1.0'; const version = '1.0';

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

@@ -98,9 +98,9 @@ class labelsGmail
//The Subject to search the email //The Subject to search the email
$subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber; $subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber;
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$pmGoogle->setUser($mail); $pmGoogle->setUser($mail);
$pmGoogle->setScope(PMGoogleApi::GMAIL_MODIFY); $pmGoogle->setScope(PmGoogleApi::GMAIL_MODIFY);
$client = $pmGoogle->serviceClient(); $client = $pmGoogle->serviceClient();
$service = new Google_Service_Gmail($client); $service = new Google_Service_Gmail($client);
$labelsIds = $this->getLabelsIds($service); $labelsIds = $this->getLabelsIds($service);
@@ -148,9 +148,9 @@ class labelsGmail
//The Subject to search the email //The Subject to search the email
$subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber; $subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber;
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$pmGoogle->setUser($mail); $pmGoogle->setUser($mail);
$pmGoogle->setScope(PMGoogleApi::GMAIL_MODIFY); $pmGoogle->setScope(PmGoogleApi::GMAIL_MODIFY);
$client = $pmGoogle->serviceClient(); $client = $pmGoogle->serviceClient();
$service = new Google_Service_Gmail($client); $service = new Google_Service_Gmail($client);
$labelsIds = $this->getLabelsIds($service); $labelsIds = $this->getLabelsIds($service);
@@ -202,11 +202,11 @@ class labelsGmail
//The Subject to search the email //The Subject to search the email
$subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber; $subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber;
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$pmGoogle->setUser($mail); $pmGoogle->setUser($mail);
$pmGoogle->setScope(PMGoogleApi::GMAIL_MODIFY); $pmGoogle->setScope(PmGoogleApi::GMAIL_MODIFY);
$client = $pmGoogle->serviceClient(); $client = $pmGoogle->serviceClient();
$service = new Google_Service_Gmail($client); $service = new Google_Service_Gmail($client);
@@ -281,9 +281,9 @@ class labelsGmail
//The Subject to search the email //The Subject to search the email
$subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber; $subject = "[PM] " . $proName . " (" . $index . ") Case: " . $appNumber;
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$pmGoogle->setUser($mail); $pmGoogle->setUser($mail);
$pmGoogle->setScope(PMGoogleApi::GMAIL_MODIFY); $pmGoogle->setScope(PmGoogleApi::GMAIL_MODIFY);
$client = $pmGoogle->serviceClient(); $client = $pmGoogle->serviceClient();
$service = new Google_Service_Gmail($client); $service = new Google_Service_Gmail($client);
$labelsIds = $this->getLabelsIds($service); $labelsIds = $this->getLabelsIds($service);
@@ -329,11 +329,11 @@ class labelsGmail
*/ */
public function deletePMGmailLabels($mail) public function deletePMGmailLabels($mail)
{ {
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$pmGoogle->setUser($mail); $pmGoogle->setUser($mail);
$pmGoogle->setScope(PMGoogleApi::GMAIL_MODIFY); $pmGoogle->setScope(PmGoogleApi::GMAIL_MODIFY);
$client = $pmGoogle->serviceClient(); $client = $pmGoogle->serviceClient();
$service = new Google_Service_Gmail($client); $service = new Google_Service_Gmail($client);

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. * Exports the database and copies the files to an tar archive o several if the max filesize is reached.
*/ */
/** /**
* Class MultipleFilesBackup * Class MultipleFilesBackup
* create a backup of this workspace * create a backup of this workspace
@@ -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

@@ -1,29 +1,4 @@
<?php <?php
/**
* class.processes.php
*
* @package workflow.engine.ProcessMaker
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*/
/** /**
* Object Document class * Object Document class

View File

@@ -1,13 +1,6 @@
<?php <?php
/** class P11835 extends patch
* class, helping to set some not desirable settings but necesary
* @author reav
*
*/
abstract
class p11835 extends patch
{ {
/* /*
* Note.- Use before upgrade DB. * Note.- Use before upgrade DB.

View File

@@ -2,12 +2,8 @@
use ProcessMaker\Plugins\PluginRegistry; use ProcessMaker\Plugins\PluginRegistry;
require_once 'classes/interfaces/DashletInterface.php';
require_once 'classes/model/Dashlet.php';
require_once 'classes/model/DashletInstance.php';
class PmDashlet extends DashletInstance implements DashletInterface
class PMDashlet extends DashletInstance implements DashletInterface
{ {
// Own properties // Own properties

View File

@@ -1,15 +1,12 @@
<?php <?php
/**
* class.pmDrive.php
*
* @package workflow.engine.
/** /**
* class.pmDrive.php * class.pmDrive.php
* *
* @package workflow.engine.class * @package workflow.engine.class
* *
*/class PMDrive extends PMGoogleApi */
class PmDrive extends PmGoogleApi
{ {
private $folderIdPMDrive = ''; private $folderIdPMDrive = '';
private $folderNamePMDrive; private $folderNamePMDrive;

View File

@@ -11,7 +11,7 @@ require_once PATH_TRUNK . 'vendor' . PATH_SEP . 'google' . PATH_SEP . 'apiclient
/** /**
* class.pmGoogleApi.php * class.pmGoogleApi.php
* *
*/class PMGoogleApi */class PmGoogleApi
{ {
const DRIVE = 'https://www.googleapis.com/auth/drive'; const DRIVE = 'https://www.googleapis.com/auth/drive';
const DRIVE_FILE = 'https://www.googleapis.com/auth/drive.file'; const DRIVE_FILE = 'https://www.googleapis.com/auth/drive.file';

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
{ {
@@ -33,13 +14,11 @@ class Upgrade
{ {
$filter = new InputFilter(); $filter = new InputFilter();
//echo "Starting core installation...\n";
$start = microtime(1); $start = microtime(1);
$filename = $this->addon->getDownloadFilename(); $filename = $this->addon->getDownloadFilename();
$time = microtime(1); $time = microtime(1);
$archive = new Archive_Tar ($filename); $archive = new Archive_Tar ($filename);
//printf("Time to open archive: %f\n", microtime(1) - $time);
$time = microtime(1); $time = microtime(1);
$extractDir = dirname($this->addon->getDownloadFilename()) . "/extract"; $extractDir = dirname($this->addon->getDownloadFilename()) . "/extract";
$extractDir = $filter->xssFilterHard($extractDir); $extractDir = $filter->xssFilterHard($extractDir);
@@ -54,34 +33,22 @@ class Upgrade
if (!is_dir($backupDir)) { if (!is_dir($backupDir)) {
mkdir($backupDir); mkdir($backupDir);
} }
//printf("Time to remove old directory: %f\n", microtime(1) - $time);
$time = microtime(1); $time = microtime(1);
echo "Extracting files...\n"; echo "Extracting files...\n";
$archive->extractModify($extractDir, 'processmaker'); $archive->extractModify($extractDir, 'processmaker');
//printf("Time to extract all files: %f\n", microtime(1) - $time);
//$time = microtime(1);
//$files = $archive->listContent();
//printf("Time to get list of contents: %f\n", microtime(1) - $time);
/*$time = microtime(1);
foreach ($files as $fileinfo)
if (basename($fileinfo['filename']) == 'checksum.txt') {
$checksumFile = $archive->extractInString($fileinfo['filename']);
break;
}
printf("Time to get checksum.txt: %f\n", microtime(1) - $time);
*/
$checksumFile = file_get_contents("$extractDir/checksum.txt"); $checksumFile = file_get_contents("$extractDir/checksum.txt");
$time = microtime(1); $time = microtime(1);
$checksums = array(); $checksums = array();
foreach (explode("\n", $checksumFile) as $line) { foreach (explode("\n", $checksumFile) as $line) {
$checksums[trim(substr($line, 33))] = substr($line, 0, 32); $checksums[trim(substr($line, 33))] = substr($line, 0, 32);
} }
//printf("Time to assemble list of checksums: %f\n", microtime(1) - $time);
$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);
echo "Updating ProcessMaker files...\n"; echo "Updating ProcessMaker files...\n";
$time = microtime(1); $time = microtime(1);
$checksumTime = 0; $checksumTime = 0;
@@ -116,8 +83,7 @@ class Upgrade
} }
} }
} }
//printf("Time to create all checksums: %f\n", $checksumTime);
//printf("Time to copy files: %f\n", microtime(1) - $time);
printf("Updated %d files\n", count($changedFiles)); printf("Updated %d files\n", count($changedFiles));
printf("Clearing cache...\n"); printf("Clearing cache...\n");
if (defined('PATH_C')) { if (defined('PATH_C')) {
@@ -137,9 +103,24 @@ class Upgrade
$first = false; $first = false;
} catch (Exception $e) { } catch (Exception $e) {
printf("Errors upgrading workspace {$workspace->name}: {$e->getMessage()}\n"); printf("Errors upgrading workspace {$workspace->name}: {$e->getMessage()}\n");
//$errors = true;
} }
} }
//printf("Time to install: %f\n", microtime(1) - $start);
} }
private function ls_dir($dir, $basename = null)
{
$files = array();
if ($basename == null) {
$basename = $dir;
}
foreach (glob("$dir/*") as $filename) {
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;
@@ -868,8 +867,8 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
public function upgradeDatabase($onedb = false, $checkOnly = false) public function upgradeDatabase($onedb = false, $checkOnly = false)
{ {
$this->initPropel(true); $this->initPropel(true);
p11835::$dbAdapter = $this->dbAdapter; P11835::$dbAdapter = $this->dbAdapter;
p11835::isApplicable(); P11835::isApplicable();
$systemSchema = PmSystem::getSystemSchema($this->dbAdapter); $systemSchema = PmSystem::getSystemSchema($this->dbAdapter);
$systemSchemaRbac = PmSystem::getSystemSchemaRbac($this->dbAdapter);// get the Rbac Schema $systemSchemaRbac = PmSystem::getSystemSchemaRbac($this->dbAdapter);// get the Rbac Schema
$this->registerSystemTables(array_merge($systemSchema, $systemSchemaRbac)); $this->registerSystemTables(array_merge($systemSchema, $systemSchemaRbac));
@@ -943,7 +942,7 @@ use ProcessMaker\Plugins\Adapters\PluginAdapter;
} }
} }
p11835::execute(); P11835::execute();
return true; return true;
} }
@@ -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

@@ -281,7 +281,7 @@ class AppDelegation extends BaseAppDelegation
$licensedFeatures = &PMLicensedFeatures::getSingleton (); $licensedFeatures = &PMLicensedFeatures::getSingleton ();
if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) { if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) {
try{ try{
$pmGoogle = new PMGoogleApi (); $pmGoogle = new PmGoogleApi ();
if ($pmGoogle->getServiceGmailStatus()) { if ($pmGoogle->getServiceGmailStatus()) {
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail(); $Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail();
$Pmgmail->gmailsForRouting($sUsrUid, $sTasUid, $sAppUid, $delIndex, $isSubprocess); $Pmgmail->gmailsForRouting($sUsrUid, $sTasUid, $sAppUid, $delIndex, $isSubprocess);

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

@@ -22,7 +22,7 @@ class Dashboard extends Controller
G::header( 'location: login/login' ); G::header( 'location: login/login' );
exit(0); exit(0);
} }
$this->pmDashlet = new PMDashlet(); $this->pmDashlet = new PmDashlet();
} }
// Functions for the dashboards users module - Start // Functions for the dashboards users module - Start
@@ -244,14 +244,14 @@ class Dashboard extends Controller
if ($data->DAS_INS_UID != '') { if ($data->DAS_INS_UID != '') {
$this->pmDashlet->setup( $data->DAS_INS_UID ); $this->pmDashlet->setup( $data->DAS_INS_UID );
$this->setJSVar( 'dashletInstance', $this->pmDashlet->getDashletInstance() ); $this->setJSVar( 'dashletInstance', $this->pmDashlet->getDashletInstance() );
$this->setJSVar( 'additionalFields', PMDashlet::getAdditionalFields( get_class( $this->pmDashlet->getDashletObject() ) ) ); $this->setJSVar( 'additionalFields', PmDashlet::getAdditionalFields( get_class( $this->pmDashlet->getDashletObject() ) ) );
} else { } else {
$dashletInstance = new stdclass(); $dashletInstance = new stdclass();
$dashletInstance->DAS_UID = $dashlets[0][0]; $dashletInstance->DAS_UID = $dashlets[0][0];
$dashlet = new Dashlet(); $dashlet = new Dashlet();
$dashletFields = $dashlet->load( $dashletInstance->DAS_UID ); $dashletFields = $dashlet->load( $dashletInstance->DAS_UID );
$this->setJSVar( 'dashletInstance', $dashletInstance ); $this->setJSVar( 'dashletInstance', $dashletInstance );
$this->setJSVar( 'additionalFields', PMDashlet::getAdditionalFields( $dashletFields['DAS_CLASS'] ) ); $this->setJSVar( 'additionalFields', PmDashlet::getAdditionalFields( $dashletFields['DAS_CLASS'] ) );
} }
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
return null; return null;
@@ -305,7 +305,7 @@ class Dashboard extends Controller
$dashlet = new Dashlet(); $dashlet = new Dashlet();
$dashletFields = $dashlet->load( $data->DAS_UID ); $dashletFields = $dashlet->load( $data->DAS_UID );
if (! is_null( $dashletFields )) { if (! is_null( $dashletFields )) {
$result->additionalFields = PMDashlet::getAdditionalFields( $dashletFields['DAS_CLASS'] ); $result->additionalFields = PmDashlet::getAdditionalFields( $dashletFields['DAS_CLASS'] );
} else { } else {
throw new Exception( 'Dashlet "' . $data->DAS_UID . '" does not exist.' ); throw new Exception( 'Dashlet "' . $data->DAS_UID . '" does not exist.' );
} }

View File

@@ -10,7 +10,7 @@ class pmGmail extends Controller
{ {
public function saveConfigPmGmail($httpData) public function saveConfigPmGmail($httpData)
{ {
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$result = new StdClass(); $result = new StdClass();
$result->success = true; $result->success = true;
@@ -62,7 +62,7 @@ class pmGmail extends Controller
$this->setJSVar('__PMGMAIL_ERROR__', $_SESSION['__PMGMAIL_ERROR__']); $this->setJSVar('__PMGMAIL_ERROR__', $_SESSION['__PMGMAIL_ERROR__']);
unset($_SESSION['__PMGMAIL_ERROR__']); unset($_SESSION['__PMGMAIL_ERROR__']);
} }
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$accountEmail = $pmGoogle->getServiceAccountEmail(); $accountEmail = $pmGoogle->getServiceAccountEmail();
$googleCertificate = $pmGoogle->getServiceAccountCertificate(); $googleCertificate = $pmGoogle->getServiceAccountCertificate();
$statusGmail = $pmGoogle->getServiceGmailStatus(); $statusGmail = $pmGoogle->getServiceGmailStatus();
@@ -98,7 +98,7 @@ class pmGmail extends Controller
*/ */
public function testConfigPmGmail($httpData) public function testConfigPmGmail($httpData)
{ {
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$result = new stdClass(); $result = new stdClass();

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

@@ -7,7 +7,7 @@ $statusPMGmail = false;
$licensedFeatures = &PMLicensedFeatures::getSingleton(); $licensedFeatures = &PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) { if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
$statusPMGmail = $pmGoogle->getServiceGmailStatus(); $statusPMGmail = $pmGoogle->getServiceGmailStatus();
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/

View File

@@ -64,7 +64,7 @@ if ($aDelegation['USR_UID'] == "") {
$licensedFeatures = &PMLicensedFeatures::getSingleton(); $licensedFeatures = &PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) { if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.labelsGmail.php"); require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.labelsGmail.php");
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
if($pmGoogle->getServiceGmailStatus()) { if($pmGoogle->getServiceGmailStatus()) {
$labGmail = new labelsGmail(); $labGmail = new labelsGmail();
$labGmail->addRelabelingToQueue($sAppUid, $iDelIndex, -1, true); $labGmail->addRelabelingToQueue($sAppUid, $iDelIndex, -1, true);

View File

@@ -190,7 +190,7 @@ try {
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$licensedFeatures = &PMLicensedFeatures::getSingleton (); $licensedFeatures = &PMLicensedFeatures::getSingleton ();
if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) { if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) {
$pmGoogle = new PMGoogleApi (); $pmGoogle = new PmGoogleApi ();
if ($pmGoogle->getServiceGmailStatus ()) { if ($pmGoogle->getServiceGmailStatus ()) {
$flagGmail = true; $flagGmail = true;

View File

@@ -21,7 +21,7 @@ require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.la
$oLabels = new labelsGmail(); $oLabels = new labelsGmail();
$oLabels->addRelabelingToQueue($caseId, $actualIndex, $actualLastIndex, false); $oLabels->addRelabelingToQueue($caseId, $actualIndex, $actualLastIndex, false);
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
if(array_key_exists('gmail', $_SESSION) && $_SESSION['gmail'] == 1 && $pmGoogle->getServiceGmailStatus() ){ if(array_key_exists('gmail', $_SESSION) && $_SESSION['gmail'] == 1 && $pmGoogle->getServiceGmailStatus() ){
$_SESSION['gmail'] = 0; $_SESSION['gmail'] = 0;
unset($_SESSION['gmail']); //cleaning session unset($_SESSION['gmail']); //cleaning session

View File

@@ -72,7 +72,7 @@ $urlToRedirectAfterPause = 'casesListExtJs';
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$licensedFeatures = &PMLicensedFeatures::getSingleton(); $licensedFeatures = &PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) { if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
$pmGoogle = new PMGoogleApi(); $pmGoogle = new PmGoogleApi();
if (array_key_exists('gmail', $_SESSION) && $_SESSION['gmail'] == 1 && $pmGoogle->getServiceGmailStatus()) { if (array_key_exists('gmail', $_SESSION) && $_SESSION['gmail'] == 1 && $pmGoogle->getServiceGmailStatus()) {
$_SESSION['gmail'] = 0; $_SESSION['gmail'] = 0;
$urlToRedirectAfterPause = '/sys'. $_SESSION['WORKSPACE'] .'/en/neoclassic/cases/cases_Open?APP_UID='.$_SESSION['APPLICATION'].'&DEL_INDEX='.$_SESSION['INDEX'].'&action=sent'; $urlToRedirectAfterPause = '/sys'. $_SESSION['WORKSPACE'] .'/en/neoclassic/cases/cases_Open?APP_UID='.$_SESSION['APPLICATION'].'&DEL_INDEX='.$_SESSION['INDEX'].'&action=sent';

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;
use Applications; use Applications;
@@ -463,7 +463,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) {
@@ -530,7 +530,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);
@@ -676,7 +676,7 @@ class Cases
{ {
try { try {
$ws = new wsBase(); $ws = new WsBase();
if ($variables) { if ($variables) {
$variables = array_shift($variables); $variables = array_shift($variables);
} }
@@ -720,7 +720,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) {
@@ -775,7 +775,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)) {
@@ -1006,7 +1006,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) {
@@ -1073,7 +1073,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";