HOR-4604
This commit is contained in:
@@ -8,7 +8,9 @@ CLI::taskDescription("Upgrade workspaces.\n\n This command should be run after u
|
||||
|
||||
CLI::taskOpt('buildACV', 'If this option is enabled, the Cache View is built.', 'ACV', 'buildACV');
|
||||
CLI::taskOpt('noxml', 'If this option is enabled, the XML files translation is not built.', 'NoXml', 'no-xml');
|
||||
/*----------------------------------********---------------------------------*/
|
||||
CLI::taskOpt('include_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --include_dyn_content", 'i', 'include_dyn_content');
|
||||
/*----------------------------------********---------------------------------*/
|
||||
CLI::taskRun("run_upgrade");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
CLI::taskName('unify-database');
|
||||
@@ -109,7 +111,9 @@ function run_upgrade($command, $args)
|
||||
$buildCacheView = array_key_exists('buildACV', $args);
|
||||
$flagUpdateXml = !array_key_exists('noxml', $args);
|
||||
$optionMigrateHistoryData = [
|
||||
/*----------------------------------********---------------------------------*/
|
||||
'includeDynContent' => array_key_exists('include_dyn_content', $args)
|
||||
/*----------------------------------********---------------------------------*/
|
||||
];
|
||||
|
||||
foreach ($workspaces as $index => $workspace) {
|
||||
|
||||
@@ -50,7 +50,9 @@ CLI::taskOpt("workspace", "Specify which workspace to restore if multiple worksp
|
||||
Ex: -wworkflow.", "w:", "workspace=");
|
||||
CLI::taskOpt("lang", "Specify the language which will be used to rebuild the case cache list. If this option isn't included, then 'en' (English) will be used by default.", "l:", "lang=");
|
||||
CLI::taskOpt("port", "Specify the port number used by MySQL. If not specified, then the port 3306 will be used by default.", "p:");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
CLI::taskOpt('include_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --include_dyn_content", 'd', 'include_dyn_content');
|
||||
/*----------------------------------********---------------------------------*/
|
||||
CLI::taskRun("run_workspace_restore");
|
||||
|
||||
CLI::taskName('cacheview-repair');
|
||||
@@ -343,6 +345,7 @@ EOT
|
||||
CLI::taskArg('workspace');
|
||||
CLI::taskRun("regenerate_pmtable_classes");
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/**
|
||||
* Migrate the data from APP_HISTORY table to the new table APP_DATA_CHANGE_LOG.
|
||||
*/
|
||||
@@ -354,6 +357,7 @@ EOT
|
||||
CLI::taskArg('workspace');
|
||||
CLI::taskRun('migrate_history_data');
|
||||
CLI::taskOpt('include_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --include_dyn_content", 'i', 'include_dyn_content');
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
/**
|
||||
* Function run_info
|
||||
@@ -854,7 +858,9 @@ function run_workspace_restore($args, $opts)
|
||||
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
|
||||
$port = array_key_exists("port", $opts) ? $opts['port'] : '';
|
||||
$optionMigrateHistoryData = [
|
||||
/*----------------------------------********---------------------------------*/
|
||||
'includeDynContent' => array_key_exists('include_dyn_content', $args)
|
||||
/*----------------------------------********---------------------------------*/
|
||||
];
|
||||
if ($info) {
|
||||
WorkspaceTools::getBackupInfo($filename);
|
||||
@@ -1285,6 +1291,7 @@ function regenerate_pmtable_classes($args, $opts)
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/**
|
||||
* This method migrates data from APP_HISTORY table to APP_DATA_CHANGE_LOG table.
|
||||
*
|
||||
@@ -1324,3 +1331,4 @@ function migrate_history_data($args, $opts)
|
||||
}
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
use ProcessMaker\BusinessModel\User as BusinessModelUser;
|
||||
use ProcessMaker\BusinessModel\WebEntryEvent;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
@@ -900,7 +902,7 @@ class Cases
|
||||
$aFieldsHistory['APP_DATA'] = serialize($FieldsDifference);
|
||||
$appHistory->insertHistory($aFieldsHistory);
|
||||
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$type = isset($Fields['OBJECT_TYPE']) ?
|
||||
$Fields['OBJECT_TYPE'] : ChangeLog::getChangeLog()->getObjectNameById(ChangeLog::DYNAFORM);
|
||||
ChangeLog::getChangeLog()
|
||||
@@ -912,6 +914,7 @@ class Cases
|
||||
->getTasIdByTasUid($Fields['TAS_UID'])
|
||||
->getObjectIdByUidAndObjType($Fields['CURRENT_DYNAFORM'], $type)
|
||||
->register();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
//End Save History
|
||||
@@ -3431,9 +3434,11 @@ class Cases
|
||||
*/
|
||||
public function executeTriggers($sTasUid, $sStepType, $sStepUidObj, $sTriggerType, $aFields = array())
|
||||
{
|
||||
/*----------------------------------********---------------------------------*/
|
||||
ChangeLog::getChangeLog()
|
||||
->setObjectUid($sStepUidObj)
|
||||
->getExecutedAtIdByTriggerType($sTriggerType);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$aTriggers = $this->loadTriggers($sTasUid, $sStepType, $sStepUidObj, $sTriggerType);
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Core\Installer;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\Adapters\PluginAdapter;
|
||||
@@ -341,12 +343,14 @@ class WorkspaceTools
|
||||
$stop = microtime(true);
|
||||
CLI::logging("<*> Migrating and populating plugin singleton data took " . ($stop - $start) . " seconds.\n");
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$includeDynContent = isset($optionMigrateHistoryData['includeDynContent']) && $optionMigrateHistoryData['includeDynContent'] === true;
|
||||
$start = microtime(true);
|
||||
CLI::logging("> Migrating history data...\n");
|
||||
$this->migrateAppHistoryToAppDataChangeLog(false, !$includeDynContent);
|
||||
$stop = microtime(true);
|
||||
CLI::logging("<*> Migrating history data took " . ($stop - $start) . " seconds.\n");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2062,12 +2066,14 @@ class WorkspaceTools
|
||||
//Updating generated class files for PM Tables
|
||||
passthru(PHP_BINARY . ' processmaker regenerate-pmtable-classes ' . $workspace->name);
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$includeDynContent = isset($optionMigrateHistoryData['includeDynContent']) && $optionMigrateHistoryData['includeDynContent'] === true;
|
||||
$start = microtime(true);
|
||||
CLI::logging("> Migrating history data...\n");
|
||||
$workspace->migrateAppHistoryToAppDataChangeLog(false, !$includeDynContent);
|
||||
$stop = microtime(true);
|
||||
CLI::logging("<*> Migrating history data took " . ($stop - $start) . " seconds.\n");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
CLI::logging("Removing temporary files\n");
|
||||
@@ -4231,6 +4237,7 @@ class WorkspaceTools
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/**
|
||||
* Migrate the contents of table APP_HISTORY to table APP_DATA_CHANGE_LOG.
|
||||
*
|
||||
@@ -4389,4 +4396,5 @@ class WorkspaceTools
|
||||
$conf->aConfig = ['updated' => true];
|
||||
$conf->saveConfig('MIGRATED_APP_HISTORY', 'history');
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\BusinessModel\EmailServer;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
class WsBase
|
||||
@@ -2257,6 +2259,7 @@ class WsBase
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
ChangeLog::getChangeLog()
|
||||
->setDate('now')
|
||||
->setAppNumber($appData['APP_NUMBER'])
|
||||
@@ -2266,6 +2269,7 @@ class WsBase
|
||||
->setData(serialize($appData))
|
||||
->getExecutedAtIdByTriggerType($triggerType)
|
||||
->getObjectIdByUidAndObjType($stepUidObj, $stepType);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
return $varTriggers;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\BusinessModel\Cases as BmCases;
|
||||
use ProcessMaker\BusinessModel\Cases\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLogResult;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
@@ -780,13 +783,26 @@ class Ajax
|
||||
$appUid = $idHistoryArray[1];
|
||||
$tasUid = $idHistoryArray[2];
|
||||
|
||||
$changeLog = new ChangeLogResult();
|
||||
$result = $changeLog->setAppUid($appUid)
|
||||
->setUserLogged($_SESSION['USER_LOGGED'])
|
||||
->setProUid($proUid)
|
||||
->setTasUid($tasUid)
|
||||
->getLogs();
|
||||
echo json_encode($result);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (true) {
|
||||
//In enterprise version this snippet of code should be always be executed
|
||||
//In community version this snippet of code is deleted and is executed the next snippet of code
|
||||
$changeLog = new ChangeLogResult();
|
||||
$result = $changeLog->setAppUid($appUid)
|
||||
->setUserLogged($_SESSION['USER_LOGGED'])
|
||||
->setProUid($proUid)
|
||||
->setTasUid($tasUid)
|
||||
->getLogs();
|
||||
echo G::json_encode($result);
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$start = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
|
||||
$limit = isset($_REQUEST['limit']) ? (int) $_REQUEST['limit'] : 15;
|
||||
$changeLog = new ChangeLog();
|
||||
echo G::json_encode($changeLog->getChangeLog($appUid, $proUid, $tasUid, $start, $limit));
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
public function changeLogTab()
|
||||
|
||||
@@ -25,7 +25,9 @@ use ProcessMaker\BusinessModel\Cases as BusinessModelCases;
|
||||
use ProcessMaker\BusinessModel\Lists;
|
||||
use ProcessMaker\BusinessModel\Task as BusinessModelTask;
|
||||
use ProcessMaker\BusinessModel\User as BusinessModelUser;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Core\RoutingScreen;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Services\Api\Project\Activity\Step as ActivityStep;
|
||||
@@ -601,8 +603,10 @@ class Light
|
||||
$tasks
|
||||
);
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
ChangeLog::getChangeLog()
|
||||
->register();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
$array['message'] = trim(strip_tags($array['message']));
|
||||
|
||||
@@ -3,7 +3,9 @@ namespace ProcessMaker\Services\OAuth2;
|
||||
|
||||
use Luracast\Restler\iAuthenticate;
|
||||
use Luracast\Restler\RestException;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
class Server implements iAuthenticate
|
||||
@@ -374,6 +376,7 @@ class Server implements iAuthenticate
|
||||
$_SESSION['USR_TIME_ZONE'] = $userTimeZone;
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
ChangeLog::getChangeLog()
|
||||
->setUsrId(is_null($user) ? 0 : $user->getUsrId())
|
||||
->setSkin(SYS_SKIN)
|
||||
@@ -386,6 +389,7 @@ class Server implements iAuthenticate
|
||||
ChangeLog::getChangeLog()
|
||||
->setSourceId(ChangeLog::FromWeb);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
return $allowed;
|
||||
}
|
||||
|
||||
@@ -1,29 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Bootstrap.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 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. BaseCaseTrackerObjectPeerSee 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.
|
||||
*/
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
@@ -1102,11 +1082,13 @@ if (!defined('EXECUTE_BY_CRON')) {
|
||||
} else {
|
||||
//NewRelic Snippet - By JHL
|
||||
transactionLog($phpFile);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
ChangeLog::getChangeLog()
|
||||
->setSourceId(ChangeLog::FromWeb)
|
||||
->setSkin(SYS_SKIN)
|
||||
->setLanguage(SYS_LANG)
|
||||
->getUsrIdByUsrUid(empty($_SESSION['USER_LOGGED']) ? '' : $_SESSION['USER_LOGGED']);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
require_once $phpFile;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user